1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Removed some unused LANs. Cleaned up the deprecated LAN tool a little.

This commit is contained in:
Cameron 2021-02-11 12:29:16 -08:00
parent b0d10199b7
commit d985b830f4
5 changed files with 72 additions and 133 deletions

View File

@ -361,7 +361,7 @@ class banlist_ui extends e_admin_ui
</tbody>
</table>
<div class='buttons-bar center'>" . $frm->admin_button('ban_export', BANLAN_39, 'export', BANLAN_39) . "</div>
<div class='buttons-bar center'>" . $frm->admin_button('ban_export', LAN_UI_BATCH_EXPORT, 'export', BANLAN_39) . "</div>
<input type='hidden' name='e-token' value='" . e_TOKEN . "' />
</fieldset>
</form>
@ -402,7 +402,7 @@ class banlist_ui extends e_admin_ui
</tbody>
</table>
<div class='buttons-bar center'>
" . $frm->admin_button('ban_import', BANLAN_45, 'import') . $frm->token(). "
" . $frm->admin_button('ban_import', LAN_IMPORT , 'import') . $frm->token(). "
</div>
@ -453,8 +453,7 @@ class banlist_ui extends e_admin_ui
*****************************************/
$ipAdministrator->writeBanMessageFile();
banlist_adminlog('08','');
//$ns->tablerender(BANLAN_9, "<div style='text-align:center'>".BANLAN_33.'</div>');
// $mes->addSuccess(BANLAN_33);
}

View File

@ -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'))
{

View File

@ -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 .= "
<form id='lanDev' method='post' action='".e_REQUEST_URI."'>
<form id='lanDev' method='post' action='" . e_REQUEST_URI . "'>
<fieldset id='core-language-package'>
<table class='table adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tbody>";
";
$fl = e107::getFile();
@ -1057,89 +1052,90 @@ 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 .= " <tr>
<td><div class='alert-info alert alert-block'>".e107::getParser()->toHTML(LANG_LAN_140, true)."</div></td>
</tr>
<tr>
<td class='form-inline'>
<select name='deprecatedLans[]' multiple style='height:200px'>
<option value=''>".LANG_LAN_141."</option>";
$text .= " <div class='alert-info alert alert-block'>" . e107::getParser()->toHTML(LANG_LAN_140, true) . "</div>
<div class='row'>
<div class='col-md-4'>
<select name='deprecatedLans[]' class='form-control' multiple style='height:200px'>
<option value=''>" . LANG_LAN_141 . "</option>";
$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 .= "<optgroup label='".LAN_ADMIN."'>";
foreach($lans as $script=>$lan)
$text .= "<optgroup label='" . LAN_ADMIN . "'>";
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 .= "<option value='".$lan."' {$selected}>".str_replace('../e107_',"",$lan)."</option>\n";
$text .= "<option value='" . $lan . "' {$selected}>" . str_replace('../e107_', "", $lan) . "</option>\n";
}
$text .= "</optgroup>";
$text .= "<optgroup label='".LAN_ROOT."'>";
foreach($root as $script=>$lan)
$text .= "<optgroup label='" . LAN_ROOT . "'>";
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 .= "<option value='".$lan."' {$selected}>".str_replace($srch,"",$lan)."</option>\n";
$text .= "<option value='" . $lan . "' {$selected}>" . str_replace($srch, "", $lan) . "</option>\n";
}
$text .= "</optgroup>";
$text .= "<optgroup label='".LAN_TEMPLATES."'>";
foreach($templates as $script=>$lan)
$text .= "<optgroup label='" . LAN_TEMPLATES . "'>";
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 .= "<option value='".$lan."' {$selected}>".str_replace($srch,"",$lan)."</option>\n";
$text .= "<option value='" . $lan . "' {$selected}>" . str_replace($srch, "", $lan) . "</option>\n";
}
$text .= "</optgroup>";
$text .= "<optgroup label='".LAN_SHORTCODES."'>";
foreach($shortcodes as $script=>$lan)
$text .= "<optgroup label='" . LAN_SHORTCODES . "'>";
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 .= "<option value='".$lan."' {$selected}>".str_replace($srch,"",$lan)."</option>\n";
$text .= "<option value='" . $lan . "' {$selected}>" . str_replace($srch, "", $lan) . "</option>\n";
}
$text .= "</optgroup>";
@ -1148,24 +1144,23 @@ class lanDeveloper
$depOptions = array(
1 => "Script > Lan File",
0 => "Script < Lan File"
);
$text .= "
</select> ".
$frm->select('deprecatedLansReverse',$depOptions,e107::getParser()->filter($_POST['deprecatedLansReverse']),'class=select')." ";
$text .= "</select></div><div class='col-md-4 text-center'>";
$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 .= "<p>" . $frm->admin_button('searchDeprecated', LAN_RUN, 'other') . "</p>";
$search = array(e_PLUGIN, e_ADMIN, e_LANGUAGEDIR . "English/", e_THEME);
$replace = array("Plugins ", "Admin ", "Core ", "Themes ");
$prev = 'Core';
$text .= "<select name='deprecatedLanFile[]' multiple style='height:200px'>
$text .= "</div><div class='col-md-4'><select name='deprecatedLanFile[]' class='form-control' multiple style='height:200px'>
";
$selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" :"";
$text .= "<option value='auto' {$selected}>".LANG_LAN_142."</option><optgroup label='".LANG_LAN_143."'>\n";//Auto-Detect
$selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" : "";
$text .= "<option value='auto' {$selected}>" . LANG_LAN_142 . "</option><optgroup label='" . LANG_LAN_143 . "'>\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 .= "</optgroup><optgroup label='".$type."'>\n";
$text .= "</optgroup><optgroup label='" . $type . "'>\n";
}
$text .= "<option value='".$val."' ".$selected.">".$label."</option>\n";
$text .= "<option value='" . $val . "' " . $selected . ">" . $label . "</option>\n";
$prev = $type;
}
@ -1192,27 +1187,17 @@ class lanDeveloper
$text .= "</optgroup>";
$text .= "</select>";
// $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 .= "<span class='field-help'>".(count($lans) + count($plugs))." files found</span>";
$text .= "
</td>
</tr>";
$text .= "
</tbody>
</table>
$text .= "</div>
</div>
</fieldset>
</form>
";
return $mes->render().$text;
";
return $mes->render() . $text . "<hr />";
}
function getCommon()
{
$commonPhrases = file_get_contents(e_LANGUAGEDIR."English/English.php");

View File

@ -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");

View File

@ -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");