From 056ad7fcc3033c1359fd30255ccdd760b4d27907 Mon Sep 17 00:00:00 2001 From: Tijn Kuyper Date: Mon, 4 Feb 2013 17:59:39 +0100 Subject: [PATCH] message consistency (#90) and LAN optimization (#6) --- e107_admin/admin_log.php | 8 ++- e107_admin/emoticon.php | 51 +++++++++++-------- e107_languages/English/admin/lan_admin.php | 5 +- .../English/admin/lan_admin_log.php | 2 +- e107_languages/English/admin/lan_emoticon.php | 22 ++++---- 5 files changed, 50 insertions(+), 38 deletions(-) diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 064a5dd4e3..8583cbcc39 100644 --- a/e107_admin/admin_log.php +++ b/e107_admin/admin_log.php @@ -50,6 +50,8 @@ // Load language files for log messages 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 { foreach($pref['lan_log_list'] as $path => $file) @@ -96,15 +98,17 @@ if($admin_log->logArrayDiffs($temp, $pref, 'ADLOG_01') || $admin_log->logArrayDiffs($temp, $pref, 'ADLOG_04')) { save_prefs(); // Only save if changes - $emessage->add(RL_LAN_006, E_MESSAGE_SUCCESS); + //$emessage->add(RL_LAN_006, E_MESSAGE_SUCCESS); } else { - $emessage->add(LAN_NO_CHANGE); + $mes->addInfo(LAN_NO_CHANGE); } } +$ns->tablerender($caption, $mes->render() . $text); + if(e_QUERY) { // Must explode after calling auth.php $qs = explode(".", e_QUERY); diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index c60747faea..f4356dc817 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -28,7 +28,9 @@ require_once("auth.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 !='' ")) { // Set up the default emotes @@ -47,19 +49,23 @@ $admin_log->log_event($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, ''); save_prefs(); $update = true; - $emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); + //$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); + //$mes->addSucces(LAN_UPDATED); } else { - $emessage->add(LAN_NO_CHANGE); + //$emessage->add(LAN_NO_CHANGE); + $mes->addInfo(LAN_NO_CHANGE); } } +$ns->tablerender($caption, $mes->render() . $text); /* get packs */ require_once(e_HANDLER."file_class.php"); -$fl = new e_file; +//$fl = new e_file; +$fl = e107::getFile(); $emote = new emotec; $one_pack = FALSE; @@ -86,11 +92,13 @@ $pref['emotepack'] = str_replace("defPack_", "", $key); if(save_prefs()) { - $emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); + //$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS); + $mes->addSucces(LAN_UPDATED); } 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, ''); break; @@ -103,6 +111,7 @@ } } +$ns->tablerender($caption, $mes->render() . $text); $check = TRUE; @@ -135,13 +144,13 @@ function emotec() // List available emote packs function listPacks() { - global $pref; + //global $pref; + $pref = e107::getPref(); $frm = e107::getForm(); $fl = e107::getFile(); $ns = e107::getRender(); $mes = e107::getMessage(); - - + $text = "
@@ -164,7 +173,7 @@ function listPacks()
- + ".$frm->checkbox('smiley_activate', 1, varset($pref['smiley_activate'],0))."
@@ -190,10 +199,10 @@ function listPacks() - ".EMOLAN_2." + ".LAN_NAME." ".EMOLAN_3." - ".EMOLAN_8." - ".EMOLAN_9." + ".LAN_STATUS." + ".LAN_OPTIONS." @@ -228,7 +237,7 @@ function listPacks() $text .= " - ".($pref['emotepack'] == $pack ? EMOLAN_10 : "")." + ".($pref['emotepack'] == $pack ? LAN_ACTIVE : "")." "; @@ -286,7 +295,7 @@ function emoteConf($packID) $text = "
- ".EMOLAN_15." + ".LAN_EDIT."
".sprintf(EMOLAN_31, count($eArray))."
@@ -297,7 +306,7 @@ function emoteConf($packID) - + @@ -345,7 +354,7 @@ function emoteConf($packID) "; - $e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_15.": '".$packID."'", $text); + $e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.LAN_EDIT.": '".$packID."'", $text); } @@ -414,11 +423,11 @@ function saveConf() 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 { - 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 @@ function installCheck($do_one = FALSE) if(strpos($value,' ')!==FALSE) { // Highlight any directory names containing spaces - not allowed $msg = " - ".EMOLAN_17." ".EMOLAN_18." -
".EMOLAN_19.": {$value}
+ ".EMOLAN_17." ".EMOLAN_18.": +
".LAN_NAME.": {$value}
".EMOLAN_20.": ".e_IMAGE_ABS."emotes/
"; $emessage->add($msg, E_MESSAGE_ERROR); diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 0a4176db96..7be3c5a5d7 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -268,6 +268,7 @@ define("LAN_DATESTAMP","Date stamp"); define("LAN_OPTIONAL", "optional"); define("LAN_INACTIVE","Inactive"); +define("LAN_ACTIVE","Active"); define("LAN_BAN","Ban"); define("LAN_RATING", "Rating"); @@ -315,6 +316,7 @@ define("LAN_URL", "URL"); define("LAN_USER", "User"); define("LAN_OWNER", "Owner"); +define("LAN_NAME", "Name"); define("LAN_ID", "ID"); define("LAN_TITLE", "Title"); define("LAN_DESCRIPTION", "Description"); @@ -331,9 +333,6 @@ define("LAN_TYPE", "Type"); - - - define("LAN_SECURITYL_0", "Looking for trouble (none)"); define("LAN_SECURITYL_5", "Balanced"); define("LAN_SECURITYL_7", "High"); diff --git a/e107_languages/English/admin/lan_admin_log.php b/e107_languages/English/admin/lan_admin_log.php index 59c5dd2d94..9b905c726d 100644 --- a/e107_languages/English/admin/lan_admin_log.php +++ b/e107_languages/English/admin/lan_admin_log.php @@ -7,7 +7,7 @@ // define('RL_LAN_003', 'User Audit Trail Maintenance'); //define('RL_LAN_004', "Admin/Rolling Log Upgraded"); 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_008', "Rolling Log is active:"); define('RL_LAN_009', "Rolling Log History length in days"); diff --git a/e107_languages/English/admin/lan_emoticon.php b/e107_languages/English/admin/lan_emoticon.php index 78919dd0f4..9544314f05 100644 --- a/e107_languages/English/admin/lan_emoticon.php +++ b/e107_languages/English/admin/lan_emoticon.php @@ -8,7 +8,7 @@ */ define("EMOLAN_1", "Emote activation"); -define("EMOLAN_2", "Name"); +//define("EMOLAN_2", "Name"); define("EMOLAN_3", "Emotes"); define("EMOLAN_4", "Activate emoticons?"); @@ -16,20 +16,20 @@ define("EMOLAN_6", "Emote Code"); define("EMOLAN_7", "separate multiple entries with spaces"); -define("EMOLAN_8", "Status"); -define("EMOLAN_9", "Options"); -define("EMOLAN_10", "Active"); +//define("EMOLAN_8", "Status"); +//define("EMOLAN_9", "Options"); +//define("EMOLAN_10", "Active"); 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_14", "Save configuration"); -define("EMOLAN_15", "Edit / configure emotes"); -define("EMOLAN_16", "Emote configuration saved"); +//define("EMOLAN_14", "Save configuration"); +//define("EMOLAN_15", "Edit / configure emotes"); +//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_18", "Please rename the instances listed below so they no longer contain spaces:"); -define("EMOLAN_19", "Name"); +define("EMOLAN_18", "Please rename the instances listed below so they no longer contain spaces"); +//define("EMOLAN_19", "Name"); define("EMOLAN_20", "Location"); define("EMOLAN_21", "Read Pack Error"); @@ -43,7 +43,7 @@ define("EMOLAN_29", "XML file generated: "); define("EMOLAN_30", "Error writing XML file: "); -//0.8 +// 2.x define("EMOLAN_PAGE_TITLE", " Emoticons"); define("EMOLAN_31", "Total %u files found");
".EMOLAN_5."".EMOLAN_2."".LAN_NAME." ".EMOLAN_6." ( ".EMOLAN_7." )