From d985b830f4cd94b8c4a3d1fa7a58db57d5b9e012 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 11 Feb 2021 12:29:16 -0800 Subject: [PATCH] Removed some unused LANs. Cleaned up the deprecated LAN tool a little. --- e107_admin/banlist.php | 7 +- e107_admin/cpage.php | 2 +- e107_admin/language.php | 121 ++++++++----------- e107_languages/English/admin/lan_banlist.php | 30 ++--- e107_languages/English/admin/lan_cpage.php | 45 ------- 5 files changed, 72 insertions(+), 133 deletions(-) diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index 7c19dfd87..08a4e1478 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -361,7 +361,7 @@ class banlist_ui extends e_admin_ui -
" . $frm->admin_button('ban_export', BANLAN_39, 'export', BANLAN_39) . "
+
" . $frm->admin_button('ban_export', LAN_UI_BATCH_EXPORT, 'export', BANLAN_39) . "
@@ -402,7 +402,7 @@ class banlist_ui extends e_admin_ui
- " . $frm->admin_button('ban_import', BANLAN_45, 'import') . $frm->token(). " + " . $frm->admin_button('ban_import', LAN_IMPORT , 'import') . $frm->token(). "
@@ -453,8 +453,7 @@ class banlist_ui extends e_admin_ui *****************************************/ $ipAdministrator->writeBanMessageFile(); banlist_adminlog('08',''); - //$ns->tablerender(BANLAN_9, "
".BANLAN_33.'
'); - // $mes->addSuccess(BANLAN_33); + } diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index bf4e24e2e..eae9935f8 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -214,7 +214,7 @@ class page_chapters_ui extends e_admin_ui if($this->getAction() === 'list') { - $this->fields['chapter_parent']['title'] = CUSLAN_56; + $this->fields['chapter_parent']['title'] = LAN_PARENT; } elseif(deftrue('e_DEBUG')) { diff --git a/e107_admin/language.php b/e107_admin/language.php index eaa89f168..ab0c16490 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -958,7 +958,7 @@ class lanDeveloper if($_POST['deprecatedLanFile'][0] !='auto') //override. { - $lanfile = $tp->filter($_POST['deprecatedLanFile'], 'file'); + $lanfile = $tp->filter($_POST['deprecatedLanFile']); } @@ -1030,23 +1030,18 @@ class lanDeveloper } - static function form() { + $frm = e107::getForm(); $mes = e107::getMessage(); $text = ""; $text .= " -
+
- - - - - - "; + "; $fl = e107::getFile(); @@ -1057,115 +1052,115 @@ class lanDeveloper if(!$_SESSION['languageTools_lanFileList']) { - $_SESSION['languageTools_lanFileList'] = $fl->get_files(e_LANGUAGEDIR."English",'.*?(English|lan_).*?\.php$','standard',3); + $_SESSION['languageTools_lanFileList'] = $fl->get_files(e_LANGUAGEDIR . "English", '.*?(English|lan_).*?\.php$', 'standard', 3); } // print_a($_SESSION['languageTools_lanFileList']); - $text .= " - - - - - "; - - - $text .= " - -
".e107::getParser()->toHTML(LANG_LAN_140, true)."
- + "; - $omit = array('languages','\.png','\.gif','handlers'); - $lans = $fl->get_files(e_ADMIN,'.php','standard',0); + $omit = array('languages', '\.png', '\.gif', 'handlers'); + $lans = $fl->get_files(e_ADMIN, '.php', 'standard', 0); asort($lans); $fl->setFileFilter(array("^e_")); - $root = $fl->get_files(e_BASE,'.*?/?.*?\.php',$omit,0); + $root = $fl->get_files(e_BASE, '.*?/?.*?\.php', $omit, 0); asort($root); - $templates = $fl->get_files(e_CORE."templates",'.*?/?.*?\.php',$omit,0); + $templates = $fl->get_files(e_CORE . "templates", '.*?/?.*?\.php', $omit, 0); asort($templates); - $shortcodes = $fl->get_files(e_CORE."shortcodes",'.*?/?.*?\.php',$omit,1); + $shortcodes = $fl->get_files(e_CORE . "shortcodes", '.*?/?.*?\.php', $omit, 1); asort($shortcodes); $exclude = array('lan_admin.php'); - $srch = array(e_ADMIN,e_PLUGIN, e_CORE, e_BASE ); + $srch = array(e_ADMIN, e_PLUGIN, e_CORE, e_BASE); - $text .= ""; - foreach($lans as $script=>$lan) + $text .= ""; + + foreach($lans as $script => $lan) { - if(in_array(basename($lan),$exclude)) + if(in_array(basename($lan), $exclude)) { continue; } + $selected = (!empty($_POST['deprecatedLans']) && in_array($lan, $_POST['deprecatedLans'])) ? "selected='selected'" : ""; - $text .= "\n"; + $text .= "\n"; } $text .= ""; - $text .= ""; - foreach($root as $script=>$lan) + $text .= ""; + + foreach($root as $script => $lan) { - if(in_array(basename($lan),$exclude)) + if(in_array(basename($lan), $exclude)) { continue; } $selected = (!empty($_POST['deprecatedLans']) && in_array($lan, $_POST['deprecatedLans'])) ? "selected='selected'" : ""; - $text .= "\n"; + $text .= "\n"; } $text .= ""; - $text .= ""; - foreach($templates as $script=>$lan) + $text .= ""; + foreach($templates as $script => $lan) { - if(in_array(basename($lan),$exclude)) + if(in_array(basename($lan), $exclude)) { continue; } $selected = (!empty($_POST['deprecatedLans']) && in_array($lan, $_POST['deprecatedLans'])) ? "selected='selected'" : ""; - $text .= "\n"; + $text .= "\n"; } $text .= ""; - $text .= ""; - foreach($shortcodes as $script=>$lan) + $text .= ""; + foreach($shortcodes as $script => $lan) { - if(in_array(basename($lan),$exclude)) + if(in_array(basename($lan), $exclude)) { continue; } $selected = (!empty($_POST['deprecatedLans']) && in_array($lan, $_POST['deprecatedLans'])) ? "selected='selected'" : ""; - $text .= "\n"; + $text .= "\n"; } $text .= ""; - + //TODO LANs - not sure if this can be replaced with LANS? $depOptions = array( 1 => "Script > Lan File", 0 => "Script < Lan File" - ); - $text .= " - ". - $frm->select('deprecatedLansReverse',$depOptions,e107::getParser()->filter($_POST['deprecatedLansReverse']),'class=select')." "; + $text .= "
"; - $search = array(e_PLUGIN,e_ADMIN,e_LANGUAGEDIR."English/",e_THEME); - $replace = array("Plugins ","Admin ","Core ","Themes "); + $text .= $frm->select('deprecatedLansReverse', $depOptions, e107::getParser()->filter($_POST['deprecatedLansReverse']), 'class=select form-control') . " "; + $text .= "

