mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
php8 warnings cleanup
This commit is contained in:
parent
b731a05bb3
commit
7ebd6a5f74
@ -36,7 +36,7 @@ if (isset($config['id_user']) === false) {
|
|||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var menuType_value = "<?php echo $_SESSION['menu_type']; ?>";
|
var menuType_value = "<?php echo ($_SESSION['menu_type'] ?? ''); ?>";
|
||||||
|
|
||||||
if (menuType_value === '' || menuType_value === 'classic') {
|
if (menuType_value === '' || menuType_value === 'classic') {
|
||||||
$('ul.submenu').css('left', '214px');
|
$('ul.submenu').css('left', '214px');
|
||||||
|
@ -659,15 +659,17 @@ class ConsoleSupervisor
|
|||||||
$_cache_targets = [];
|
$_cache_targets = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_cache_targets[$key] !== null) {
|
if (isset($_cache_targets[$key]) === true
|
||||||
|
&& $_cache_targets[$key] !== null
|
||||||
|
) {
|
||||||
$targets = $_cache_targets[$key];
|
$targets = $_cache_targets[$key];
|
||||||
} else {
|
} else {
|
||||||
$targets = get_notification_source_targets(
|
$targets = get_notification_source_targets(
|
||||||
$source_id,
|
$source_id,
|
||||||
$data['type']
|
$data['type']
|
||||||
);
|
);
|
||||||
$this->targetGroups = $targets['groups'];
|
$this->targetGroups = ($targets['groups'] ?? null);
|
||||||
$this->targetUsers = $targets['users'];
|
$this->targetUsers = ($targets['users'] ?? null);
|
||||||
|
|
||||||
$_cache_targets[$key] = $targets;
|
$_cache_targets[$key] = $targets;
|
||||||
}
|
}
|
||||||
|
@ -473,12 +473,13 @@ class HTML
|
|||||||
bool $direct=false
|
bool $direct=false
|
||||||
) {
|
) {
|
||||||
global $config;
|
global $config;
|
||||||
|
$text_color = '';
|
||||||
if ($config['style'] === 'pandora_black') {
|
if ($config['style'] === 'pandora_black') {
|
||||||
$text_color = 'style="color: white"';
|
$text_color = 'style="color: white"';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
if ($input['hidden'] == 1) {
|
if (($input['hidden'] ?? null) == 1) {
|
||||||
$class = ' hidden';
|
$class = ' hidden';
|
||||||
} else {
|
} else {
|
||||||
$class = '';
|
$class = '';
|
||||||
@ -488,9 +489,9 @@ class HTML
|
|||||||
$class = $input['class'].$class;
|
$class = $input['class'].$class;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($input['block_content']) === true) {
|
if (is_array(($input['block_content'] ?? null)) === true) {
|
||||||
$direct = (bool) $input['direct'];
|
$direct = (bool) ($input['direct'] ?? false);
|
||||||
$toggle = (bool) $input['toggle'];
|
$toggle = (bool) ($input['toggle'] ?? false);
|
||||||
|
|
||||||
if (isset($input['label']) === true) {
|
if (isset($input['label']) === true) {
|
||||||
$output .= '<span '.$text_color.'>'.$input['label'].'</span>';
|
$output .= '<span '.$text_color.'>'.$input['label'].'</span>';
|
||||||
@ -499,13 +500,13 @@ class HTML
|
|||||||
// Print independent block of inputs.
|
// Print independent block of inputs.
|
||||||
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
|
$output .= '<li id="li-'.$input['block_id'].'" class="'.$class.'">';
|
||||||
|
|
||||||
if ($input['wrapper']) {
|
if (isset($input['wrapper']) === true) {
|
||||||
$output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">';
|
$output .= '<'.$input['wrapper'].' id="'.$input['block_id'].'" class="'.$class.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$direct) {
|
if (!$direct) {
|
||||||
// Avoid encapsulation if input is direct => 1.
|
// Avoid encapsulation if input is direct => 1.
|
||||||
$output .= '<ul class="wizard '.$input['block_class'].'">';
|
$output .= '<ul class="wizard '.($input['block_class'] ?? '').'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
@ -544,7 +545,7 @@ class HTML
|
|||||||
$output .= '</ul>';
|
$output .= '</ul>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($input['wrapper']) {
|
if (isset($input['wrapper']) === true) {
|
||||||
$output .= '</'.$input['wrapper'].'>';
|
$output .= '</'.$input['wrapper'].'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -560,7 +561,7 @@ class HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$direct) {
|
if (!$direct) {
|
||||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
$output .= '<li id="'.($input['id'] ?? '').'" class="'.$class.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($input['label']) === true) {
|
if (isset($input['label']) === true) {
|
||||||
@ -569,7 +570,7 @@ class HTML
|
|||||||
|
|
||||||
$output .= self::printInput($input['arguments']);
|
$output .= self::printInput($input['arguments']);
|
||||||
// Allow dynamic content.
|
// Allow dynamic content.
|
||||||
$output .= $input['extra'];
|
$output .= ($input['extra'] ?? '');
|
||||||
if (!$direct) {
|
if (!$direct) {
|
||||||
$output .= '</li>';
|
$output .= '</li>';
|
||||||
}
|
}
|
||||||
@ -581,7 +582,7 @@ class HTML
|
|||||||
} else {
|
} else {
|
||||||
$output .= self::printInput($input['arguments']);
|
$output .= self::printInput($input['arguments']);
|
||||||
// Allow dynamic content.
|
// Allow dynamic content.
|
||||||
$output .= $input['extra'];
|
$output .= ($input['extra'] ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,13 +774,13 @@ class HTML
|
|||||||
bool $return=false,
|
bool $return=false,
|
||||||
bool $print_white_box=false
|
bool $print_white_box=false
|
||||||
) {
|
) {
|
||||||
$form = $data['form'];
|
$form = ($data['form'] ?? null);
|
||||||
$inputs = $data['inputs'];
|
$inputs = ($data['inputs'] ?? []);
|
||||||
$rawInputs = $data['rawInputs'];
|
$rawInputs = ($data['rawInputs'] ?? null);
|
||||||
$js = $data['js'];
|
$js = ($data['js'] ?? null);
|
||||||
$rawjs = $data['js_block'];
|
$rawjs = ($data['js_block'] ?? null);
|
||||||
$cb_function = $data['cb_function'];
|
$cb_function = ($data['cb_function'] ?? null);
|
||||||
$cb_args = $data['cb_args'];
|
$cb_args = ($data['cb_args'] ?? null);
|
||||||
|
|
||||||
$output_head = '';
|
$output_head = '';
|
||||||
if (empty($data['pre-content']) === false) {
|
if (empty($data['pre-content']) === false) {
|
||||||
@ -848,7 +849,9 @@ class HTML
|
|||||||
$output .= '<ul class="wizard">';
|
$output .= '<ul class="wizard">';
|
||||||
|
|
||||||
foreach ($inputs as $input) {
|
foreach ($inputs as $input) {
|
||||||
if ($input['arguments']['type'] != 'submit') {
|
if (is_array(($input['arguments'] ?? null)) === true
|
||||||
|
&& $input['arguments']['type'] != 'submit'
|
||||||
|
) {
|
||||||
$output .= self::printBlock($input, true);
|
$output .= self::printBlock($input, true);
|
||||||
} else {
|
} else {
|
||||||
$output_submit .= self::printBlock($input, true);
|
$output_submit .= self::printBlock($input, true);
|
||||||
|
@ -3339,8 +3339,8 @@ function get_um_url()
|
|||||||
*/
|
*/
|
||||||
function config_return_in_bytes($val)
|
function config_return_in_bytes($val)
|
||||||
{
|
{
|
||||||
$val = (int) trim($val);
|
|
||||||
$last = strtolower($val[(strlen($val) - 1)]);
|
$last = strtolower($val[(strlen($val) - 1)]);
|
||||||
|
$val = (int) trim($val);
|
||||||
switch ($last) {
|
switch ($last) {
|
||||||
// The 'G' modifier is available since PHP 5.1.0.
|
// The 'G' modifier is available since PHP 5.1.0.
|
||||||
case 'g':
|
case 'g':
|
||||||
|
@ -2816,7 +2816,7 @@ function html_print_input_number(array $settings):string
|
|||||||
$output .= $attribute.'="'.$attr_value.'" ';
|
$output .= $attribute.'="'.$attr_value.'" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= $function.'/>';
|
$output .= '/>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4472,8 +4472,8 @@ function html_print_switch($attributes=[])
|
|||||||
$html_expand = '';
|
$html_expand = '';
|
||||||
|
|
||||||
// Check the load values on status.
|
// Check the load values on status.
|
||||||
$html_expand .= (bool) ($attributes['value']) ? ' checked' : '';
|
$html_expand .= (bool) ($attributes['value'] ?? false) ? ' checked' : '';
|
||||||
$html_expand .= (bool) ($attributes['disabled']) ? ' disabled' : '';
|
$html_expand .= (bool) ($attributes['disabled'] ?? false) ? ' disabled' : '';
|
||||||
|
|
||||||
// Only load the valid attributes.
|
// Only load the valid attributes.
|
||||||
$valid_attrs = [
|
$valid_attrs = [
|
||||||
@ -4495,9 +4495,9 @@ function html_print_switch($attributes=[])
|
|||||||
$attributes['style'] = '';
|
$attributes['style'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$disabled_class = (bool) ($attributes['disabled']) ? ' p-slider-disabled' : '';
|
$disabled_class = (bool) ($attributes['disabled'] ?? false) ? ' p-slider-disabled' : '';
|
||||||
|
|
||||||
return "<label class='p-switch ".$attributes['container-class']."' style='".$attributes['style']."'>
|
return "<label class='p-switch ".($attributes['container-class'] ?? '')."' style='".($attributes['style'] ?? '')."'>
|
||||||
<input type='checkbox' ".$html_expand.">
|
<input type='checkbox' ".$html_expand.">
|
||||||
<span class='p-slider".$disabled_class."'></span>
|
<span class='p-slider".$disabled_class."'></span>
|
||||||
</label>";
|
</label>";
|
||||||
@ -4573,7 +4573,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
if ($data['label'] && $input_only === false) {
|
if (($data['label'] ?? false) && $input_only === false) {
|
||||||
$output = '<'.$wrapper.' id="'.$wrapper.'-'.$data['name'].'" ';
|
$output = '<'.$wrapper.' id="'.$wrapper.'-'.$data['name'].'" ';
|
||||||
$output .= ' class="'.$data['input_class'].'">';
|
$output .= ' class="'.$data['input_class'].'">';
|
||||||
$output .= '<label '.$style.' class="'.$data['label_class'].'">';
|
$output .= '<label '.$style.' class="'.$data['label_class'].'">';
|
||||||
@ -5165,7 +5165,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||||||
$output .= '</'.$data['wrapper'].'>';
|
$output .= '</'.$data['wrapper'].'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['label'] && $input_only === false) {
|
if (($data['label'] ?? false) && $input_only === false) {
|
||||||
$output .= '</'.$wrapper.'>';
|
$output .= '</'.$wrapper.'>';
|
||||||
if (!$data['return']) {
|
if (!$data['return']) {
|
||||||
echo '</'.$wrapper.'>';
|
echo '</'.$wrapper.'>';
|
||||||
|
@ -395,7 +395,15 @@ function menu_print_menu(&$menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Choose valid section (sec).
|
// Choose valid section (sec).
|
||||||
if (enterprise_hook('enterprise_acl', [$config['id_user'], $mainsec, $main['sec2']]) == false) {
|
if ((bool) enterprise_hook(
|
||||||
|
'enterprise_acl',
|
||||||
|
[
|
||||||
|
$config['id_user'],
|
||||||
|
$mainsec,
|
||||||
|
($main['sec2'] ?? null),
|
||||||
|
]
|
||||||
|
) === false
|
||||||
|
) {
|
||||||
if ($count_sub_access > 0) {
|
if ($count_sub_access > 0) {
|
||||||
// If any susection have access but main section not, we change main link to first subsection found
|
// If any susection have access but main section not, we change main link to first subsection found
|
||||||
$main['sec2'] = $first_sub_sec2;
|
$main['sec2'] = $first_sub_sec2;
|
||||||
|
@ -1010,7 +1010,7 @@ if (isset($_GET['bye'])) {
|
|||||||
|
|
||||||
clear_pandora_error_for_header();
|
clear_pandora_error_for_header();
|
||||||
|
|
||||||
if ((bool) $config['node_deactivated'] === true) {
|
if ((bool) ($config['node_deactivated'] ?? false) === true) {
|
||||||
// Prevent access node if not merged.
|
// Prevent access node if not merged.
|
||||||
include 'general/node_deactivated.php';
|
include 'general/node_deactivated.php';
|
||||||
|
|
||||||
@ -1021,7 +1021,7 @@ if ((bool) $config['node_deactivated'] === true) {
|
|||||||
exit('</html>');
|
exit('</html>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((bool) $config['maintenance_mode'] === true
|
if ((bool) ($config['maintenance_mode'] ?? false) === true
|
||||||
&& (bool) users_is_admin() === false
|
&& (bool) users_is_admin() === false
|
||||||
) {
|
) {
|
||||||
// Show maintenance web-page. For non-admin users only.
|
// Show maintenance web-page. For non-admin users only.
|
||||||
@ -1082,7 +1082,7 @@ if (get_parameter('login', 0) !== 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((bool) $config['maintenance_mode'] === true
|
if ((bool) ($config['maintenance_mode'] ?? false) === true
|
||||||
&& (bool) users_is_admin() === false
|
&& (bool) users_is_admin() === false
|
||||||
) {
|
) {
|
||||||
// Show maintenance web-page. For non-admin users only.
|
// Show maintenance web-page. For non-admin users only.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user