From 96cdd31536a28aaa3b10d98a6b13d0aa8022110a Mon Sep 17 00:00:00 2001 From: marj Date: Mon, 3 Aug 2009 21:54:28 +0000 Subject: [PATCH] Language selection simplification work in progress --- e107_files/shortcode/custom.php | 40 ++++++++++---------- e107_plugins/user_menu/userlanguage_menu.php | 6 +-- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/e107_files/shortcode/custom.php b/e107_files/shortcode/custom.php index dd13ae79b..487d9d51e 100644 --- a/e107_files/shortcode/custom.php +++ b/e107_files/shortcode/custom.php @@ -61,29 +61,27 @@ function custom_shortcode($parm) break; case 'language': - require_once(e_HANDLER.'file_class.php'); - $fl = new e_file; - $reject = array('.','..','/','CVS','thumbs.db','*._$'); - $lanlist = $fl->get_dirs(e_LANGUAGEDIR); - sort($lanlist); - $action = (e_QUERY && !$_GET['elan']) ? e_SELF.'?'.e_QUERY : e_SELF; - $lantext = "
-
'; - foreach($lanlist as $langval) - { - $langname = $langval; - $langval = ($langval == $pref['sitelanguage']) ? '' : $langval; - $selected = ($langval == USERLAN) ? "selected='selected'" : ''; - $lantext .= "\n "; - } + foreach($languageList as $languageFolder) + { + $selected = ($languageFolder == e_LANGUAGE) ? ' selected="selected"' : ''; + $text .= ' + '; + } - $lantext .= " - -
- "; - return $lantext; - break; + $text .= ' + + + '; + return $text; + break; case 'clock': $clock_flat = true; diff --git a/e107_plugins/user_menu/userlanguage_menu.php b/e107_plugins/user_menu/userlanguage_menu.php index 6a6c9d291..01dd1740d 100644 --- a/e107_plugins/user_menu/userlanguage_menu.php +++ b/e107_plugins/user_menu/userlanguage_menu.php @@ -9,8 +9,8 @@ * * * $Source: /cvs_backup/e107_0.8/e107_plugins/user_menu/userlanguage_menu.php,v $ - * $Revision: 1.3 $ - * $Date: 2009-08-03 19:41:17 $ + * $Revision: 1.4 $ + * $Date: 2009-08-03 21:54:28 $ * $Author: marj_nl_fr $ */ //TODO homogenisation with languagelinks + do not force www + unobtrusive redirect @@ -47,7 +47,7 @@ else $action = (e_QUERY && ! $_GET['elan']) ? e_SELF.'?'.e_QUERY : e_SELF; $text = '
-
+