Changeset 1446
- Timestamp:
- 12/12/07 08:04:53 (8 months ago)
- Files:
-
- releases/0.9/install.php (modified) (15 diffs)
- releases/0.9/lib/templates.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
releases/0.9/install.php
r1424 r1446 18 18 if (file_exists('./config.php') && config_check_db()) { 19 19 $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.'); 21 21 } 22 22 … … 33 33 <html xmlns="http://www.w3.org/1999/xhtml"> 34 34 <head> 35 <title>Elgg <? =$version ?> <?=t('installation') ?></title>35 <title>Elgg <?php echo $version ?> <?php echo __gettext('installation') ?></title> 36 36 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 37 37 <style type="text/css" media="all"> … … 372 372 373 373 <div id="header"> 374 <h1><? =t('Welcome to elgg installation') ?></h1>374 <h1><?php echo __gettext('Welcome to elgg installation') ?></h1> 375 375 </div><!-- #header --> 376 376 … … 386 386 config_copy_htaccess(); 387 387 ?> 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> 389 389 390 390 <?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> 392 392 <?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> 394 394 <?php } ?> 395 395 <div class="setup"> … … 397 397 if (!config_check_db()) { 398 398 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 />» ' . 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 />» ' . __gettext('<a href="install.php">Try again installation wizard</a>.'); 401 401 echo '</div>'; 402 402 } else { … … 442 442 443 443 <?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> 447 447 448 448 <?php … … 460 460 461 461 <div id="footer"> 462 <p>elgg <? =$version ?></p>462 <p>elgg <?php echo $version ?></p> 463 463 </div> 464 464 … … 467 467 </html> 468 468 <?php 469 470 /**471 * Alias for __gettext472 * @param string $s473 * The string to translate474 * @return string475 * Translated string476 */477 function t($s) {478 if (function_exists('__gettext')) {479 return __gettext($s);480 } else {481 return $s;482 }483 }484 469 485 470 /** … … 519 504 520 505 $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'); 534 519 $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'); 537 522 538 523 if (config_submitted()) { config_validate(); } … … 574 559 575 560 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>.'); 577 562 } 578 563 579 564 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>.'); 581 566 } 582 567 583 568 if (file_exists($CFG->dirroot . 'config.php')) { 584 569 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."); 586 571 } 587 572 } 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."); 589 574 } 590 575 591 576 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."); 593 578 } 594 579 … … 659 644 } 660 645 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>'; 662 647 $output .= '</form>'; 663 648 … … 692 677 693 678 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.'); 695 680 $configs['wwwroot']->error = true; 696 681 } 697 682 698 683 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.'); 700 685 $configs['admin']->error = true; 701 686 } 702 687 703 688 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.'); 705 690 $configs['adminpw']->error = true; 706 691 } 707 692 708 693 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.'); 710 695 $configs['adminemail']->error = true; 711 696 } 712 697 713 698 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.'); 715 700 $configs['dbtype']->error = true; 716 701 } elseif (function_exists('extension_loaded')) { 717 702 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.'); 719 704 $configs['dbtype']->error = true; 720 705 } 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.'); 722 707 $configs['dbtype']->error = true; 723 708 } … … 725 710 726 711 if (!preg_match($hostregex, $_POST['dbhost'])) { 727 $messages[] = t('<strong>Error:</strong> Database host invalid.');712 $messages[] = __gettext('<strong>Error:</strong> Database host invalid.'); 728 713 $configs['dbhost']->error = true; 729 714 } 730 715 731 716 if (empty($_POST['dbuser'])) { 732 $messages[] = t('<strong>Error:</strong> Database username empty.');717 $messages[] = __gettext('<strong>Error:</strong> Database username empty.'); 733 718 $configs['dbuser']->error = true; 734 719 } 735 720 736 721 if (empty($_POST['dbpass'])) { 737 //$messages[] = t('<strong>Error:</strong> Database password empty.');722 //$messages[] = __gettext('<strong>Error:</strong> Database password empty.'); 738 723 // prefix could be empty 739 724 } 740 725 741 726 if (empty($_POST['dbname'])) { 742 $messages[] = t('<strong>Error:</strong> Database name empty.');727 $messages[] = __gettext('<strong>Error:</strong> Database name empty.'); 743 728 $configs['dbname']->error = true; 744 729 } … … 770 755 771 756 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.'); 773 758 } else { 774 759 // write file … … 778 763 779 764 } 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.'); 781 766 } 782 767 releases/0.9/lib/templates.php
r1384 r1446 1193 1193 if (!$override && isset($template[$context])) { 1194 1194 // append to existing context 1195 $template[$context] .=$tpl;1195 $template[$context] = $template[$context] . $tpl; 1196 1196 } else { 1197 1197 $template[$context] = $tpl;
