From 4601ff1c36bd076cc2867c33e470c62c9d728c8a Mon Sep 17 00:00:00 2001 From: vdigital Date: Mon, 19 Nov 2007 19:51:54 +0000 Subject: Minor code review git-svn-id: http://piwigo.org/svn/trunk@2162 68402e56-0260-453c-a942-63ccdbb3a9ee --- plugins/language_switch/language_switch.inc.php | 109 ++++++++++-------------- plugins/language_switch/main.inc.php | 4 +- 2 files changed, 49 insertions(+), 64 deletions(-) diff --git a/plugins/language_switch/language_switch.inc.php b/plugins/language_switch/language_switch.inc.php index 5ae57956f..2a5c37dbc 100644 --- a/plugins/language_switch/language_switch.inc.php +++ b/plugins/language_switch/language_switch.inc.php @@ -1,11 +1,4 @@ - $displayname ) -{ - $qlc_url = add_url_params( make_index_url(), array( 'lang' => $code ) ); - $qlc_alt = ucwords( $displayname ); - $qlc_title = $qlc_alt; - $qlc_img = PHPWG_PLUGINS_PATH.'language_switch/icons/' + global $user, $template; + $available_lang = get_languages(); + foreach ( $available_lang as $code => $displayname ) + { + $qlc_url = add_url_params( make_index_url(), array( 'lang' => $code ) ); + $qlc_alt = ucwords( $displayname ); + $qlc_title = $qlc_alt; + $qlc_img = PHPWG_PLUGINS_PATH.'language_switch/icons/' . $code . '.gif'; - // echo $code . ' '. $qlc_url .' //
'; - // echo $user['language'] . ' '. $qlc_img .' ///
'; if ( $code !== $user['language'] and file_exists($qlc_img) ) - { - $template -> concat_var( 'PLUGIN_INDEX_ACTIONS', - '
  • '
-      . $qlc_alt . '
  • '); + { + $template -> concat_var( 'PLUGIN_INDEX_ACTIONS', + '
  • '
+        . $qlc_alt . '
  • '); + } } } -} ?> \ No newline at end of file diff --git a/plugins/language_switch/main.inc.php b/plugins/language_switch/main.inc.php index 8be206563..82eb5dc2e 100644 --- a/plugins/language_switch/main.inc.php +++ b/plugins/language_switch/main.inc.php @@ -1,7 +1,7 @@ \ No newline at end of file -- cgit v1.2.3