1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

More $emessage -> $mes and code clean-up

This commit is contained in:
Tijn Kuyper 2013-02-26 16:36:25 +01:00
parent 1e273d2854
commit 6f7e8d26d7
4 changed files with 42 additions and 48 deletions

View File

@ -668,7 +668,7 @@ class pluginManager{
$plugin = e107::getPlugin();
$sql = e107::getDb();
$emessage = eMessage::getInstance();
$mes = e107::getMessage();
$plug = $plugin->getinfo($this->id);
$_path = e_PLUGIN.$plug['plugin_path'].'/';
@ -692,7 +692,7 @@ class pluginManager{
if (true !== $result)
{
//$text .= EPL_ADLAN_9.'<br />';
$emessage->addWarning(EPL_ADLAN_9)
$mes->addWarning(EPL_ADLAN_9)
->addDebug($result);
}
else
@ -744,7 +744,7 @@ class pluginManager{
}
$emessage->add($text, E_MESSAGE_SUCCESS);
$mes->addSuccess($text);
$plugin->save_addon_prefs('update');
}
@ -838,6 +838,7 @@ class pluginManager{
global $plugin;
$frm = e107::getForm();
$e107 = e107::getInstance();
$mes = e107::getMessage();
if($this->action == "" || $this->action == "installed")
{
@ -892,8 +893,7 @@ class pluginManager{
</form>
";
$emessage = &eMessage::getInstance();
e107::getRender()->tablerender(ADLAN_98.SEP.$caption, $emessage->render(). $text);
e107::getRender()->tablerender(ADLAN_98.SEP.$caption, $mes->render(). $text);
}
@ -1255,8 +1255,8 @@ class pluginManager{
function show_message($message, $type = E_MESSAGE_INFO, $session = false)
{
// ##### Display comfort ---------
$emessage = &eMessage::getInstance();
$emessage->add($message, $type, $session);
$mes = e107::getMessage();
$mes->add($message, $type, $session);
}
function pluginMenuOptions()

View File

@ -96,14 +96,14 @@ if(!$core_pref->get('timezone'))
}
$frm = e107::getForm(false, true); //enable inner tabindex counter
$emessage = e107::getMessage();
$mes = e107::getMessage();
$tp = e107::getParser();
/* RESET DISPLAY NAMES */
if(isset($_POST['submit_resetdisplaynames']))
{
e107::getDb()->db_Update('user', 'user_name=user_loginname');
$emessage->add(PRFLAN_157);
$mes->addInfo(PRFLAN_157);
}
//echo '<pre>';
@ -140,7 +140,7 @@ if(isset($_POST['updateprefs']))
if (($_POST['user_reg_veri'] == 1 || $_POST['allowEmailLogin'] == 1) && $_POST['disable_emailcheck'])
{
$_POST['disable_emailcheck'] = 0;
$emessage->add(PRFLAN_211, E_MESSAGE_ERROR);
$mes->addError(PRFLAN_211);
}
// Table of range checking values - min and max for numerics. Only do the important ones
@ -166,12 +166,12 @@ if(isset($_POST['updateprefs']))
if($value < $pref_limits[$key]['min'])
{
$value = $pref_limits[$key]['min'];
$emessage->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_213));
$mes->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_213));
}
if($value > $pref_limits[$key]['max'])
{
$value = $pref_limits[$key]['max'];
$emessage->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_212));
$mes->addWarning(str_replace(array('--FIELD--','--VALUE--'),array($key,$value),PRFLAN_212));
}
}
else
@ -186,7 +186,7 @@ if(isset($_POST['updateprefs']))
if(!preg_match('/^[\w\-]+$/', $value))
{
$newValue = e_COOKIE;
$emessage->addWarning(PRFLAN_219);
$mes->addWarning(PRFLAN_219);
}
else
{
@ -255,11 +255,11 @@ function sendTest()
$sendto = trim($_POST['testaddress']);
if (!sendemail($sendto, LAN_MAILOUT_113." ".SITENAME.$add, LAN_MAILOUT_114,LAN_MAILOUT_189))
{
$mes->add(($pref['mailer'] == 'smtp') ? LAN_MAILOUT_67 : LAN_MAILOUT_106, E_MESSAGE_ERROR);
$mes->addError(($pref['mailer'] == 'smtp') ? LAN_MAILOUT_67 : LAN_MAILOUT_106);
}
else
{
$mes->add(LAN_MAILOUT_81. ' ('.$sendto.')', E_MESSAGE_SUCCESS);
$mes->addSuccess(LAN_MAILOUT_81. ' ('.$sendto.')');
$log->log_event('MAIL_01',$sendto,E_LOG_INFORMATIVE,'');
}
}
@ -267,11 +267,6 @@ function sendTest()
}
/*
if(isset($message))
{
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
if(e_QUERY == "u")
{
$ns->tablerender("", "<div style='text-align:center'><b>".PRFLAN_106."</b></div>");
@ -1859,7 +1854,7 @@ $text .= "
</div>
";
$e107->ns->tablerender(PRFLAN_53, $emessage->render().$text);
$ns->tablerender(PRFLAN_53, $mes->render().$text);
require_once(e_ADMIN."footer.php");

View File

@ -2,7 +2,7 @@
/*
* e107 website system
*
* Copyright (C) 2008-2012 e107 Inc (e107.org)
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
@ -27,8 +27,8 @@ require_once('auth.php');
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER."message_handler.php");
require_once (e_HANDLER.'form_handler.php');
$frm = new e_form(true);
$emessage = &eMessage::getInstance();
$frm = e107::getForm();
$mes = e107::getMessage();
$e_userclass = new user_class();
$query = explode('.', e_QUERY);
@ -105,14 +105,14 @@ if (isset($_POST['update_main']))
$check = $sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'");
if($check)
{
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
$mes->addSuccess(LAN_UPDATED);
$admin_log->log_event('SEARCH_04','',E_LOG_INFORMATIVE,'');
}
elseif(0 === $check) $emessage->add(LAN_NO_CHANGE); //info
elseif(0 === $check) $mes->addInfo(LAN_NO_CHANGE);
else
{
$emessage->add(LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$emessage->add(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText(), E_MESSAGE_ERROR);
$mes->addError(LAN_UPDATED_FAILED);
$mes->addError(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
}
}
@ -143,14 +143,14 @@ if (isset($_POST['update_handler']))
$check = $sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'");
if($check)
{
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
$mes->addSuccess(LAN_UPDATED);
$admin_log->log_event('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
}
elseif(0 === $check) $emessage->add(LAN_NO_CHANGE); //info
elseif(0 === $check) $mes->addInfo(LAN_NO_CHANGE);
else
{
$emessage->add(LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$emessage->add(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText(), E_MESSAGE_ERROR);
$mes->addError(LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$mes->addError(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
}
}
@ -175,16 +175,16 @@ if (isset($_POST['update_prefs']))
$check = $sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'");
if($check)
{
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
$mes->addSuccess(LAN_UPDATED);
$admin_log->log_event('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
}
else //it's an error
{
$emessage->add(LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$emessage->add(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText(), E_MESSAGE_ERROR);
$mes->addError(LAN_UPDATED_FAILED);
$mes->addError(LAN_ERROR." ".$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
}
}
else $emessage->add(LAN_NO_CHANGE); //info
else $mes->addInfo(LAN_NO_CHANGE);
unset($temp);
$temp['search_restrict'] = intval($_POST['search_restrict']);
@ -196,7 +196,7 @@ if (isset($_POST['update_prefs']))
}
require_once(e_HANDLER."form_handler.php");
$rs = new form;
$rs = new form; //FIXME
$handlers_total = count($search_prefs['core_handlers']) + count($search_prefs['plug_handlers']);
@ -280,7 +280,7 @@ if ($query[0] == 'settings')
";
$e107->ns->tablerender(SEALAN_20, $emessage->render().$text);
$ns->tablerender(SEALAN_20, $mes->render().$text);
}
elseif ($query[0] == 'edit')
@ -350,7 +350,7 @@ elseif ($query[0] == 'edit')
</form>
";
$e107->ns->tablerender($caption, $emessage->render().$text);
$ns->tablerender($caption, $mes->render().$text);
}
else
@ -486,7 +486,7 @@ else
</form>
";
$e107->ns->tablerender(SEALAN_1, $emessage->render().$text);
$ns->tablerender(SEALAN_1, $mes->render().$text);
}
@ -507,5 +507,4 @@ function search_adminmenu()
e107::getNav()->admin(SEALAN_40, $action, $var);
}
?>

View File

@ -27,7 +27,7 @@ require_once(e_HANDLER.'message_handler.php');
// require_once(e_HANDLER.'user_handler.php'); //use e107::getUserSession() instead.
require_once(e_HANDLER.'validator_class.php');
$userMethods = e107::getUserSession();
$emessage = e107::getMessage();
$mes = e107::getMessage();
$frm = e107::getForm();
if (isset($_POST['update_settings']))
@ -57,20 +57,20 @@ if (isset($_POST['update_settings']))
{
$admin_log->log_event('ADMINPW_01', '', E_LOG_INFORMATIVE, '');
$userMethods->makeUserCookie(array('user_id' => USERID,'user_password' => $userData['data']['user_password']), FALSE); // Can't handle autologin ATM
$emessage->add(UDALAN_3." ".ADMINNAME, E_MESSAGE_SUCCESS);
$mes->addSuccess(UDALAN_3." ".ADMINNAME);
$e_event -> trigger('adpword');
$ns->tablerender(UDALAN_2, $emessage->render());
$ns->tablerender(UDALAN_2, $mes->render());
}
else
{
$emessage->add(UDALAN_1.' '.LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$ns->tablerender(LAN_UPDATED_FAILED, $emessage->render());
$mes->addError(UDALAN_1.' '.LAN_UPDATED_FAILED);
$ns->tablerender(LAN_UPDATED_FAILED, $mes->render());
}
}
else
{
$emessage->add(UDALAN_1.' '.LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$ns->tablerender(LAN_UPDATED_FAILED, $emessage->render());
$mes->addError(UDALAN_1.' '.LAN_UPDATED_FAILED);
$ns->tablerender(LAN_UPDATED_FAILED, $mes->render());
}
}
}