mirror of
https://github.com/e107inc/e107.git
synced 2025-04-19 20:21:51 +02:00
More language-file cleanup
This commit is contained in:
parent
762f98aab5
commit
13c9e91e8d
@ -1659,23 +1659,27 @@ class pluginLanguage
|
||||
$this->scanScriptFile($path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->renderResults();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function renderSimilar($data)
|
||||
function findSimilar($data)
|
||||
{
|
||||
$sim = array();
|
||||
|
||||
foreach($this->lanDefsData as $k=>$v)
|
||||
{
|
||||
if(empty($v['value']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
similar_text($v['value'], $data['value'], $percentSimilar);
|
||||
|
||||
|
||||
if(($v['value'] == $data['value'] || $percentSimilar > 80) && $data['file'] != $v['file'])
|
||||
if((($v['value'] == $data['value'] || $percentSimilar > 80) && $data['file'] != $v['file']))
|
||||
{
|
||||
if(strpos($v['lan'],'LAN')===false) // Defined constants that don't contain 'LAN'.
|
||||
{
|
||||
@ -1691,7 +1695,20 @@ class pluginLanguage
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($sim))
|
||||
|
||||
|
||||
return $sim;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function renderSimilar($data,$mode='')
|
||||
{
|
||||
|
||||
$sim = $this->findSimilar($data);
|
||||
|
||||
|
||||
if(empty($sim) || ($mode == 'script' && count($sim) < 2))
|
||||
{
|
||||
return; // ADMIN_TRUE_ICON;
|
||||
}
|
||||
@ -1702,9 +1719,9 @@ class pluginLanguage
|
||||
foreach($sim as $k=>$val)
|
||||
{
|
||||
$text .= "<tr>
|
||||
<td>".$this->shortPath($val['file'])."</td>
|
||||
<td style='width:40%'>".$val['lan']."<br />".$val['value']."</td>
|
||||
<td style='width:10%'>".$this->renderStatus($val['status'])."</td>
|
||||
<td style='width:30%'>".$this->shortPath($val['file'])."</td>
|
||||
<td style='width:45%'>".$val['lan']."<br /><small>".$val['value']."</small></td>
|
||||
<td style='width:25%'>".$this->renderStatus($val['status'])."</td>
|
||||
</tr>";
|
||||
|
||||
}
|
||||
@ -1771,8 +1788,20 @@ class pluginLanguage
|
||||
{
|
||||
return str_replace(e_PLUGIN.$this->plugin.'/','',$path);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return str_replace(e_PLUGIN.$this->plugin.'/languages','',$path);
|
||||
$text = str_replace(e_PLUGIN.$this->plugin.'/languages/','',$path);
|
||||
|
||||
if(strpos($path,'_front.php')===false && strpos($path,'_admin.php')===false && strpos($path,'_global.php')===false)
|
||||
{
|
||||
return "<span class='text-error e-tip' title='File name should be either English_front.php, English_admin.php or English_global.php'>".$text."</span>";
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1827,21 +1856,28 @@ class pluginLanguage
|
||||
<th>id</th>
|
||||
<th>File</th>
|
||||
<th>Detected LAN</th>
|
||||
<th>LAN Value</th>
|
||||
<th>Found on Line</th>
|
||||
<th style='width:10%'>Status</th>
|
||||
<th>Duplicates / Possible Substitions</th>
|
||||
</tr>
|
||||
";
|
||||
|
||||
foreach($this->scriptDefsData as $k=>$v)
|
||||
{
|
||||
$status = in_array($v['lan'],$this->lanDefs) ? 1 : 0;
|
||||
// $lan = $v['lan'];
|
||||
// $v['value'] = $this->lanDefsRaw[$lan];
|
||||
// $sim = $this->findSimilar($v);
|
||||
|
||||
$text2 .= "<tr>
|
||||
<td style='width:5%'>".$k."</td>
|
||||
<td>".$this->shortPath($v['file'],'script')."</td>
|
||||
<td >".$v['lan']."</td>
|
||||
<td ><small>".$this->lanDefsRaw[$v['lan']]."</small></td>
|
||||
<td>".$v['line']."</td>
|
||||
<td>".$this->renderStatus($status,'script')."</td>
|
||||
<td>".$this->renderSimilar($v,'script')."</td>
|
||||
</tr>";
|
||||
|
||||
}
|
||||
@ -1889,10 +1925,11 @@ class pluginLanguage
|
||||
|
||||
// echo $text2;
|
||||
$tabs = array (
|
||||
0 => array('caption'=>'Used', 'text'=>$used),
|
||||
1 => array('caption'=>'Unused', 'text'=>$unused),
|
||||
2 => array('caption'=>'Unsure', 'text'=>$unsure),
|
||||
3 => array('caption'=>'Script Files', 'text'=> $this->renderScriptTable()),
|
||||
0 => array('caption'=>'Plugin Files', 'text'=> $this->renderScriptTable()),
|
||||
1 => array('caption'=>'Used', 'text'=>$used),
|
||||
2 => array('caption'=>'Unused', 'text'=>$unused),
|
||||
3 => array('caption'=>'Unsure', 'text'=>$unsure),
|
||||
|
||||
|
||||
);
|
||||
|
||||
@ -1937,7 +1974,7 @@ class pluginLanguage
|
||||
if($lan != 'e_LANGUAGE' && $lan != 'e_LANGUAGEDIR' && $lan != 'LAN' ) // remove 'TODO LAN'
|
||||
{
|
||||
$this->scriptDefs[] = $lan;
|
||||
$this->scriptDefsData[] = array('file'=>$path, 'line'=>$ln, 'lan'=>$lan);
|
||||
$this->scriptDefsData[] = array('file'=>$path, 'line'=>$ln, 'lan'=>$lan, 'value'=>$this->lanDefsRaw[$lan]);
|
||||
// $this->scriptData[$path][$ln] = $row;
|
||||
}
|
||||
}
|
||||
@ -1977,6 +2014,7 @@ class pluginLanguage
|
||||
$retloc[$type][$d]= $values[$k];
|
||||
$this->lanDefs[] = $d;
|
||||
$this->lanDefsData[] = array('file'=>$path, 'lan'=>$d, 'value'=>$values[$k]);
|
||||
$this->lanDefsRaw[$d] = $values[$k];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,9 @@ define("LAN_BACK", "Back");
|
||||
define("LAN_NAME", "Name");
|
||||
define("LAN_CANCEL","Cancel");
|
||||
define("LAN_DATE","Date");
|
||||
define("LAN_DATE_POSTED", "Date posted");
|
||||
define("LAN_JSCONFIRM","Are you sure?");
|
||||
define("LAN_IP", "IP Address");
|
||||
|
||||
|
||||
?>
|
@ -29,7 +29,7 @@ define("ADLAN_13", "System documentation");
|
||||
//define("ADLAN_19", "Add new/edit/delete reviews");
|
||||
//define("ADLAN_22", "Link Categories");
|
||||
//define("ADLAN_23", "Add new/edit/delete link categories");
|
||||
define("ADLAN_24", "Downloads");
|
||||
// define("ADLAN_24", "Downloads");
|
||||
define("ADLAN_25", "Manage Downloads");
|
||||
//define("ADLAN_26", "Download Categories");
|
||||
//define("ADLAN_27", "Add new/edit/delete download categories");
|
||||
@ -117,7 +117,7 @@ define("ADLAN_111", "Unverified members");
|
||||
define("ADLAN_112", "Banned users");
|
||||
// define("ADLAN_113", "Forum posts"); // should already be loaded from forum global language file.
|
||||
define("ADLAN_114", "Comments");
|
||||
define("ADLAN_115", "Chatbox posts");
|
||||
// define("ADLAN_115", "Chatbox posts");
|
||||
define("ADLAN_116", "Admin log ...");
|
||||
define("ADLAN_117", "Show all entries");
|
||||
define("ADLAN_118", "Clear log");
|
||||
@ -322,7 +322,7 @@ define("LAN_OWNER", "Owner");
|
||||
|
||||
define("LAN_EMAIL","Email address");
|
||||
define("LAN_ID", "ID");
|
||||
define("LAN_IP", "IP Address");
|
||||
|
||||
define("LAN_TITLE", "Title");
|
||||
define("LAN_DESCRIPTION", "Description");
|
||||
define("LAN_VISIBILITY", "Visibility");
|
||||
|
@ -40,8 +40,9 @@ $frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
|
||||
e107::lan('banner',false,'front');
|
||||
|
||||
e107::lan('banner',e_LANGUAGE.'_admin_banner.php',true); // e_PLUGIN.'banner/languages/'.e_LANGUAGE.'_admin_banner.php'
|
||||
e107::lan('banner','admin_banner',true); // e_PLUGIN.'banner/languages/'.e_LANGUAGE.'_admin_banner.php'
|
||||
|
||||
|
||||
if(e_QUERY)
|
||||
@ -221,11 +222,11 @@ if (!$action)
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='center'>".LAN_ID."</th>
|
||||
<th>".BNRLAN_1."</th>
|
||||
<th class='center'>".BNRLAN_2."</th>
|
||||
<th class='center'>".BNRLAN_3."</th>
|
||||
<th class='center'>".BNRLAN_4."</th>
|
||||
<th class='center'>".BNRLAN_5."</th>
|
||||
<th>".BANNERLAN_22."</th>
|
||||
<th class='center'>".BANNERLAN_24."</th>
|
||||
<th class='center'>".BANNERLAN_25."</th>
|
||||
<th class='center'>".BANNERLAN_26."</th>
|
||||
<th class='center'>".BANNERLAN_26."</th>
|
||||
<th class='center'>".LAN_OPTIONS."</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -235,8 +236,8 @@ if (!$action)
|
||||
{
|
||||
|
||||
$clickpercentage = ($banner_row['banner_clicks'] && $banner_row['banner_impressions'] ? round(($banner_row['banner_clicks'] / $banner_row['banner_impressions']) * 100)."%" : "-");
|
||||
$impressions_left = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] - $banner_row['banner_impressions'] : BNRLAN_6);
|
||||
$impressions_purchased = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] : BNRLAN_6);
|
||||
$impressions_left = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] - $banner_row['banner_impressions'] : BANNERLAN_30);
|
||||
$impressions_purchased = ($banner_row['banner_impurchased'] ? $banner_row['banner_impurchased'] : BANNERLAN_30);
|
||||
|
||||
$start_date = ($banner_row['banner_startdate'] ? strftime("%d %B %Y", $banner_row['banner_startdate']) : LAN_NONE);
|
||||
$end_date = ($banner_row['banner_enddate'] ? strftime("%d %B %Y", $banner_row['banner_enddate']) : LAN_NONE);
|
||||
@ -368,7 +369,7 @@ if ($action == "create")
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".BNRLAN_1."</td>
|
||||
<td>".BANNERLAN_22."</td>
|
||||
<td>
|
||||
";
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
define("BNRLAN_00", "No banners created yet."); // 15
|
||||
define("BNRLAN_01", "Banner ID not found.");
|
||||
|
||||
define("BNRLAN_1", "Client"); //27
|
||||
// define("BNRLAN_1", "Client"); //27
|
||||
define("BNRLAN_2", "Clickthroughs");
|
||||
define("BNRLAN_3", "Click %");
|
||||
define("BNRLAN_4", "Impressions");
|
||||
|
@ -41,18 +41,6 @@ if (isset($_POST['updatesettings']))
|
||||
e107::getConfig('core')->setPref($temp)->save(false);
|
||||
e107::getCache()->clear("nq_chatbox");
|
||||
|
||||
/*
|
||||
if ($admin_log->logArrayXXXXXDiffs($temp, $pref, 'CHBLAN_01'))
|
||||
{
|
||||
save_prefs(); // Only save if changes
|
||||
$e107cache->clear("nq_chatbox");
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->addInfo(LAN_NO_CHANGE);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +52,7 @@ if (isset($_POST['prune']))
|
||||
$sql->db_Delete("chatbox", "cb_datestamp < '{$prunetime}' ");
|
||||
e107::getLog()->add('CHBLAN_02', $chatbox_prune.', '.$prunetime, E_LOG_INFORMATIVE, '');
|
||||
$e107cache->clear("nq_chatbox");
|
||||
$mes->addSuccess(CHBLAN_28);
|
||||
$mes->addSuccess(LAN_AL_CHBLAN_02);
|
||||
}
|
||||
|
||||
if (isset($_POST['recalculate']))
|
||||
|
@ -25,7 +25,7 @@ $row = $sql->fetch();
|
||||
if (!check_class($row['menu_class']))
|
||||
{
|
||||
$mes->addError(CHATBOX_L24);
|
||||
$ns->tablerender(CHATBOX_L23, $mes->render());
|
||||
$ns->tablerender(LAN_ERROR, $mes->render());
|
||||
require_once(FOOTERF);
|
||||
exit;
|
||||
}
|
||||
@ -120,7 +120,7 @@ foreach ($chatList as $row)
|
||||
}
|
||||
if(CB_MOD)
|
||||
{
|
||||
$cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />".CHATBOX_L10;
|
||||
$cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />".LAN_DELETE;
|
||||
if($row['cb_blocked'])
|
||||
{
|
||||
$cb_message .= " <input type='checkbox' name='unblock[{$row['cb_id']}]' value='1' />".CHATBOX_L7;
|
||||
@ -164,8 +164,6 @@ $text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</d
|
||||
$ns->tablerender(CHATBOX_L20, $mes->render().$text);
|
||||
|
||||
|
||||
//require_once(e_HANDLER."np_class.php");
|
||||
//$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
|
||||
|
||||
require_once(FOOTERF);
|
||||
?>
|
||||
|
@ -346,7 +346,7 @@ if(!$text = $e107cache->retrieve("nq_chatbox"))
|
||||
|
||||
|
||||
|
||||
$caption = (file_exists(THEME."images/chatbox_menu.png") ? "<img src='".THEME_ABS."images/chatbox_menu.png' alt='' /> ".CHATBOX_L2 : CHATBOX_L2);
|
||||
$caption = (file_exists(THEME."images/chatbox_menu.png") ? "<img src='".THEME_ABS."images/chatbox_menu.png' alt='' /> ".LAN_PLUGIN_CHATBOX_MENU_NAME : CHATBOX_L2);
|
||||
|
||||
if($pref['cb_layer'] == 1)
|
||||
{
|
||||
|
@ -35,10 +35,10 @@ class chatbox_menu_dashboard // include plugin-folder in the name.
|
||||
$chatbox_posts = $sql->count('chatbox');
|
||||
|
||||
$var[0]['icon'] = "<img src='".e_PLUGIN_ABS."chatbox_menu/images/chatbox_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
|
||||
$var[0]['title'] = ADLAN_115;
|
||||
$var[0]['title'] = LAN_PLUGIN_CHATBOX_MENU_POSTS;
|
||||
$var[0]['url'] = e_PLUGIN."chatbox_menu/admin_chatbox.php";
|
||||
$var[0]['total'] = $chatbox_posts;
|
||||
echo "BLA";
|
||||
|
||||
return $var;
|
||||
}
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ if (!defined('e107_INIT')) { exit; }
|
||||
if(defined('ADMIN_PAGE') && ADMIN_PAGE === true)
|
||||
{
|
||||
// $config_category = NT_LAN_CB_1;
|
||||
// $config_events = array('cboxpost' => NT_LAN_CB_2);
|
||||
// $config_events = array('cboxpost' => NT_LXAN_CB_2);
|
||||
}
|
||||
|
||||
|
||||
if (!function_exists('notify_cboxpost')) {
|
||||
function notify_cboxpost($data) {
|
||||
global $nt;
|
||||
$message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LAN_CB_4.': '.e107::getIPHandler()->ipDecode($data['ip']).' )<br />';
|
||||
$message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LXAN_CB_4.': '.e107::getIPHandler()->ipDecode($data['ip']).' )<br />';
|
||||
$message .= NT_LAN_CB_5.':<br />'.$data['cmessage'].'<br /><br />';
|
||||
$nt -> send('cboxpost', NT_LAN_CB_6, $message);
|
||||
}
|
||||
@ -48,7 +48,7 @@ class chatbox_menu_notify extends notify // plugin-folder + '_notify'
|
||||
function cboxpost($data)
|
||||
{
|
||||
|
||||
$message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LAN_CB_4.': '.e107::getIPHandler()->ipDecode($data['ip']).' )<br />';
|
||||
$message = NT_LAN_CB_3.': '.USERNAME.' ('.LAN_IP.': '.e107::getIPHandler()->ipDecode($data['ip']).' )<br />';
|
||||
$message .= NT_LAN_CB_5.':<br />'.$data['cmessage'].'<br /><br />';
|
||||
|
||||
$this->send('cboxpost', NT_LAN_CB_6, $message);
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
define("CHATBOX_L1", "Unable to accept post as that username is registered - if it is your username please login to post.");
|
||||
define("CHATBOX_L2", "Chatbox");
|
||||
// define("CHATBOX_L2", "Chatbox");
|
||||
define("CHATBOX_L3", "You must be logged in to post comments on this site - please either log in or if you are not registered click <a href='".e_SIGNUP."'>here</a> to signup");
|
||||
define("CHATBOX_L4", "Post new message");
|
||||
define("CHATBOX_L5", "Reset");
|
||||
@ -23,21 +23,21 @@ define("CHATBOX_L6", "[blocked by admin]");
|
||||
define("CHATBOX_L7", "Unblock");
|
||||
define("CHATBOX_L8", "Info");
|
||||
define("CHATBOX_L9", "Block");
|
||||
define("CHATBOX_L10", "Delete");
|
||||
// define("CHATBOX_L10", "Delete");
|
||||
define("CHATBOX_L11", "No messages yet.");
|
||||
define("CHATBOX_L12", "View all posts");
|
||||
define("CHATBOX_L13", "moderate chatbox");
|
||||
define("CHATBOX_L14", "Emotes");
|
||||
define("CHATBOX_L15", "Post too long, or empty post submitted");
|
||||
define("CHATBOX_L16", "Anonymous");
|
||||
// define("CHATBOX_L16", "Anonymous");
|
||||
define("CHATBOX_L17", "Duplicate post");
|
||||
define("CHATBOX_L18", "Chatbox messages moderated");
|
||||
define("CHATBOX_L19", "You may only post once every ".(FLOODPROTECT ? FLOODTIMEOUT : 'n/a')." seconds");
|
||||
|
||||
define("CHATBOX_L20", "Chatbox (all posts)");
|
||||
define("CHATBOX_L21", "Chat Posts");
|
||||
// define("CHATBOX_L21", "Chat Posts");
|
||||
define("CHATBOX_L22", "on");
|
||||
define("CHATBOX_L23", "Error!");
|
||||
// define("CHATBOX_L23", "Error!");
|
||||
define("CHATBOX_L24", "You do not have the correct permissions to view this page.");
|
||||
define("CHATBOX_L25", "[ this post has been blocked by admin ]");
|
||||
|
||||
|
@ -17,7 +17,7 @@ define("LAN_AL_CHBLAN_05","");
|
||||
define("NT_LAN_CB_1", "Chatbox Events");
|
||||
define("NT_LAN_CB_2", "Message posted");
|
||||
define("NT_LAN_CB_3", "Posted by");
|
||||
define("NT_LAN_CB_4", "IP Address");
|
||||
// define("NT_LAN_CB_4", "IP Address");
|
||||
define("NT_LAN_CB_5", "Message");
|
||||
define("NT_LAN_CB_6", "Chatbox Message Posted");
|
||||
|
||||
|
@ -36,7 +36,7 @@ define("CHBLAN_24", "One day");
|
||||
define("CHBLAN_25", "One week");
|
||||
define("CHBLAN_26", "One month");
|
||||
define("CHBLAN_27", "- Delete all posts -");
|
||||
define("CHBLAN_28", "Chatbox pruned.");
|
||||
// define("CHBLAN_28", "Chatbox pruned.");
|
||||
|
||||
define("CHBLAN_29", "Display chatbox inside scrolling layer with height [x]"); // [x] will be replaced automatically
|
||||
define("CHBLAN_30", "Layer height");
|
||||
|
Loading…
x
Reference in New Issue
Block a user