diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php index 30d84b362..aa559477a 100644 --- a/e107_admin/lancheck.php +++ b/e107_admin/lancheck.php @@ -318,7 +318,7 @@ class lancheck if(E107_DEBUG_LEVEL > 0) { - print_a($this->core_plugins); + // print_a($this->core_plugins); } $acceptedLans = explode(",",e_LANLIST); diff --git a/e107_admin/language.php b/e107_admin/language.php index 2de1f742a..892b93271 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -19,6 +19,12 @@ if (!getperms('L')) e107::coreLan('language', true); $e_sub_cat = 'language'; + + if(!empty($_GET['iframe'])) + { + define('e_IFRAME', true); + } + require_once ("auth.php"); @@ -52,6 +58,8 @@ elseif(!getperms('0')) } + + if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage']) && getperms('0')) { unset($temp); @@ -72,9 +80,10 @@ if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage']) && getper if (isset($_POST['del_existing']) && $_POST['lang_choices'] && getperms('0')) { $lang = strtolower($_POST['lang_choices']); + foreach ($tabs as $del_table) { - if ($sql->db_Table_exists($lang."_".$del_table,TRUE)) + if ($sql->db_Table_exists($del_table, $lang)) { // echo $del_table." exists
"; $qry = "DROP TABLE ".$mySQLprefix."lan_".$lang."_".$del_table; @@ -92,11 +101,11 @@ if (isset($_POST['del_existing']) && $_POST['lang_choices'] && getperms('0')) } } } + e107::getLog()->add('LANG_02', $message.'[!br!]', E_LOG_INFORMATIVE, ''); $sql->db_ResetTableList(); - if ($action == 'modify') - $action = 'db';//FIX - force db action when deleting all lan tables + } // ----------create tables ----------------------------------------------------- if (isset($_POST['create_tables']) && $_POST['language']) @@ -181,7 +190,7 @@ if (!e_QUERY || $action == 'main' && !$_POST['language'] && !$_POST['edit_existi { multilang_prefs(); } -if (varset($action) == 'db') +if (varset($_GET['mode']) == 'db' && empty($_GET['action'])) { multilang_db(); } @@ -431,15 +440,17 @@ new lanDeveloper; if (isset($_POST['create_edit_existing'])) $_POST['edit_existing'] = true; // Grab Language configuration. --- -if (isset($_POST['edit_existing'])) +if (varset($_GET['mode']) == 'db' && !empty($_GET['action']) && !empty($_GET['lang'])) { - //XXX - JS ok with the current functionality? + $frm = e107::getForm(); + $languageSelected = $tp->filter($_GET['lang'],'w'); + $text .= " -
+
- ".$_POST['lang_choices']." + ".$languageSelected." @@ -449,11 +460,11 @@ if (isset($_POST['edit_existing'])) "; foreach ($tabs as $table_name) { - $installed = 'lan_'.strtolower($_POST['lang_choices'])."_".$table_name; - if (stristr($_POST['lang_choices'], $installed) === FALSE) + $installed = 'lan_'.strtolower($languageSelected)."_".$table_name; + if (stristr($languageSelected, $installed) === FALSE) { - $selected = ($sql->db_Table_exists($table_name,$_POST['lang_choices'])) ? " checked='checked'" : ""; + $selected = ($sql->db_Table_exists($table_name,$languageSelected)) ? " checked='checked'" : ""; $tableName = ucfirst(str_replace("_", " ", $table_name)); $tableLabel = ($selected) ? "".$tableName."" : $tableName; @@ -486,7 +497,7 @@ if (isset($_POST['edit_existing'])) } // =========================================================================== // Drop tables ? isset() - if (varset($_POST['create_edit_existing'])) + if (varset($_GET['action'])=='create') { $baction = 'create'; $bcaption = LANG_LAN_06; @@ -514,14 +525,24 @@ if (isset($_POST['edit_existing']))
- + ".$frm->admin_button('create_tables','no-value',$baction,$bcaption)."
"; - $ns->tablerender(ADLAN_132.SEP.LANG_LAN_03.SEP.$_POST['lang_choices'], $mes->render().$text); + + $ns->tablerender(ADLAN_132.SEP.LANG_LAN_03.SEP.$languageSelected, $mes->render().$text); } + + + + + + + + + require_once (e_ADMIN."footer.php"); // --------------------------------------------------------------------------- @@ -766,20 +787,22 @@ function multilang_db() $text .= "\n"; $text .= " -
\n"; + \n"; $text .= "
"; - if (count($installed)) + if(count($installed)) { - - $text .= " - "; + $text .= "".LAN_EDIT.""; + // $text .= ""; + + $text .= ""; } elseif ($e_language != $pref['sitelanguage']) { // $text .= ""; - $text .= $frm->admin_button('create_edit_existing','no-value','create',LAN_CREATE); + // $text .= $frm->admin_button('create_edit_existing','no-value','create',LAN_CREATE); + $text .= "".LAN_CREATE.""; } $text .= "
@@ -1100,7 +1123,7 @@ function language_adminmenu() { $action = getperms('0') ? "main" : "tools"; } - if ($action == "modify") + if ($_GET['mode'] == 'db') { $action = "db"; } @@ -1113,7 +1136,7 @@ function language_adminmenu() if (isset($pref['multilanguage']) && $pref['multilanguage']) { $var['db']['text'] = LANG_LAN_03; - $var['db']['link'] = e_SELF."?db"; + $var['db']['link'] = e_SELF."?mode=db"; } } diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index ef8ae017a..ccd05a5c3 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -3599,7 +3599,7 @@ return; /** * Filters/Validates using the PHP5 filter_var() method. * @param $text - * @param $type string str|int|email|url + * @param $type string str|int|email|url|w|wds * @return string | boolean */ function filter($text, $type='str',$validate=false)