mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 04:32:01 +02:00
PHP8 Warning fixes.
This commit is contained in:
parent
798638a590
commit
5d7f921023
@ -50,6 +50,25 @@ if(is_array($logList)) //... and for any plugins which support it
|
||||
define('AL_DATE_TIME_FORMAT', 'y-m-d H:i:s');
|
||||
|
||||
|
||||
function loadEventTypes($table)
|
||||
{
|
||||
|
||||
$sql = e107::getDb();
|
||||
$row = $sql->retrieve("SELECT dblog_eventcode,dblog_title FROM #".$table." WHERE dblog_eventcode !='' AND dblog_title !='' GROUP BY dblog_eventcode",true);
|
||||
$eventTypes = array();
|
||||
foreach($row as $val)
|
||||
{
|
||||
$id = $val['dblog_eventcode'];
|
||||
$def = strpos($val['dblog_title'], "LAN") !== false ? $id : $val['dblog_title'];
|
||||
$eventTypes[$id] = str_replace(': [x]', '', deftrue($val['dblog_title'],$def));
|
||||
}
|
||||
|
||||
asort($eventTypes);
|
||||
|
||||
return $eventTypes;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class adminlog_admin extends e_admin_dispatcher
|
||||
{
|
||||
@ -198,18 +217,8 @@ class admin_log_ui extends e_admin_ui
|
||||
$this->perPage = vartrue($perPage,10);
|
||||
|
||||
$this->prefs['sys_log_perpage']['writeParms'] = array(10=>10, 15=>15, 20=>20, 30=>30, 40=>40, 50=>50);
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
$row = $sql->retrieve("SELECT dblog_eventcode,dblog_title FROM #admin_log WHERE dblog_eventcode !='' AND dblog_title !='' GROUP BY dblog_eventcode",true);
|
||||
foreach($row as $val)
|
||||
{
|
||||
$id = $val['dblog_eventcode'];
|
||||
$def = strpos($val['dblog_title'], "LAN") !== false ? $id : $val['dblog_title'];
|
||||
$this->eventTypes[$id] = str_replace(': [x]', '', deftrue($val['dblog_title'],$def));
|
||||
}
|
||||
|
||||
asort($this->eventTypes);
|
||||
$this->eventTypes = loadEventTypes('admin_log');
|
||||
|
||||
if(getperms('0'))
|
||||
{
|
||||
@ -722,13 +731,14 @@ class audit_log_ui extends e_admin_ui
|
||||
|
||||
protected $fieldpref = array('dblog_id', 'dblog_datestamp', 'dblog_microtime', 'dblog_eventcode', 'dblog_user_id', 'dblog_user_name', 'dblog_ip', 'dblog_title','dblog_remarks');
|
||||
|
||||
|
||||
public $eventTypes = array();
|
||||
|
||||
// optional
|
||||
public function init()
|
||||
{
|
||||
$perPage = e107::getConfig()->get('sys_log_perpage');
|
||||
$perPage = e107::getConfig()->get('sys_log_perpage');
|
||||
$this->perPage = vartrue($perPage,10);
|
||||
$this->eventTypes = loadEventTypes('audit_log');
|
||||
}
|
||||
|
||||
/*
|
||||
@ -777,12 +787,14 @@ class dblog_ui extends e_admin_ui
|
||||
|
||||
protected $fieldpref = array('dblog_id', 'dblog_datestamp', 'dblog_microtime', 'dblog_type', 'dblog_eventcode', 'dblog_user_id', 'dblog_user_name', 'dblog_ip', 'dblog_caller', 'dblog_title', 'dblog_remarks');
|
||||
|
||||
public $eventTypes = array();
|
||||
|
||||
// optional
|
||||
public function init()
|
||||
{
|
||||
$perPage = e107::getConfig()->get('sys_log_perpage');
|
||||
$this->perPage = vartrue($perPage,10);
|
||||
$perPage = e107::getConfig()->get('sys_log_perpage');
|
||||
$this->perPage = vartrue($perPage,10);
|
||||
$this->eventTypes = loadEventTypes('dblog');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ if (!getperms("A") && ($_GET['action'] != 'dialog') && ($_GET['action'] != 'yout
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_GET['action'] == 'youtube' )
|
||||
if(varset($_GET['action']) === 'youtube' )
|
||||
{
|
||||
if(!getperms('A') && !getperms('A1'))
|
||||
{
|
||||
|
@ -1166,7 +1166,7 @@ class news_admin_ui extends e_admin_ui
|
||||
<tr>
|
||||
<td>".NWSLAN_120."</td>
|
||||
<td>
|
||||
".$frm->bbarea('news_subheader', stripcslashes(vartrue($pref['news_subheader'])), 2, 'helpb')."
|
||||
".$frm->bbarea('news_subheader', stripcslashes(vartrue($pref['news_subheader'])), null, 'helpb')."
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -263,8 +263,8 @@ class plugin_notify_admin_ui extends e_admin_ui
|
||||
{
|
||||
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
|
||||
{
|
||||
$config_category = $this->pluginConfig[$plugin_id]['category'];
|
||||
$legacy = $this->pluginConfig[$plugin_id]['legacy'];
|
||||
$config_category = varset($this->pluginConfig[$plugin_id]['category']);
|
||||
$legacy = varset($this->pluginConfig[$plugin_id]['legacy']);
|
||||
|
||||
$text = "<table class='table adminform'>
|
||||
<colgroup>
|
||||
@ -273,9 +273,12 @@ class plugin_notify_admin_ui extends e_admin_ui
|
||||
</colgroup>";
|
||||
;
|
||||
|
||||
foreach ($this->pluginConfig[$plugin_id]['events'] as $event_id => $event_text)
|
||||
if(!empty($this->pluginConfig[$plugin_id]['events']))
|
||||
{
|
||||
$text .= $this->render_event($event_id, $event_text, $plugin_id, $legacy);
|
||||
foreach ($this->pluginConfig[$plugin_id]['events'] as $event_id => $event_text)
|
||||
{
|
||||
$text .= $this->render_event($event_id, $event_text, $plugin_id, $legacy);
|
||||
}
|
||||
}
|
||||
|
||||
$text .= "</table>\n";
|
||||
@ -336,10 +339,10 @@ class plugin_notify_admin_ui extends e_admin_ui
|
||||
<td class='form-inline nowrap'>
|
||||
".$uc->uc_dropdown('event['.$id.'][class]', varset($this->notify_prefs['event'][$id]['class'], e_UC_NOBODY), "nobody,main,admin,member,classes,email","onchange=\"mail_field(this.value,'event_".$id."');\" ");
|
||||
|
||||
if($this -> notify_prefs['event'][$id]['class'] == 'email')
|
||||
if(varset($this->notify_prefs['event'][$id]['class']) == 'email')
|
||||
{
|
||||
$disp='display:visible';
|
||||
$value = $tp -> toForm($this -> notify_prefs['event'][$id]['email']);
|
||||
$value = $tp -> toForm(varset($this->notify_prefs['event'][$id]['email']));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4418,7 +4418,7 @@ var_dump($select_options);*/
|
||||
|
||||
|
||||
$text .= (vartrue($val['url'])) ? '<a ' .$aClass. ' title="' .LAN_SORT."\" href='".str_replace(array('&', '&'), array('&', '&'),$val['url'])."'>" : ''; // Really this column-sorting link should be auto-generated, or be autocreated via unobtrusive js.
|
||||
$text .= defset($val['title'], $val['title']);
|
||||
$text .= !empty($val['title']) ? defset($val['title'], $val['title']) : '';
|
||||
$text .= ($val['url']) ? '</a>' : '';
|
||||
$text .= ($key === 'options' && !vartrue($val['noselector'])) ? $this->columnSelector($fieldarray, $columnPref) : '';
|
||||
$text .= ($key === 'checkboxes') ? $this->checkbox_toggle('e-column-toggle', vartrue($val['toggle'], 'multiselect')) : '';
|
||||
@ -6052,6 +6052,7 @@ var_dump($select_options);*/
|
||||
public function renderElement($key, $value, $attributes, $required_data = array(), $id = 0)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$ret = '';
|
||||
|
||||
$parms = vartrue($attributes['writeParms'], array());
|
||||
|
||||
@ -6934,13 +6935,18 @@ var_dump($select_options);*/
|
||||
';
|
||||
|
||||
e107::setRegistry('core/adminUI/currentPlugin');
|
||||
|
||||
$text = vartrue($options['form_pre']).$text.vartrue($options['form_post']);
|
||||
|
||||
}
|
||||
|
||||
if(!$nocontainer)
|
||||
{
|
||||
$class = deftrue('e_IFRAME') ? 'e-container e-container-modal' : 'e-container';
|
||||
$text = '<div class="'.$class.'">'.$text.'</div>';
|
||||
}
|
||||
return (vartrue($options['form_pre']).$text.vartrue($options['form_post']));
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$caption = "System Logs Help";
|
||||
if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'list';
|
||||
if (e_QUERY) list($action,$junk) = explode('.', e_QUERY); else $action = 'list';
|
||||
|
||||
function common_filters()
|
||||
{
|
||||
|
@ -250,6 +250,7 @@ define("LAN_AL_META_01", "Meta tags updated");
|
||||
|
||||
// Downloads
|
||||
//----------
|
||||
/*
|
||||
define("LAN_AL_DOWNL_01", "Download options changed");
|
||||
define("LAN_AL_DOWNL_02", "Download category created");
|
||||
define("LAN_AL_DOWNL_03", "Download category updated");
|
||||
@ -265,6 +266,7 @@ define("LAN_AL_DOWNL_12", "Download mirror added");
|
||||
define("LAN_AL_DOWNL_13", "Download mirror updated");
|
||||
define("LAN_AL_DOWNL_14", "Download mirror deleted");
|
||||
define("LAN_AL_DOWNL_15", "");
|
||||
*/
|
||||
|
||||
// Custom Pages/Menus
|
||||
//-------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user