1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

message consistency (#90) and LAN optimization (#6)

This commit is contained in:
Tijn Kuyper
2013-02-04 17:59:39 +01:00
parent 177a5e8314
commit 056ad7fcc3
5 changed files with 50 additions and 38 deletions

View File

@@ -50,6 +50,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
// Load language files for log messages // Load language files for log messages
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_log_messages.php'); //... for core functions include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_log_messages.php'); //... for core functions
$mes = e107::getMessage();
if(is_array($pref['lan_log_list'])) //... and for any plugins which support it if(is_array($pref['lan_log_list'])) //... and for any plugins which support it
{ {
foreach($pref['lan_log_list'] as $path => $file) foreach($pref['lan_log_list'] as $path => $file)
@@ -96,15 +98,17 @@ if(isset($_POST['setoptions']))
if($admin_log->logArrayDiffs($temp, $pref, 'ADLOG_01') || $admin_log->logArrayDiffs($temp, $pref, 'ADLOG_04')) if($admin_log->logArrayDiffs($temp, $pref, 'ADLOG_01') || $admin_log->logArrayDiffs($temp, $pref, 'ADLOG_04'))
{ {
save_prefs(); // Only save if changes save_prefs(); // Only save if changes
$emessage->add(RL_LAN_006, E_MESSAGE_SUCCESS); //$emessage->add(RL_LAN_006, E_MESSAGE_SUCCESS);
} }
else else
{ {
$emessage->add(LAN_NO_CHANGE); $mes->addInfo(LAN_NO_CHANGE);
} }
} }
$ns->tablerender($caption, $mes->render() . $text);
if(e_QUERY) if(e_QUERY)
{ // Must explode after calling auth.php { // Must explode after calling auth.php
$qs = explode(".", e_QUERY); $qs = explode(".", e_QUERY);

View File

@@ -28,7 +28,9 @@ $e_sub_cat = 'emoticon';
require_once("auth.php"); require_once("auth.php");
require_once(e_HANDLER."message_handler.php"); require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance();
//$emessage = &eMessage::getInstance();
$mes = e107::getMessage();
if(!$sql->db_Count("core", "(*)", "WHERE e107_name = 'emote_default' AND e107_value !='' ")) if(!$sql->db_Count("core", "(*)", "WHERE e107_name = 'emote_default' AND e107_value !='' "))
{ // Set up the default emotes { // Set up the default emotes
@@ -47,19 +49,23 @@ if (isset($_POST['active']))
$admin_log->log_event($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, ''); $admin_log->log_event($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, '');
save_prefs(); save_prefs();
$update = true; $update = true;
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); //$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
//$mes->addSucces(LAN_UPDATED);
} }
else else
{ {
$emessage->add(LAN_NO_CHANGE); //$emessage->add(LAN_NO_CHANGE);
$mes->addInfo(LAN_NO_CHANGE);
} }
} }
$ns->tablerender($caption, $mes->render() . $text);
/* get packs */ /* get packs */
require_once(e_HANDLER."file_class.php"); require_once(e_HANDLER."file_class.php");
$fl = new e_file; //$fl = new e_file;
$fl = e107::getFile();
$emote = new emotec; $emote = new emotec;
$one_pack = FALSE; $one_pack = FALSE;
@@ -86,11 +92,13 @@ foreach($_POST as $key => $value)
$pref['emotepack'] = str_replace("defPack_", "", $key); $pref['emotepack'] = str_replace("defPack_", "", $key);
if(save_prefs()) if(save_prefs())
{ {
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); //$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
$mes->addSucces(LAN_UPDATED);
} }
else else
{ {
$emessage->add(LAN_NO_CHANGE, E_MESSAGE_INFO); //$emessage->add(LAN_NO_CHANGE, E_MESSAGE_INFO);
$mes->addInfo(LAN_NO_CHANGE);
} }
$admin_log->log_event('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, ''); $admin_log->log_event('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, '');
break; break;
@@ -103,6 +111,7 @@ foreach($_POST as $key => $value)
} }
} }
$ns->tablerender($caption, $mes->render() . $text);
$check = TRUE; $check = TRUE;
@@ -135,13 +144,13 @@ class emotec
// List available emote packs // List available emote packs
function listPacks() function listPacks()
{ {
global $pref; //global $pref;
$pref = e107::getPref();
$frm = e107::getForm(); $frm = e107::getForm();
$fl = e107::getFile(); $fl = e107::getFile();
$ns = e107::getRender(); $ns = e107::getRender();
$mes = e107::getMessage(); $mes = e107::getMessage();
$text = " $text = "
<div class='admintabs' id='tab-container'> <div class='admintabs' id='tab-container'>
@@ -164,7 +173,7 @@ class emotec
</td> </td>
<td> <td>
<div class='auto-toggle-area autocheck'> <div class='auto-toggle-area autocheck'>
<input type='checkbox' class='checkbox' name='smiley_activate' value='1'".($pref['smiley_activate'] ? " checked='checked'" : '')." /> ".$frm->checkbox('smiley_activate', 1, varset($pref['smiley_activate'],0))."
</div> </div>
</td> </td>
</tr> </tr>
@@ -190,10 +199,10 @@ class emotec
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th class='center'>".EMOLAN_2."</th> <th class='center'>".LAN_NAME."</th>
<th class='center'>".EMOLAN_3."</th> <th class='center'>".EMOLAN_3."</th>
<th class='center'>".EMOLAN_8."</th> <th class='center'>".LAN_STATUS."</th>
<th class='center'>".EMOLAN_9."</th> <th class='center'>".LAN_OPTIONS."</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -228,7 +237,7 @@ class emotec
$text .= " $text .= "
</td> </td>
<td class='center middle'>".($pref['emotepack'] == $pack ? EMOLAN_10 : "<button type='submit' name='defPack_".$pack."' value='".EMOLAN_11."'><span>".EMOLAN_11."</span></button>")."</td> <td class='center middle'>".($pref['emotepack'] == $pack ? LAN_ACTIVE : "<button type='submit' name='defPack_".$pack."' value='".EMOLAN_11."'><span>".EMOLAN_11."</span></button>")."</td>
<td>"; <td>";
@@ -286,7 +295,7 @@ class emotec
$text = " $text = "
<form method='post' action='".e_SELF."#etabTabContainer=emoticon-packages'> <form method='post' action='".e_SELF."#etabTabContainer=emoticon-packages'>
<fieldset id='core-emoticon-configure'> <fieldset id='core-emoticon-configure'>
<legend class='e-hideme'>".EMOLAN_15."</legend> <legend class='e-hideme'>".LAN_EDIT."</legend>
<div class='info-bar'><strong>".sprintf(EMOLAN_31, count($eArray))."</strong></div> <div class='info-bar'><strong>".sprintf(EMOLAN_31, count($eArray))."</strong></div>
<table class='table adminlist'> <table class='table adminlist'>
<colgroup> <colgroup>
@@ -297,7 +306,7 @@ class emotec
<thead> <thead>
<tr> <tr>
<th>".EMOLAN_5."</th> <th>".EMOLAN_5."</th>
<th>".EMOLAN_2."</th> <th>".LAN_NAME."</th>
<th class='last'>".EMOLAN_6."<span class='field-help'> ( ".EMOLAN_7." )</span></th> <th class='last'>".EMOLAN_6."<span class='field-help'> ( ".EMOLAN_7." )</span></th>
</tr> </tr>
</thead> </thead>
@@ -345,7 +354,7 @@ class emotec
</fieldset> </fieldset>
</form>"; </form>";
$e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_15.": '".$packID."'", $text); $e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.LAN_EDIT.": '".$packID."'", $text);
} }
@@ -414,11 +423,11 @@ class emotec
if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'"))
{ {
e107::getMessage()->addAuto($sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', EMOLAN_16, false, false); e107::getMessage()->addAuto($sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', LAN_SETSAVED, false, false);
} }
else else
{ {
e107::getMessage()->addAuto($sql->insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16, false, false); e107::getMessage()->addAuto($sql->insert("core", "'emote_".$packID."', '$tmp' "), 'insert', LAN_SETSAVED, false, false);
} }
} }
@@ -444,8 +453,8 @@ class emotec
if(strpos($value,' ')!==FALSE) if(strpos($value,' ')!==FALSE)
{ // Highlight any directory names containing spaces - not allowed { // Highlight any directory names containing spaces - not allowed
$msg = " $msg = "
<strong>".EMOLAN_17."</strong> ".EMOLAN_18." <strong>".EMOLAN_17."</strong> ".EMOLAN_18.":
<div>".EMOLAN_19.": {$value}</div> <div>".LAN_NAME.": {$value}</div>
<div>".EMOLAN_20.": ".e_IMAGE_ABS."emotes/</div> <div>".EMOLAN_20.": ".e_IMAGE_ABS."emotes/</div>
"; ";
$emessage->add($msg, E_MESSAGE_ERROR); $emessage->add($msg, E_MESSAGE_ERROR);

View File

@@ -268,6 +268,7 @@ define("LAN_GOPAGE", "Go to page:");
define("LAN_DATESTAMP","Date stamp"); define("LAN_DATESTAMP","Date stamp");
define("LAN_OPTIONAL", "optional"); define("LAN_OPTIONAL", "optional");
define("LAN_INACTIVE","Inactive"); define("LAN_INACTIVE","Inactive");
define("LAN_ACTIVE","Active");
define("LAN_BAN","Ban"); define("LAN_BAN","Ban");
define("LAN_RATING", "Rating"); define("LAN_RATING", "Rating");
@@ -315,6 +316,7 @@ define("LAN_STATUS", "Status");
define("LAN_URL", "URL"); define("LAN_URL", "URL");
define("LAN_USER", "User"); define("LAN_USER", "User");
define("LAN_OWNER", "Owner"); define("LAN_OWNER", "Owner");
define("LAN_NAME", "Name");
define("LAN_ID", "ID"); define("LAN_ID", "ID");
define("LAN_TITLE", "Title"); define("LAN_TITLE", "Title");
define("LAN_DESCRIPTION", "Description"); define("LAN_DESCRIPTION", "Description");
@@ -331,9 +333,6 @@ define("LAN_TEMPLATE","Template");
define("LAN_TYPE", "Type"); define("LAN_TYPE", "Type");
define("LAN_SECURITYL_0", "Looking for trouble (none)"); define("LAN_SECURITYL_0", "Looking for trouble (none)");
define("LAN_SECURITYL_5", "Balanced"); define("LAN_SECURITYL_5", "Balanced");
define("LAN_SECURITYL_7", "High"); define("LAN_SECURITYL_7", "High");

View File

@@ -7,7 +7,7 @@ define('RL_LAN_002', "Rolling Log");
// define('RL_LAN_003', 'User Audit Trail Maintenance'); // define('RL_LAN_003', 'User Audit Trail Maintenance');
//define('RL_LAN_004', "Admin/Rolling Log Upgraded"); //define('RL_LAN_004', "Admin/Rolling Log Upgraded");
define('RL_LAN_005', "Configure/View system logs"); define('RL_LAN_005', "Configure/View system logs");
define('RL_LAN_006', "Options Updated"); //define('RL_LAN_006', "Options Updated");
// define('RL_LAN_007', "User Audit Trail Options"); // define('RL_LAN_007', "User Audit Trail Options");
define('RL_LAN_008', "Rolling Log is active:"); define('RL_LAN_008', "Rolling Log is active:");
define('RL_LAN_009', "Rolling Log History length in days"); define('RL_LAN_009', "Rolling Log History length in days");

View File

@@ -8,7 +8,7 @@
*/ */
define("EMOLAN_1", "Emote activation"); define("EMOLAN_1", "Emote activation");
define("EMOLAN_2", "Name"); //define("EMOLAN_2", "Name");
define("EMOLAN_3", "Emotes"); define("EMOLAN_3", "Emotes");
define("EMOLAN_4", "Activate emoticons?"); define("EMOLAN_4", "Activate emoticons?");
@@ -16,20 +16,20 @@ define("EMOLAN_5", "Image");
define("EMOLAN_6", "Emote Code"); define("EMOLAN_6", "Emote Code");
define("EMOLAN_7", "separate multiple entries with spaces"); define("EMOLAN_7", "separate multiple entries with spaces");
define("EMOLAN_8", "Status"); //define("EMOLAN_8", "Status");
define("EMOLAN_9", "Options"); //define("EMOLAN_9", "Options");
define("EMOLAN_10", "Active"); //define("EMOLAN_10", "Active");
define("EMOLAN_11", "Activate pack"); define("EMOLAN_11", "Activate pack");
define("EMOLAN_12", "Edit / configure this pack"); //define("EMOLAN_12", "Edit / configure this pack");
define("EMOLAN_13", "Installed packs"); define("EMOLAN_13", "Installed packs");
define("EMOLAN_14", "Save configuration"); //define("EMOLAN_14", "Save configuration");
define("EMOLAN_15", "Edit / configure emotes"); //define("EMOLAN_15", "Edit / configure emotes");
define("EMOLAN_16", "Emote configuration saved"); //define("EMOLAN_16", "Emote configuration saved");
define("EMOLAN_17", "You have an emoticon pack present that contains spaces in the name, which are not allowed!"); define("EMOLAN_17", "You have an emoticon pack present that contains spaces in the name, which are not allowed!");
define("EMOLAN_18", "Please rename the instances listed below so they no longer contain spaces:"); define("EMOLAN_18", "Please rename the instances listed below so they no longer contain spaces");
define("EMOLAN_19", "Name"); //define("EMOLAN_19", "Name");
define("EMOLAN_20", "Location"); define("EMOLAN_20", "Location");
define("EMOLAN_21", "Read Pack Error"); define("EMOLAN_21", "Read Pack Error");
@@ -43,7 +43,7 @@ define("EMOLAN_28", "Generate XML");
define("EMOLAN_29", "XML file generated: "); define("EMOLAN_29", "XML file generated: ");
define("EMOLAN_30", "Error writing XML file: "); define("EMOLAN_30", "Error writing XML file: ");
//0.8 // 2.x
define("EMOLAN_PAGE_TITLE", " Emoticons"); define("EMOLAN_PAGE_TITLE", " Emoticons");
define("EMOLAN_31", "Total %u files found"); define("EMOLAN_31", "Total %u files found");