fixed visual error

This commit is contained in:
marcos 2021-03-18 09:53:39 +01:00
parent 572f8c9908
commit b6a7598c33
2 changed files with 29 additions and 4 deletions

View File

@ -472,6 +472,11 @@ class HTML
bool $return=false, bool $return=false,
bool $direct=false bool $direct=false
) { ) {
global $config;
if ($config['style'] === 'pandora_black') {
$text_color = 'style="color: white"';
}
$output = ''; $output = '';
if ($input['hidden'] == 1) { if ($input['hidden'] == 1) {
$class = ' hidden'; $class = ' hidden';
@ -488,7 +493,7 @@ class HTML
$toggle = (bool) $input['toggle']; $toggle = (bool) $input['toggle'];
if (isset($input['label']) === true) { if (isset($input['label']) === true) {
$output .= '<span>'.$input['label'].'</span>'; $output .= '<span '.$text_color.'>'.$input['label'].'</span>';
} }
// Print independent block of inputs. // Print independent block of inputs.
@ -559,7 +564,7 @@ class HTML
} }
if (isset($input['label']) === true) { if (isset($input['label']) === true) {
$output .= '<label>'.$input['label'].'</label>'; $output .= '<label '.$text_color.'>'.$input['label'].'</label>';
} }
$output .= self::printInput($input['arguments']); $output .= self::printInput($input['arguments']);

View File

@ -701,6 +701,7 @@ function html_print_select(
static $idcounter = []; static $idcounter = [];
global $config;
// If duplicate names exist, it will start numbering. Otherwise it won't // If duplicate names exist, it will start numbering. Otherwise it won't
if (isset($idcounter[$name])) { if (isset($idcounter[$name])) {
$idcounter[$name]++; $idcounter[$name]++;
@ -741,7 +742,14 @@ function html_print_select(
if ($style === false) { if ($style === false) {
$styleText = ' '; $styleText = ' ';
if ($config['style'] === 'pandora_black') {
$styleText = 'style="color: white"';
}
} else { } else {
if ($config['style'] === 'pandora_black') {
$style .= ' color: white';
}
$styleText = 'style="'.$style.'"'; $styleText = 'style="'.$style.'"';
} }
@ -2581,11 +2589,18 @@ function html_print_input_number(array $settings):string
'step', 'step',
]; ];
global $config;
$text_color = '';
if ($config['style'] === 'pandora_black') {
$text_color = 'style="color: white"';
}
$output = ''; $output = '';
if (isset($settings) === true && is_array($settings) === true) { if (isset($settings) === true && is_array($settings) === true) {
// Check Name is necessary. // Check Name is necessary.
if (isset($settings['name']) === true) { if (isset($settings['name']) === true) {
$output = '<input type="number" '; $output = '<input '.$text_color.' type="number" ';
// Check Max length. // Check Max length.
if (isset($settings['maxlength']) === false) { if (isset($settings['maxlength']) === false) {
@ -4328,16 +4343,21 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
*/ */
function html_print_input($data, $wrapper='div', $input_only=false) function html_print_input($data, $wrapper='div', $input_only=false)
{ {
global $config;
if (is_array($data) === false) { if (is_array($data) === false) {
return ''; return '';
} }
if ($config['style'] === 'pandora_black') {
$style = 'style="color: white"';
}
$output = ''; $output = '';
if ($data['label'] && $input_only === false) { if ($data['label'] && $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 class="'.$data['label_class'].'">'; $output .= '<label '.$style.' class="'.$data['label_class'].'">';
$output .= $data['label']; $output .= $data['label'];
$output .= '</label>'; $output .= '</label>';