Skip to content

Commit

Permalink
message consistency (#90) and LAN optimization (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moc committed Feb 4, 2013
1 parent 177a5e8 commit 056ad7f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 38 deletions.
8 changes: 6 additions & 2 deletions e107_admin/admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
51 changes: 30 additions & 21 deletions e107_admin/emoticon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -103,6 +111,7 @@
}
}

$ns->tablerender($caption, $mes->render() . $text);


$check = TRUE;
Expand Down Expand Up @@ -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 = "
<div class='admintabs' id='tab-container'>
Expand All @@ -164,7 +173,7 @@ function listPacks()
</td>
<td>
<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>
</td>
</tr>
Expand All @@ -190,10 +199,10 @@ function listPacks()
</colgroup>
<thead>
<tr>
<th class='center'>".EMOLAN_2."</th>
<th class='center'>".LAN_NAME."</th>
<th class='center'>".EMOLAN_3."</th>
<th class='center'>".EMOLAN_8."</th>
<th class='center'>".EMOLAN_9."</th>
<th class='center'>".LAN_STATUS."</th>
<th class='center'>".LAN_OPTIONS."</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -228,7 +237,7 @@ function listPacks()

$text .= "
</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>";


Expand Down Expand Up @@ -286,7 +295,7 @@ function emoteConf($packID)
$text = "
<form method='post' action='".e_SELF."#etabTabContainer=emoticon-packages'>
<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>
<table class='table adminlist'>
<colgroup>
Expand All @@ -297,7 +306,7 @@ function emoteConf($packID)
<thead>
<tr>
<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>
</tr>
</thead>
Expand Down Expand Up @@ -345,7 +354,7 @@ function emoteConf($packID)
</fieldset>
</form>";

$e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_15.": '".$packID."'", $text);
$e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.LAN_EDIT.": '".$packID."'", $text);
}


Expand Down Expand Up @@ -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);
}
}

Expand All @@ -444,8 +453,8 @@ function installCheck($do_one = FALSE)
if(strpos($value,' ')!==FALSE)
{ // Highlight any directory names containing spaces - not allowed
$msg = "
<strong>".EMOLAN_17."</strong> ".EMOLAN_18."
<div>".EMOLAN_19.": {$value}</div>
<strong>".EMOLAN_17."</strong> ".EMOLAN_18.":
<div>".LAN_NAME.": {$value}</div>
<div>".EMOLAN_20.": ".e_IMAGE_ABS."emotes/</div>
";
$emessage->add($msg, E_MESSAGE_ERROR);
Expand Down
5 changes: 2 additions & 3 deletions e107_languages/English/admin/lan_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion e107_languages/English/admin/lan_admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
22 changes: 11 additions & 11 deletions e107_languages/English/admin/lan_emoticon.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
*/

define("EMOLAN_1", "Emote activation");
define("EMOLAN_2", "Name");
//define("EMOLAN_2", "Name");
define("EMOLAN_3", "Emotes");
define("EMOLAN_4", "Activate emoticons?");

define("EMOLAN_5", "Image");
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");

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

0 comments on commit 056ad7f

Please sign in to comment.