diff options
author | vdigital <vdigital@piwigo.org> | 2007-11-20 21:37:05 +0000 |
---|---|---|
committer | vdigital <vdigital@piwigo.org> | 2007-11-20 21:37:05 +0000 |
commit | 6b9d509b089f6f070f19eccf44ae76d9ce36e96a (patch) | |
tree | 0bc18f03b7c3fcd12c17b43f117e23d9ad2b2164 /plugins/language_switch | |
parent | 65dbaa60c26a1a64b0d7ababb58f2a22342bf42a (diff) |
Czech language flag
Corrective: remove unneeded load_language() calls.
git-svn-id: http://piwigo.org/svn/trunk@2164 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/language_switch')
-rw-r--r-- | plugins/language_switch/icons/cz_CZ.gif | bin | 0 -> 903 bytes | |||
-rw-r--r-- | plugins/language_switch/language_switch.inc.php | 14 |
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/language_switch/icons/cz_CZ.gif b/plugins/language_switch/icons/cz_CZ.gif Binary files differnew file mode 100644 index 000000000..89686c417 --- /dev/null +++ b/plugins/language_switch/icons/cz_CZ.gif diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php index 2a5c37dbc..11a4c4ddd 100644 --- a/plugins/language_switch/language_switch.inc.php +++ b/plugins/language_switch/language_switch.inc.php @@ -27,6 +27,7 @@ function language_switch() { global $user, $template, $conf, $lang; if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } + $same = $user['language']; if ( isset( $_GET['lang']) ) { if ( !empty($_GET['lang'] ) and @@ -56,12 +57,15 @@ function language_switch() { $user['language'] = $_COOKIE['pwg_lang_switch']; } - - load_language('common.lang', '', $user['language']); - load_language('local.lang', '', $user['language']); - if (defined('IN_ADMIN') and IN_ADMIN) +// Reload language only if it isn't the same one + if ( $same !== $user['language']) { - load_language('admin.lang', '', $user['language']); + load_language('common.lang', '', $user['language']); + load_language('local.lang', '', $user['language']); + if (defined('IN_ADMIN') and IN_ADMIN) + { + load_language('admin.lang', '', $user['language']); + } } } //if ( isset( $_GET['lang']) ) { redirect( make_index_url() ); } |