mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Code clean-up ($emessage to $mes)
This commit is contained in:
@@ -45,7 +45,6 @@ require_once(e_ADMIN.'auth.php');
|
|||||||
require_once(e_HANDLER.'admin_handler.php');
|
require_once(e_HANDLER.'admin_handler.php');
|
||||||
require_once(e_HANDLER.'upload_handler.php');
|
require_once(e_HANDLER.'upload_handler.php');
|
||||||
// require_once (e_HANDLER."message_handler.php");
|
// require_once (e_HANDLER."message_handler.php");
|
||||||
//$emessage = e107::getMessage();
|
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'classis'; // Shouldn't be needed - but just in case
|
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'classis'; // Shouldn't be needed - but just in case
|
||||||
|
@@ -34,10 +34,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
|||||||
$e_sub_cat = 'cache';
|
$e_sub_cat = 'cache';
|
||||||
|
|
||||||
require_once("auth.php");
|
require_once("auth.php");
|
||||||
|
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
$mes = e107::getMessage();
|
||||||
$emessage = eMessage::getInstance();
|
|
||||||
|
|
||||||
if (e107::getPref('cachestatus') == '2')
|
if (e107::getPref('cachestatus') == '2')
|
||||||
{
|
{
|
||||||
@@ -192,7 +190,7 @@ $text = "
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</form>";
|
</form>";
|
||||||
|
|
||||||
e107::getRender()->tablerender(CACLAN_3, $emessage->render().$text);
|
e107::getRender()->tablerender(CACLAN_3, $mes->render().$text);
|
||||||
|
|
||||||
require_once("footer.php");
|
require_once("footer.php");
|
||||||
|
|
||||||
|
@@ -2,16 +2,14 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Administration Area - Emotions Settings & Packs
|
* Administration Area - Emotions Settings & Packs
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/emoticon.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Id$
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -28,8 +26,6 @@ $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();
|
|
||||||
$mes = e107::getMessage();
|
$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 !='' "))
|
||||||
@@ -49,12 +45,9 @@ 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);
|
|
||||||
//$mes->addSuccess(LAN_UPDATED);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$emessage->add(LAN_NO_CHANGE);
|
|
||||||
$mes->addInfo(LAN_NO_CHANGE);
|
$mes->addInfo(LAN_NO_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +57,6 @@ $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 = e107::getFile();
|
$fl = e107::getFile();
|
||||||
$emote = new emotec;
|
$emote = new emotec;
|
||||||
$one_pack = FALSE;
|
$one_pack = FALSE;
|
||||||
@@ -92,12 +84,10 @@ 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);
|
|
||||||
$mes->addSuccess(LAN_UPDATED);
|
$mes->addSuccess(LAN_UPDATED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$emessage->add(LAN_NO_CHANGE, E_MESSAGE_INFO);
|
|
||||||
$mes->addInfo(LAN_NO_CHANGE);
|
$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, '');
|
||||||
@@ -131,7 +121,7 @@ class emotec
|
|||||||
function emotec()
|
function emotec()
|
||||||
{
|
{
|
||||||
/* constructor */
|
/* constructor */
|
||||||
global $fl;
|
$fl = e107::getFile();
|
||||||
$this -> packArray = $fl->get_dirs(e_IMAGE."emotes");
|
$this -> packArray = $fl->get_dirs(e_IMAGE."emotes");
|
||||||
|
|
||||||
if(isset($_POST['sub_conf']))
|
if(isset($_POST['sub_conf']))
|
||||||
@@ -144,7 +134,6 @@ class emotec
|
|||||||
// List available emote packs
|
// List available emote packs
|
||||||
function listPacks()
|
function listPacks()
|
||||||
{
|
{
|
||||||
//global $pref;
|
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$fl = e107::getFile();
|
$fl = e107::getFile();
|
||||||
@@ -282,8 +271,10 @@ class emotec
|
|||||||
// Configure an individual emote pack
|
// Configure an individual emote pack
|
||||||
function emoteConf($packID)
|
function emoteConf($packID)
|
||||||
{
|
{
|
||||||
global $e107, $fl, $sysprefs, $tp;
|
global $e107, $sysprefs;
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$fl = e107::getFile();
|
||||||
|
|
||||||
$corea = "emote_".$packID;
|
$corea = "emote_".$packID;
|
||||||
|
|
||||||
@@ -367,7 +358,10 @@ class emotec
|
|||||||
// Generate an XML file - packname.xml in root emoticon directory
|
// Generate an XML file - packname.xml in root emoticon directory
|
||||||
function emoteXML($packID, $strip_xtn = TRUE)
|
function emoteXML($packID, $strip_xtn = TRUE)
|
||||||
{
|
{
|
||||||
global $emessage, $fl, $sysprefs, $tp;
|
global $sysprefs;
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
$fl = e107::getFile();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$fname = e_IMAGE."emotes/".$packID."/emoticons.xml";
|
$fname = e_IMAGE."emotes/".$packID."/emoticons.xml";
|
||||||
$backname = e_IMAGE."emotes/".$packID."/emoticons.bak";
|
$backname = e_IMAGE."emotes/".$packID."/emoticons.bak";
|
||||||
@@ -407,11 +401,11 @@ class emotec
|
|||||||
|
|
||||||
if (file_put_contents($fname,$f_string) === FALSE)
|
if (file_put_contents($fname,$f_string) === FALSE)
|
||||||
{
|
{
|
||||||
$emessage->add('<strong>'.EMOLAN_30.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname), E_MESSAGE_WARNING);
|
$mes->addWarning('<strong>'.EMOLAN_30.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$emessage->add('<strong>'.EMOLAN_29.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname), E_MESSAGE_SUCCESS);
|
$mes->addSuccess('<strong>'.EMOLAN_29.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +413,9 @@ class emotec
|
|||||||
// Save configuration for an emote pack that's been edited
|
// Save configuration for an emote pack that's been edited
|
||||||
function saveConf()
|
function saveConf()
|
||||||
{
|
{
|
||||||
global $sql, $tp;
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
|
|
||||||
$packID = $_POST['packID'];
|
$packID = $_POST['packID'];
|
||||||
unset($_POST['sub_conf'], $_POST['packID']);
|
unset($_POST['sub_conf'], $_POST['packID']);
|
||||||
@@ -442,7 +438,10 @@ class emotec
|
|||||||
// Return false to disable listing of packs
|
// Return false to disable listing of packs
|
||||||
function installCheck($do_one = FALSE)
|
function installCheck($do_one = FALSE)
|
||||||
{
|
{
|
||||||
global $e107, $emessage, $sql, $fl;
|
global $e107;
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$fl = e107::getFile();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
|
||||||
// Pick up a list of emote packs from the database
|
// Pick up a list of emote packs from the database
|
||||||
$pack_local = array();
|
$pack_local = array();
|
||||||
@@ -463,8 +462,8 @@ class emotec
|
|||||||
<div>".LAN_NAME.": {$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);
|
$mes->addError($msg);
|
||||||
$e107->ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_21, $emessage->render());
|
$ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_21, $mes->render());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,7 +621,7 @@ class emotec
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//echo "Unsupported XML File Format<br /><br />";
|
//echo "Unsupported XML File Format<br /><br />";
|
||||||
$emessage->add(EMOLAN_33, E_MESSAGE_WARNING);
|
$mes->addWarning(EMOLAN_33);
|
||||||
$no_error = FALSE;
|
$no_error = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,8 +635,6 @@ class emotec
|
|||||||
if($confFile['type'] == "php")
|
if($confFile['type'] == "php")
|
||||||
{
|
{
|
||||||
include_once(e_IMAGE."emotes/".$value."/".$confFile['file']);
|
include_once(e_IMAGE."emotes/".$value."/".$confFile['file']);
|
||||||
//$emessage->add(EMOLAN_25." '{$value}'", E_MESSAGE_INFO);
|
|
||||||
|
|
||||||
$File_type = EMOLAN_24;
|
$File_type = EMOLAN_24;
|
||||||
$tmp = $_emoteconf; // Use consistent name
|
$tmp = $_emoteconf; // Use consistent name
|
||||||
}
|
}
|
||||||
@@ -652,13 +649,11 @@ class emotec
|
|||||||
{ // Assume new pack
|
{ // Assume new pack
|
||||||
$sql->db_Insert("core", "'emote_".$value."', '{$tmp}' ");
|
$sql->db_Insert("core", "'emote_".$value."', '{$tmp}' ");
|
||||||
}
|
}
|
||||||
//echo "<div style='text-align: center;'><b>".$File_type." '</b> ".$value."'</div>";
|
$mes->addInfo("<strong>{$File_type}</strong> '{$value}'");
|
||||||
$emessage->add("<strong>{$File_type}</strong> '{$value}'", E_MESSAGE_INFO);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Error occurred
|
{ // Error occurred
|
||||||
//echo "<div style='text-align: center;'><b>".EMOLAN_27." '</b> ".$value."'</div>";
|
$mes->addError(EMOLAN_27." '{$value}'");
|
||||||
$emessage->add(EMOLAN_27." '{$value}'", E_MESSAGE_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -669,13 +664,11 @@ class emotec
|
|||||||
{
|
{
|
||||||
foreach ($pack_local as $p => $d)
|
foreach ($pack_local as $p => $d)
|
||||||
{
|
{
|
||||||
$emessage->add(EMOLAN_34.$p.EMOLAN_35, E_MESSAGE_INFO);
|
$mes->addInfo(EMOLAN_34.$p.EMOLAN_35);
|
||||||
$sql->db_Delete("core","`e107_name` = 'emote_{$p}'");
|
$sql->db_Delete("core","`e107_name` = 'emote_{$p}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//echo $emessage->render();
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user