" . $frm->admin_button('searchDeprecated', LAN_RUN, 'other') . "

"; + $search = array(e_PLUGIN, e_ADMIN, e_LANGUAGEDIR . "English/", e_THEME); + $replace = array("Plugins ", "Admin ", "Core ", "Themes "); $prev = 'Core'; - $text .= " "; - $selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" :""; - $text .= "\n";//Auto-Detect + $selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" : ""; + $text .= "\n";//Auto-Detect asort($_SESSION['languageTools_lanFileList']); foreach($_SESSION['languageTools_lanFileList'] as $val) { @@ -1176,15 +1171,15 @@ class lanDeveloper $selected = (!empty($_POST['deprecatedLanFile']) && in_array($val, $_POST['deprecatedLanFile'])) ? "selected='selected'" : ""; - $diz = str_replace($search,$replace,$val); - list($type,$label) = explode(" ",$diz); + $diz = str_replace($search, $replace, $val); + list($type, $label) = explode(" ", $diz); if($type !== $prev) { - $text .= "\n"; + $text .= "\n"; } - $text .= "\n"; + $text .= "\n"; $prev = $type; } @@ -1192,27 +1187,17 @@ class lanDeveloper $text .= ""; $text .= ""; - // $frm->select('deprecatedLanFile',$_SESSION['languageTools_lanFileList'], $_POST['deprecatedLanFile'],'class=select&useValues=1','Select Language File (optional)'). - $text .= $frm->admin_button('searchDeprecated',LAN_GO,'other'); - // $text .= "".(count($lans) + count($plugs))." files found"; - $text .= " -
+ $text .= " +
- "; - - return $mes->render().$text; - + "; + return $mes->render() . $text . "
"; } + function getCommon() { $commonPhrases = file_get_contents(e_LANGUAGEDIR."English/English.php"); diff --git a/e107_languages/English/admin/lan_banlist.php b/e107_languages/English/admin/lan_banlist.php index 86032438c..6a7522673 100644 --- a/e107_languages/English/admin/lan_banlist.php +++ b/e107_languages/English/admin/lan_banlist.php @@ -7,31 +7,31 @@ */ // define("BANLAN_1", "Ban removed."); -define("BANLAN_2", "No bans in list."); -define("BANLAN_3", "Existing Bans"); +// define("BANLAN_2", "No bans in list."); +// define("BANLAN_3", "Existing Bans"); // define("BANLAN_4", "Remove ban"); define("BANLAN_5", "Enter IP, email address, or host"); define("BANLAN_7", "Reason"); -define("BANLAN_8", "Ban Address"); +// define("BANLAN_8", "Ban Address"); define("BANLAN_9", "Ban users from site by email, IP or host address"); define("BANLAN_10", "IP / Email / Reason"); define("BANLAN_11", "Auto-ban: More than 10 failed login attempts"); -define("BANLAN_12", "Note: Reverse DNS is currently disabled; it must be enabled to allow banning by host. Banning by IP and email address will still function normally."); -define("BANLAN_13", "Note: To ban a user by user name, go to the users admin page: "); -define("BANLAN_14", "Ban List"); +// define("BANLAN_12", "Note: Reverse DNS is currently disabled; it must be enabled to allow banning by host. Banning by IP and email address will still function normally."); +// define("BANLAN_13", "Note: To ban a user by user name, go to the users admin page: "); +// define("BANLAN_14", "Ban List"); define("BANLAN_15", "Messages/Ban Periods"); define("BANLAN_16", "Banning"); -define("BANLAN_17", "Ban Date"); -define("BANLAN_18", "Ban expires"); +// define("BANLAN_17", "Ban Date"); +// define("BANLAN_18", "Ban expires"); define("BANLAN_19", "Notes"); -define("BANLAN_20", "Type"); +// define("BANLAN_20", "Type"); //define("BANLAN_21", "Never"); -define("BANLAN_22", "Unknown"); +// define("BANLAN_22", "Unknown"); define("BANLAN_23", "day(s)"); define("BANLAN_24", "hours"); -define("BANLAN_25", "Add to Banlist"); -define("BANLAN_26", "Currently "); -define("BANLAN_27", "Invalid characters in IP address stripped - now:"); +// define("BANLAN_25", "Add to Banlist"); +// define("BANLAN_26", "Currently "); +// define("BANLAN_27", "Invalid characters in IP address stripped - now:"); define("BANLAN_28", "Ban type"); define("BANLAN_29", "Message to show to banned user"); define("BANLAN_30", "Ban duration"); @@ -43,13 +43,13 @@ define("BANLAN_35", "Import/Export"); define("BANLAN_36", "Export Types"); define("BANLAN_37", "Field Separator"); define("BANLAN_38", "Quote (round each value)"); -define("BANLAN_39", "Export"); +// define("BANLAN_39", "Export"); define("BANLAN_40", "Banlist Export"); define("BANLAN_41", "Banlist Import"); define("BANLAN_42", "Import Choices"); define("BANLAN_43", "Replace all existing imported bans"); define("BANLAN_44", "Use expiry date/time from import"); -define("BANLAN_45", "Import"); +// define("BANLAN_45", "Import"); define("BANLAN_46", "Import File:"); define("BANLAN_47", "File upload error"); define("BANLAN_48", "Deleted [y] expired ban list entries"); diff --git a/e107_languages/English/admin/lan_cpage.php b/e107_languages/English/admin/lan_cpage.php index 6db12e58a..91d3e68a3 100644 --- a/e107_languages/English/admin/lan_cpage.php +++ b/e107_languages/English/admin/lan_cpage.php @@ -53,50 +53,5 @@ define("CUSLAN_79", "You must enter either a page title or a menu name."); define("CUSLAN_80", "Sub Title"); -// define("CUSLAN_54", "Meta Keywords"); //LAN_KEYWORDS -// define("CUSLAN_1", "Title"); -// define("CUSLAN_2", "Type"); -// define("CUSLAN_3", "Search engine friendly string"); -// define("CUSLAN_4", "Delete this item?"); -// define("CUSLAN_5", "Existing Pages"); -// define("CUSLAN_7", "Menu Name"); -// define("CUSLAN_8", "Title / Caption"); -// define("CUSLAN_10", "Allow page to be rated"); -// define("CUSLAN_13", "Allow comments"); -// define("CUSLAN_14", "Password protect page"); -// define("CUSLAN_15", "enter password to protect page"); -// define("CUSLAN_16", "Create link in main menu"); -// define("CUSLAN_17", "enter link name to create"); -// define("CUSLAN_18", "Page / link visible to"); -// define("CUSLAN_19", "Update Page"); -// define("CUSLAN_20", "Create Page"); -// define("CUSLAN_21", "Update Menu"); -// define("CUSLAN_22", "Create Menu"); -// define("CUSLAN_23", "Edit page"); -// define("CUSLAN_24", "Create new page"); -// define("CUSLAN_25", "Edit menu"); -// define("CUSLAN_26", "Create new menu"); -// define("CUSLAN_27", "Page saved to database."); -// define("CUSLAN_28", "Page deleted"); - -// define("CUSLAN_32", "Meta keywords"); -// define("CUSLAN_33", "Page Options"); -// define("CUSLAN_34", "Title and SEF string are required fields. Page wasn"t saved."); -// define("CUSLAN_35", "SEF string should be unique for every page. Page wasn"t saved."); -// define("CUSLAN_36", "Menu name is required field and can"t be left empty. Menu wasn"t saved."); -// define("CUSLAN_37", "Custom Page Update"); -// define("CUSLAN_38", "on"); -// define("CUSLAN_39", "off"); -// define("CUSLAN_40", "Save Options"); - -// define("CUSLAN_41", "Display author and date information"); -// define("CUSLAN_42", "No pages defined yet"); -// define("CUSLAN_43", "untitled menu: "); -// define("CUSLAN_44", "untitled page"); -// define("CUSLAN_45", "Settings saved"); -// define("CUSLAN_46", "Nothing changed - not saved"); -// define("CUSLAN_47", "General Information"); - -