Changeset 2126 for trunk/include
- Timestamp:
- Oct 9, 2007, 1:46:09 AM (17 years ago)
- Location:
- trunk/include
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r2117 r2126 156 156 157 157 // language files 158 include_once(get_language_filepath('common.lang.php'));158 load_language('common.lang'); 159 159 if (defined('IN_ADMIN') and IN_ADMIN) 160 160 { 161 include_once(get_language_filepath('admin.lang.php'));161 load_language('admin.lang'); 162 162 } 163 163 trigger_action('loading_lang'); 164 @include_once(get_language_filepath('local.lang.php'));164 load_language('local.lang'); 165 165 166 166 // only now we can set the localized username of the guest user (and not in -
trunk/include/functions.inc.php
r2123 r2126 730 730 { 731 731 $user = build_user( $conf['guest_id'], true); 732 include_once(get_language_filepath('common.lang.php'));732 load_language('common.lang'); 733 733 trigger_action('loading_lang'); 734 @include_once(get_language_filepath('local.lang.php'));734 load_language('local.lang'); 735 735 list($tmpl, $thm) = explode('/', get_default_template()); 736 736 $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); … … 1425 1425 } 1426 1426 1427 /** 1428 * returns the character set of data sent to browsers / received from forms 1429 */ 1430 function get_pwg_charset() 1431 { 1432 //TEMP CODE 1433 global $lang_info;return $lang_info['charset']; 1434 } 1435 1436 /** 1437 * includes a language file or returns the content of a language file 1438 * availability of the file 1439 * 1440 * in descending order of preference: 1441 * param language, user language, default language 1442 * PhpWebGallery default language. 1443 * 1444 * @param string filename 1445 * @param string dirname 1446 * @param string language 1447 * @param bool return_content - if true the file content is returned otherwise 1448 * the file is evaluated as php 1449 * @return boolean success status or a string if return_content is true 1450 */ 1451 function load_language($filename, $dirname = '', $language = '', 1452 $return_content=false) 1453 { 1454 //TEMP CODE 1455 if (!$return_content) $filename.='.php'; 1456 $f = get_language_filepath($filename, $dirname, $language); 1457 if ($f === false) 1458 return false; 1459 if ($return_content) 1460 return @file_get_contents($f); 1461 global $lang, $lang_info; 1462 @include($f); 1463 return true; 1464 } 1465 1427 1466 ?> -
trunk/include/functions_mail.inc.php
r2122 r2126 49 49 50 50 global $lang_info; 51 return '=?'. $lang_info['charset'].'?Q?'.$str.'?=';51 return '=?'.get_pwg_charset().'?Q?'.$str.'?='; 52 52 } 53 53 … … 227 227 228 228 // language files 229 include(get_language_filepath('common.lang.php', '', $language));229 load_language('common.lang', '', $language); 230 230 // No test admin because script is checked admin (user selected no) 231 231 // Translations are in admin file too 232 include(get_language_filepath('admin.lang.php', '', $language));232 load_language('admin.lang', '', $language); 233 233 trigger_action('loading_lang'); 234 @include(get_language_filepath('local.lang.php', '', $language));234 load_language('local.lang', '', $language); 235 235 236 236 $switch_lang[$language]['lang_info'] = $lang_info; … … 589 589 $content = ''; 590 590 591 if (!isset($conf_mail[$args['email_format']][ $lang_info['charset']][$args['template']][$args['theme']]))591 if (!isset($conf_mail[$args['email_format']][get_pwg_charset()][$args['template']][$args['theme']])) 592 592 { 593 593 if (!isset($mail_template)) … … 604 604 'BOUNDARY_KEY' => $conf_mail['boundary_key'], 605 605 'CONTENT_TYPE' => $args['email_format'], 606 'CONTENT_ENCODING' => $lang_info['charset'],606 'CONTENT_ENCODING' => get_pwg_charset(), 607 607 'LANG' => $lang_info['code'], 608 608 'DIR' => $lang_info['direction'], … … 651 651 // what are displayed on the header of each mail ? 652 652 $conf_mail[$args['email_format']] 653 [ $lang_info['charset']]653 [get_pwg_charset()] 654 654 [$args['template']][$args['theme']]['header'] = 655 655 $mail_template->parse('mail_header', true); … … 657 657 // what are displayed on the footer of each mail ? 658 658 $conf_mail[$args['email_format']] 659 [ $lang_info['charset']]659 [get_pwg_charset()] 660 660 [$args['template']][$args['theme']]['footer'] = 661 661 $mail_template->parse('mail_footer', true); … … 664 664 // Header 665 665 $content.= $conf_mail[$args['email_format']] 666 [ $lang_info['charset']]666 [get_pwg_charset()] 667 667 [$args['template']][$args['theme']]['header']; 668 668 … … 684 684 // Footer 685 685 $content.= $conf_mail[$args['email_format']] 686 [ $lang_info['charset']]686 [get_pwg_charset()] 687 687 [$args['template']][$args['theme']]['footer']; 688 688 -
trunk/include/page_header.php
r1900 r2126 47 47 $page['body_id'] : '', 48 48 49 'CONTENT_ENCODING' => $lang_info['charset'],49 'CONTENT_ENCODING' => get_pwg_charset(), 50 50 'PAGE_TITLE' => strip_tags($title), 51 51 'LANG'=>$lang_info['code'], … … 100 100 trigger_action('loc_end_page_header'); 101 101 102 header('Content-Type: text/html; charset='. $lang_info['charset']);102 header('Content-Type: text/html; charset='.get_pwg_charset()); 103 103 $template->parse('header'); 104 104 -
trunk/include/ws_functions.inc.php
r2119 r2126 911 911 $res[$k] = $user[$k]; 912 912 } 913 foreach ( array('charset') as $k ) 914 { 915 $res[$k] = $lang_info[$k]; 916 } 913 $res['charset'] = get_pwg_charset(); 917 914 return $res; 918 915 } -
trunk/include/ws_protocols/rest_encoder.php
r1900 r2126 169 169 $this->encode($response); 170 170 $ret = $this->_writer->getOutput(); 171 $ret = '<?xml version="1.0" encoding="'. $lang_info['charset'].'" ?>171 $ret = '<?xml version="1.0" encoding="'.get_pwg_charset().'" ?> 172 172 <rsp stat="ok"> 173 173 '.$ret.'
Note: See TracChangeset
for help on using the changeset viewer.