diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-10-08 23:46:09 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-10-08 23:46:09 +0000 |
commit | 98b07a4a7fa1baff52800f70066f311768904430 (patch) | |
tree | 4bc89e8017f5fced16a6de6d4c8b37639caccff8 /include/functions.inc.php | |
parent | 5132cc1f87025bd17d6bd90e5ac8ad73288bf482 (diff) |
- some code refactoring before upgrade to utf (only cosmetic at this point...)
git-svn-id: http://piwigo.org/svn/trunk@2126 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions.inc.php | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index 50bb81757..4e6b97b02 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -729,9 +729,9 @@ function redirect_html( $url , $msg = '', $refresh_time = 0) if (!isset($lang_info)) { $user = build_user( $conf['guest_id'], true); - include_once(get_language_filepath('common.lang.php')); + load_language('common.lang'); trigger_action('loading_lang'); - @include_once(get_language_filepath('local.lang.php')); + load_language('local.lang'); list($tmpl, $thm) = explode('/', get_default_template()); $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); } @@ -1424,4 +1424,43 @@ function get_filter_page_value($value_name) } } -?> +/** + * returns the character set of data sent to browsers / received from forms + */ +function get_pwg_charset() +{ + //TEMP CODE + global $lang_info;return $lang_info['charset']; +} + +/** + * includes a language file or returns the content of a language file + * availability of the file + * + * in descending order of preference: + * param language, user language, default language + * PhpWebGallery default language. + * + * @param string filename + * @param string dirname + * @param string language + * @param bool return_content - if true the file content is returned otherwise + * the file is evaluated as php + * @return boolean success status or a string if return_content is true + */ +function load_language($filename, $dirname = '', $language = '', + $return_content=false) +{ + //TEMP CODE + if (!$return_content) $filename.='.php'; + $f = get_language_filepath($filename, $dirname, $language); + if ($f === false) + return false; + if ($return_content) + return @file_get_contents($f); + global $lang, $lang_info; + @include($f); + return true; +} + +?>
\ No newline at end of file |