Skip to content

Commit

Permalink
Issue #5079 - PHP warnings/notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 18, 2023
1 parent 1744d1f commit d9fc6d4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
21 changes: 14 additions & 7 deletions e107_handlers/plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,7 @@ function update_plugins_table($mode = 'upgrade')
}
e107::getDebug()->logTime('Start Scanning Plugin Files');
$plugList = $fl->get_files(e_PLUGIN, "^plugin\.(php|xml)$", "standard", 1);
$pluginList = [];

foreach ($plugList as $num => $val) // Remove Duplicates caused by having both plugin.php AND plugin.xml.
{
Expand Down Expand Up @@ -1979,6 +1980,7 @@ static function getPluginRecord($id)
{
$dbgArr = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,3);
unset($dbgArr[0]);
trigger_error("Deprecated call to getPluginRecord() using integer.".print_r($dbgArr,true), E_USER_DEPRECATED);
e107::getLog()->addDebug("Deprecated call to getPluginRecord() using integer.".print_a($dbgArr,true));

}
Expand Down Expand Up @@ -2018,7 +2020,7 @@ private function setUe()
*/
private function ue_field_name($folder, $type, $name)
{
if($type == EUF_PREFIELD || $type == EUF_CATEGORY)
if($type == defset('EUF_PREFIELD') || $type == defset('EUF_CATEGORY'))
{
return $name; // no plugin_plugname_ prefix
}
Expand Down Expand Up @@ -2092,7 +2094,7 @@ private function manage_extended_field($action, $field_name, $field_attrib, $fie
$mes->addDebug("Extended Field: ".$action.": ".$field_name." : ".$type_name);

// predefined
if($type == EUF_PREFIELD)
if($type == defset('EUF_PREFIELD'))
{

$preList = $this->module['ue']->parse_extended_xml(''); // passed value currently not used at all, could be file path in the near future
Expand All @@ -2113,7 +2115,7 @@ private function manage_extended_field($action, $field_name, $field_attrib, $fie

}
// not allowed for categories
elseif($type == EUF_CATEGORY)
elseif($type == defset('EUF_CATEGORY'))
{
$field_attrib['parent'] = 0;
}
Expand Down Expand Up @@ -2191,14 +2193,14 @@ private function manage_extended_field($action, $field_name, $field_attrib, $fie
);

// db fields handling
if($status && $type == EUF_DB_FIELD)
if($status && $type == defset('EUF_DB_FIELD'))
{
// handle DB, use original non-modified name value
$status = !$this->manage_extended_field_sql('add', $field_attrib['name']); // reverse logic - sql method do a error check
}

// refresh categories - sadly the best way so far... need improvement (inside ue class)
if($status && $type == EUF_CATEGORY)
if($status && $type == defset('EUF_CATEGORY'))
{
$cats = $this->module['ue']->user_extended_get_categories(false);
foreach ($cats as $cat)
Expand All @@ -2214,7 +2216,7 @@ private function manage_extended_field($action, $field_name, $field_attrib, $fie
{
//var_dump($field_attrib, $field_name, $type);
$status = $this->module['ue']->user_extended_remove($field_name, $field_name);
if($status && $type == EUF_DB_FIELD && strpos($field_name, 'plugin_') != 0)
if($status && $type == defset('EUF_DB_FIELD') && strpos($field_name, 'plugin_') != 0)
{
$status = $this->manage_extended_field_sql('remove', $field_attrib['name']);
}
Expand Down Expand Up @@ -2655,6 +2657,8 @@ function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '')
*/
$pref = e107::getPref();

$newvals = [];

$prefvals[] = $varArray;
// $prefvals[] = $plugin_folder;
// }
Expand Down Expand Up @@ -3309,6 +3313,7 @@ private function addonUser($plug, $function, $opts=array())
}



/**
* Manage xxxxx_menu files.
* @param string $plug
Expand Down Expand Up @@ -3427,6 +3432,8 @@ function XmlTables($function, $plug, $options = array())
$tableData = $dbv->getSqlFileTables($contents);

$query = '';
$status = E_MESSAGE_INFO;

foreach($tableData['tables'] as $k=>$v)
{
switch($function)
Expand Down Expand Up @@ -5258,7 +5265,7 @@ function getIcon($plugName='', $size=32, $defaultOverride=false)


$sizeArray = array(32=>'icon', 16=>'iconSmall');
$default = ($size == 32) ? $tp->toGlyph('e-cat_plugins-32') : "<img class='icon S16' src='".E_16_CAT_PLUG."' alt='' />";
$default = ($size == 32) ? $tp->toGlyph('e-cat_plugins-32') : "<img class='icon S16' src='".defset('E_16_CAT_PLUG')."' alt='' />";
$sz = $sizeArray[$size];

$icon_src = e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz];
Expand Down
2 changes: 1 addition & 1 deletion e107_themes/bootstrap3/admin_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ i.s-message-empty { background:none; }
display: inline-block;
*display: inline;
*zoom: 1;
transform: scale(1);transform-origin: 0 0;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
Expand Down
2 changes: 1 addition & 1 deletion e107_themes/bootstrap3/css/bootstrap-dark.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ to{background-position:0 0}
.progress-striped .progress-bar-danger{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}
.media{margin-top:15px}
.media:first-child{margin-top:0}
.media,.media-body{zoom:1;overflow:hidden}
.media,.media-body{transform: scale(1);transform-origin: 0 0;overflow:hidden}
.media-body{width:10000px}
.media-object.img-thumbnail{max-width:none}
.media-right,.media>.pull-right{padding-left:10px}
Expand Down
2 changes: 1 addition & 1 deletion e107_themes/bootstrap3/css/corporate.css
Original file line number Diff line number Diff line change
Expand Up @@ -4390,7 +4390,7 @@ a.thumbnail.active {

.media,
.media-body {
zoom: 1;
transform: scale(1);transform-origin: 0 0;;
overflow: hidden; }

.media-body {
Expand Down
2 changes: 1 addition & 1 deletion e107_themes/bootstrap3/css/modern-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ to{background-position:0 0}
.progress-striped .progress-bar-danger{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}
.media{margin-top:15px}
.media:first-child{margin-top:0}
.media,.media-body{zoom:1;overflow:hidden}
.media,.media-body{transform: scale(1);transform-origin: 0 0;overflow:hidden}
.media-body{width:10000px}
.media-object.img-thumbnail{max-width:none}
.media-right,.media>.pull-right{padding-left:10px}
Expand Down
2 changes: 1 addition & 1 deletion e107_themes/bootstrap3/css/modern-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@
.progress-striped .progress-bar-danger{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}
.media{margin-top:15px}
.media:first-child{margin-top:0}
.media,.media-body{zoom:1;overflow:hidden}
.media,.media-body{transform: scale(1);transform-origin: 0 0;overflow:hidden}
.media-body{width:10000px}
.media-object.img-thumbnail{max-width:none}
.media-right,.media>.pull-right{padding-left:10px}
Expand Down

0 comments on commit d9fc6d4

Please sign in to comment.