Changeset 1445

Show
Ignore:
Timestamp:
12/12/07 00:53:33 (9 months ago)
Author:
rho
Message:

Fixed short open tag issue and use gettext function

Signed-off: Rolando Espinoza La fuente <rho@prosoftpeople.com>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/install.php

    r1430 r1445  
    1818    if (file_exists('./config.php') && config_check_db()) { 
    1919        $config_ready = true; 
    20         $messages[] = t('You have already configured Elgg and can safely remove the file <code>install.php</code> from your installation.'); 
     20        $messages[] = __gettext('You have already configured Elgg and can safely remove the file <code>install.php</code> from your installation.'); 
    2121    } 
    2222     
     
    3333<html xmlns="http://www.w3.org/1999/xhtml"> 
    3434<head> 
    35 <title>Elgg <?=$version ?> <?=t('installation') ?></title> 
     35<title>Elgg <?php echo $version ?> <?php echo __gettext('installation') ?></title> 
    3636<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    3737<style type="text/css" media="all"> 
     
    372372 
    373373<div id="header"> 
    374     <h1><?=t('Welcome to elgg installation') ?></h1> 
     374    <h1><?php echo __gettext('Welcome to elgg installation') ?></h1> 
    375375</div><!-- #header --> 
    376376 
     
    386386            config_copy_htaccess(); 
    387387?> 
    388             <p><?=t('Your configuration file has been saved, you can now proceed with the installation.') ?></p> 
     388            <p><?php echo __gettext('Your configuration file has been saved, you can now proceed with the installation.') ?></p> 
    389389 
    390390<?php if (is_writable(dirname(__FILE__))) { ?> 
    391             <p><?=t('Please revert your permissions on your <em>elgg directory</em> for more security.') ?></p> 
     391            <p><?php echo __gettext('Please revert your permissions on your <em>elgg directory</em> for more security.') ?></p> 
    392392<?php } else { ?> 
    393             <p><?=t('Please revert your permissions on <code>config.php</code> for more security.') ?></p> 
     393            <p><?php echo __gettext('Please revert your permissions on <code>config.php</code> for more security.') ?></p> 
    394394<?php } ?> 
    395395            <div class="setup"> 
     
    397397                if (!config_check_db()) { 
    398398                    echo '<div style="color:#900;">'; 
    399                     echo t('<strong>Error:</strong> Database connection failed, please edit <code>config.php</code> to include the correct values. '); 
    400                     echo '<br />&raquo; ' . t('<a href="install.php">Try again installation wizard</a>.'); 
     399                    echo __gettext('<strong>Error:</strong> Database connection failed, please edit <code>config.php</code> to include the correct values. '); 
     400                    echo '<br />&raquo; ' . __gettext('<a href="install.php">Try again installation wizard</a>.'); 
    401401                    echo '</div>'; 
    402402                } else { 
     
    442442 
    443443<?php       } else { ?> 
    444 <p><?=t('Your configuration file is not writable, please copy the following  content and save it as <code>config.php</code> inside your elgg installation.') ?></p> 
    445  
    446     <textarea id="config-file" onclick="this.select()"><?=config_file() ?></textarea> 
     444<p><?php echo __gettext('Your configuration file is not writable, please copy the following  content and save it as <code>config.php</code> inside your elgg installation.') ?></p> 
     445 
     446    <textarea id="config-file" onclick="this.select()"><?php echo config_file() ?></textarea> 
    447447 
    448448<?php 
     
    460460 
    461461<div id="footer"> 
    462 <p>elgg <?=$version ?></p> 
     462<p>elgg <?php echo $version ?></p> 
    463463</div> 
    464464 
     
    467467</html> 
    468468<?php 
    469  
    470 /** 
    471  * Alias for __gettext 
    472  * @param string $s 
    473  *      The string to translate 
    474  * @return string 
    475  *      Translated string 
    476  */ 
    477 function t($s) { 
    478     if (function_exists('__gettext')) { 
    479         return __gettext($s); 
    480     } else { 
    481         return $s; 
    482     } 
    483 } 
    484469 
    485470/** 
     
    519504 
    520505    $configs = array(); 
    521     $configs['wwwroot']->name = t('Web root'); 
    522     $configs['wwwroot']->desc = t('External URL to the site (eg: http://elgg.boston.edu/). *MUST* have a final slash at end.'); 
    523     $configs['admin']->name = t('Admin username'); 
    524     $configs['admin']->desc = t('Initial administrator username'); 
    525     $configs['adminpw']->name = t('Admin password'); 
    526     $configs['adminpw']->desc = t('Initial administrator password, at least 6 chars.'); 
    527     $configs['adminemail']->name = t('System email'); 
    528     $configs['adminemail']->desc = t('Email address for system notifications.'); 
    529     $configs['dbtype']->name = t('Database type'); 
    530     $configs['dbtype']->desc = t('PostgreSQL and MySQL supported. But is highly recommended MySQL'); 
    531     $configs['dbhost']->name = t('Database host'); 
    532     $configs['dbuser']->name = t('Database username'); 
    533     $configs['dbpass']->name = t('Database password'); 
     506    $configs['wwwroot']->name = __gettext('Web root'); 
     507    $configs['wwwroot']->desc = __gettext('External URL to the site (eg: http://elgg.boston.edu/). *MUST* have a final slash at end.'); 
     508    $configs['admin']->name = __gettext('Admin username'); 
     509    $configs['admin']->desc = __gettext('Initial administrator username'); 
     510    $configs['adminpw']->name = __gettext('Admin password'); 
     511    $configs['adminpw']->desc = __gettext('Initial administrator password, at least 6 chars.'); 
     512    $configs['adminemail']->name = __gettext('System email'); 
     513    $configs['adminemail']->desc = __gettext('Email address for system notifications.'); 
     514    $configs['dbtype']->name = __gettext('Database type'); 
     515    $configs['dbtype']->desc = __gettext('PostgreSQL and MySQL supported. But is highly recommended MySQL'); 
     516    $configs['dbhost']->name = __gettext('Database host'); 
     517    $configs['dbuser']->name = __gettext('Database username'); 
     518    $configs['dbpass']->name = __gettext('Database password'); 
    534519    $configs['dbpass']->not_required = true; 
    535     $configs['dbname']->name = t('Database name'); 
    536     $configs['prefix']->name = t('Database table prefix'); 
     520    $configs['dbname']->name = __gettext('Database name'); 
     521    $configs['prefix']->name = __gettext('Database table prefix'); 
    537522 
    538523    if (config_submitted()) { config_validate(); } 
     
    574559 
    575560    if (!extension_loaded('mysql')) { 
    576         $messages[] = t('<strong>Warning:</strong> Your system does not support <code>mysql</code>.'); 
     561        $messages[] = __gettext('<strong>Warning:</strong> Your system does not support <code>mysql</code>.'); 
    577562    } 
    578563 
    579564    if (!extension_loaded('pgsql')) { 
    580         $messages[] = t('<strong>Warning:</strong> Your system does not support <code>pgsql</code>.'); 
     565        $messages[] = __gettext('<strong>Warning:</strong> Your system does not support <code>pgsql</code>.'); 
    581566    } 
    582567 
    583568    if (file_exists($CFG->dirroot . 'config.php')) { 
    584569        if (!is_writable($CFG->dirroot . 'config.php')) { 
    585             $messages[] = t("<strong>Error:</strong> please make sure the file <code>{$CFG->dirroot}config.php</code> is writable in order to save your configuration."); 
     570            $messages[] = __gettext("<strong>Error:</strong> please make sure the file <code>{$CFG->dirroot}config.php</code> is writable in order to save your configuration."); 
    586571        } 
    587572    } elseif (!is_writable($CFG->dirroot)) { 
    588         $messages[] = t("<strong>Error:</strong> please make sure the install directory <code>{$CFG->dirroot}</code> is writable in order to save your configuration."); 
     573        $messages[] = __gettext("<strong>Error:</strong> please make sure the install directory <code>{$CFG->dirroot}</code> is writable in order to save your configuration."); 
    589574    } 
    590575 
    591576    if (!is_writable($CFG->dataroot)) { 
    592         $messages[] = t("<strong>Error:</strong> please make sure the elgg data directory <code>{$CFG->dataroot}</code> is writable."); 
     577        $messages[] = __gettext("<strong>Error:</strong> please make sure the elgg data directory <code>{$CFG->dataroot}</code> is writable."); 
    593578    } 
    594579 
     
    659644    } 
    660645 
    661     $output .= '<p class="continuebutton"><input type="submit" name="submit" value="' . t('Write config') .'" /></p>'; 
     646    $output .= '<p class="continuebutton"><input type="submit" name="submit" value="' . __gettext('Write config') .'" /></p>'; 
    662647    $output .= '</form>'; 
    663648 
     
    692677 
    693678    if (!preg_match($urlregex, $_POST['wwwroot'])) { 
    694         $messages[] = t('<strong>Error:</strong> Web root incorrect, please enter a valid url.'); 
     679        $messages[] = __gettext('<strong>Error:</strong> Web root incorrect, please enter a valid url.'); 
    695680        $configs['wwwroot']->error = true; 
    696681    } 
    697682 
    698683    if (!validate_username($_POST['admin'])) { 
    699         $messages[] = t('<strong>Error:</strong> Invalid administrator username, please try again.'); 
     684        $messages[] = __gettext('<strong>Error:</strong> Invalid administrator username, please try again.'); 
    700685        $configs['admin']->error = true; 
    701686    } 
    702687 
    703688    if (empty($_POST['adminpw']) || strlen($_POST['adminpw']) < 6) { 
    704         $messages[] = t('<strong>Error:</strong> Invalid administrator password. Please enter at least 6 chars.'); 
     689        $messages[] = __gettext('<strong>Error:</strong> Invalid administrator password. Please enter at least 6 chars.'); 
    705690        $configs['adminpw']->error = true; 
    706691    } 
    707692 
    708693    if (!validate_email($_POST['adminemail'])) { 
    709         $messages[] = t('<strong>Error:</strong> Invalid administrator email, please enter a valid email address.'); 
     694        $messages[] = __gettext('<strong>Error:</strong> Invalid administrator email, please enter a valid email address.'); 
    710695        $configs['adminemail']->error = true; 
    711696    } 
    712697 
    713698    if (!in_array($_POST['dbtype'], array('mysql', 'postgres7'))) { 
    714         $messages[] = t('<strong>Error:</strong> Database type unknown.'); 
     699        $messages[] = __gettext('<strong>Error:</strong> Database type unknown.'); 
    715700        $configs['dbtype']->error = true; 
    716701    } elseif (function_exists('extension_loaded')) { 
    717702        if ($_POST['dbtype'] == 'mysql' && !extension_loaded('mysql')) { 
    718             $messages[] = t('<strong>Error:</strong> Database type <em>(mysql)</em> not supported on your system.'); 
     703            $messages[] = __gettext('<strong>Error:</strong> Database type <em>(mysql)</em> not supported on your system.'); 
    719704            $configs['dbtype']->error = true; 
    720705        } elseif ($_POST['dbtype'] == 'postgres7' && !extension_loaded('pgsql')) { 
    721             $messages[] = t('<strong>Error:</strong> Database type <em>(postgresql)</em> not supported on your system.'); 
     706            $messages[] = __gettext('<strong>Error:</strong> Database type <em>(postgresql)</em> not supported on your system.'); 
    722707            $configs['dbtype']->error = true; 
    723708        } 
     
    725710 
    726711    if (!preg_match($hostregex, $_POST['dbhost'])) { 
    727         $messages[] = t('<strong>Error:</strong> Database host invalid.'); 
     712        $messages[] = __gettext('<strong>Error:</strong> Database host invalid.'); 
    728713        $configs['dbhost']->error = true; 
    729714    } 
    730715 
    731716    if (empty($_POST['dbuser'])) { 
    732         $messages[] = t('<strong>Error:</strong> Database username empty.'); 
     717        $messages[] = __gettext('<strong>Error:</strong> Database username empty.'); 
    733718        $configs['dbuser']->error = true; 
    734719    } 
    735720 
    736721    if (empty($_POST['dbpass'])) { 
    737         //$messages[] = t('<strong>Error:</strong> Database password empty.'); 
     722        //$messages[] = __gettext('<strong>Error:</strong> Database password empty.'); 
    738723        // prefix could be empty 
    739724    } 
    740725 
    741726    if (empty($_POST['dbname'])) { 
    742         $messages[] = t('<strong>Error:</strong> Database name empty.'); 
     727        $messages[] = __gettext('<strong>Error:</strong> Database name empty.'); 
    743728        $configs['dbname']->error = true; 
    744729    } 
     
    770755 
    771756        if (!$f) { 
    772             $messages[] = t('Could not write configuration file in your elgg directory.'); 
     757            $messages[] = __gettext('Could not write configuration file in your elgg directory.'); 
    773758        } else { 
    774759            // write file   
     
    778763 
    779764    } else { 
    780         $messages[] = t('Could not write configuration file in your elgg directory.'); 
     765        $messages[] = __gettext('Could not write configuration file in your elgg directory.'); 
    781766    } 
    782767