Changeset 879
- Timestamp:
- Sep 27, 2005, 11:57:14 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/help.php
r862 r879 28 28 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 29 29 30 // language files 31 $user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language']; 32 $conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language']; 33 34 if (file_exists($user_langdir.'/help.html')) 35 { 36 $html_file = $user_langdir.'/help.html'; 37 } 38 else 39 { 40 $html_file = $conf_langdir.'/help.html'; 41 } 42 43 $template->set_filenames(array('help_content' => $html_file)); 30 $template->set_filenames( 31 array( 32 'help_content' => get_language_filepath('help.html') 33 ) 34 ); 35 44 36 $template->assign_var_from_handle('ADMIN_CONTENT', 'help_content'); 45 37 ?> -
trunk/doc/ChangeLog
r878 r879 1 2005-09-27 Pierrick LE GALL 2 3 * bug 168 fixed: crash when language file does not 4 exists. Constant PHPWG_DEFAULT_LANGUAGE added. New function 5 get_language_filepath always used to find language files. 6 1 7 2005-09-26 Pierrick LE GALL 2 8 -
trunk/include/common.inc.php
r862 r879 167 167 168 168 // language files 169 $user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language']; 170 $conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language']; 169 include_once(get_language_filepath('common.lang.php')); 171 170 172 if (file_exists($user_langdir.'/common.lang.php'))173 {174 include_once($user_langdir.'/common.lang.php');175 }176 else177 {178 include_once($conf_langdir.'/common.lang.php');179 }180 181 // The administration section requires 2 more language files182 171 if (defined('IN_ADMIN') and IN_ADMIN) 183 172 { 184 foreach (array('admin') as $section) 185 { 186 if (file_exists($user_langdir.'/'.$section.'.lang.php')) 187 { 188 include_once($user_langdir.'/'.$section.'.lang.php'); 189 } 190 else 191 { 192 include_once($conf_langdir.'/'.$section.'.lang.php'); 193 } 194 } 173 include_once(get_language_filepath('admin.lang.php')); 195 174 } 196 175 -
trunk/include/constants.php
r833 r879 30 30 define('PHPWG_URL', 'http://www.phpwebgallery.net'); 31 31 define('PHPWG_FORUM_URL', 'http://forum.phpwebgallery.net'); 32 define('PHPWG_DEFAULT_LANGUAGE', 'en_UK.iso-8859-1'); 32 33 33 34 // Error codes -
trunk/include/functions_user.inc.php
r865 r879 498 498 return $groupname; 499 499 } 500 501 /** 502 * return the file path of the given language filename, depending on the 503 * availability of the file 504 * 505 * in descending order of preference: user language, default language, 506 * PhpWebGallery default language. 507 * 508 * @param string filename 509 * @return string filepath 510 */ 511 function get_language_filepath($filename) 512 { 513 global $user, $conf; 514 515 $directories = 516 array( 517 PHPWG_ROOT_PATH.'language/'.$user['language'], 518 PHPWG_ROOT_PATH.'language/'.$conf['default_language'], 519 PHPWG_ROOT_PATH.'language/'.PHPWG_DEFAULT_LANGUAGE 520 ); 521 522 foreach ($directories as $directory) 523 { 524 $filepath = $directory.'/'.$filename; 525 526 if (file_exists($filepath)) 527 { 528 return $filepath; 529 } 530 } 531 532 return false; 533 } 500 534 ?> -
trunk/popuphelp.php
r858 r879 33 33 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 34 34 35 // language files36 $user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];37 $conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];38 39 if (file_exists($user_langdir.'/help/'.$_GET['page'].'.html'))40 {41 $html_file = $user_langdir.'/help/'.$_GET['page'].'.html';42 }43 else44 {45 $html_file = $conf_langdir.'/help/'.$_GET['page'].'.html';46 }47 48 35 $page['body_id'] = 'thePopuphelpPage'; 49 36 $page['gallery_title'] = $title = l10n('PhpWebGallery Help'); 50 37 include(PHPWG_ROOT_PATH.'include/page_header.php'); 51 $template->set_filenames(array('help_content' => $html_file)); 38 39 $template->set_filenames( 40 array( 41 'help_content' => get_language_filepath('help/'.$_GET['page'].'.html') 42 ) 43 ); 52 44 53 45 $template->set_filenames(array('popuphelp' => 'popuphelp.tpl'));
Note: See TracChangeset
for help on using the changeset viewer.