Minor fixes

This commit is contained in:
Jose Gonzalez 2023-03-08 15:01:41 +01:00
parent bc501ec552
commit 1d3d2fc5fd
4 changed files with 129 additions and 81 deletions

View File

@ -2330,84 +2330,114 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
$adv_mode_name = '_'.$adv_mode_name; $adv_mode_name = '_'.$adv_mode_name;
} }
$table->data[0][0] = html_print_extended_select_for_downtime_cron( $table->data[1][0] = html_print_div(
'cron_hour'.$adv_mode_name, [
$hours, 'class' => '',
$hour, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_hour'.$adv_mode_name,
__('Any'), $hours,
'*', $hour,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)' false,
false,
0,
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)'
),
],
true
); );
$table->data[1][1] = html_print_extended_select_for_downtime_cron( $table->data[1][1] = html_print_div(
'cron_minute'.$adv_mode_name, [
$minutes, 'class' => '',
$minute, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_minute'.$adv_mode_name,
__('Any'), $minutes,
'*', $minute,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)' false,
false,
0,
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)'
),
],
true
); );
$table->data[1][2] = html_print_extended_select_for_downtime_cron( $table->data[1][2] = html_print_div(
'cron_mday'.$adv_mode_name, [
$mdays, 'class' => '',
$mday, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_mday'.$adv_mode_name,
__('Any'), $mdays,
'*', $mday,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)' false,
false,
0,
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)'
),
],
true
); );
$table->data[1][3] = html_print_extended_select_for_downtime_cron( $table->data[1][3] = html_print_div(
'cron_month'.$adv_mode_name, [
$months, 'class' => '',
$month, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_month'.$adv_mode_name,
__('Any'), $months,
'*', $month,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)' false,
false,
0,
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)'
),
],
true
); );
$table->data[1][4] = html_print_extended_select_for_downtime_cron( $table->data[1][4] = html_print_div(
'cron_wday'.$adv_mode_name, [
$wdays, 'class' => '',
$wday, 'content' => html_print_extended_select_for_downtime_cron(
'', 'cron_wday'.$adv_mode_name,
__('Any'), $wdays,
'*', $wday,
false, '',
true, __('Any'),
false, '*',
false, false,
false, true,
0, false,
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)' false,
false,
0,
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)'
),
],
true
); );
} }
@ -4186,7 +4216,7 @@ function html_print_switch_radio_button(array $switches, array $attributes=[], b
* @param string $checked Set the button to be marked (optional, unmarked by default). * @param string $checked Set the button to be marked (optional, unmarked by default).
* @param boolean $disabled Disable the button (optional, button enabled by default). * @param boolean $disabled Disable the button (optional, button enabled by default).
* @param string $script Script to execute when onClick event is triggered (optional). * @param string $script Script to execute when onClick event is triggered (optional).
* @param string $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional). * @param mixed $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional).
* @param boolean $return Whether to return an output string or echo now (optional, echo by default). * @param boolean $return Whether to return an output string or echo now (optional, echo by default).
* @param string $id Custom id. * @param string $id Custom id.
* @param string $customAttributes Custom Attribute for customized checkbox. * @param string $customAttributes Custom Attribute for customized checkbox.
@ -4217,6 +4247,7 @@ function html_print_checkbox_extended(
$inputClass = 'custom_checkbox_input'; $inputClass = 'custom_checkbox_input';
$labelClass = 'custom_checkbox'; $labelClass = 'custom_checkbox';
$labelStyle = ' ';
if (is_array($attributes) === true) { if (is_array($attributes) === true) {
$tmpAttributes = []; $tmpAttributes = [];
@ -4230,6 +4261,10 @@ function html_print_checkbox_extended(
$labelClass .= ' '.$value; $labelClass .= ' '.$value;
break; break;
case 'label_style':
$labelStyle .= 'style="'.$value.'"';
break;
default: default:
$tmpAttributes[] = $key.'="'.$value.'"'; $tmpAttributes[] = $key.'="'.$value.'"';
break; break;
@ -4241,7 +4276,7 @@ function html_print_checkbox_extended(
$id_aux = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : '')); $id_aux = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
$output = '<label class="'.$labelClass.'">'; $output = '<label class="'.$labelClass.'"'.$labelStyle.'>';
$output .= '<input class="'.$inputClass.'" name="'.$name.'" type="checkbox" value="'.$value.'" '.($checked ? 'checked="checked"' : ''); $output .= '<input class="'.$inputClass.'" name="'.$name.'" type="checkbox" value="'.$value.'" '.($checked ? 'checked="checked"' : '');
$output .= (empty($id) === true) ? ' id="checkbox-'.$id_aux.'"' : ' id="'.$id.'"'; $output .= (empty($id) === true) ? ' id="checkbox-'.$id_aux.'"' : ' id="'.$id.'"';
$output .= (empty($script) === false) ? ' onclick="'.$script.'"' : ''; $output .= (empty($script) === false) ? ' onclick="'.$script.'"' : '';
@ -6629,34 +6664,32 @@ function html_print_extended_select_for_downtime_cron(
$disabled, $disabled,
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a style="margin: 7px" href="javascript:">'.html_print_image(
'images/edit.svg', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler main_menu_icon invert_filter', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px;', // 'style' => 'margin: 7px;',
] ]
).'</a>'; ).'</a>';
echo '</div>'; echo '</div>';
$help_tooltip = ($text_help !== '') ? ui_print_help_tip(__($text_help), true) : '';
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_line">'; echo '<div id="'.$uniq_name.'_manual" class="w100p inline_line">';
html_print_input_text($uniq_name.'_text', $selected, '', 20); html_print_input_text($uniq_name.'_text', $selected, '', 20, 20, false, false, false, '', 'w100p');
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.$help_tooltip.'&nbsp'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/logs@svg.svg', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler main_menu_icon invert_filter', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;', 'style' => 'margin: 7px;',
] ]
).'</a>'; ).'</a>';
echo ($text_help !== '') ? ui_print_help_tip(__($text_help), true, '', false, 'margin: 13px 0 0 5px;') : '';
echo '</div>'; echo '</div>';
$select_init_func = (is_numeric($selected) === true || $selected === '*') ? 'post_process_select_init' : 'post_process_select_init_inv'; $select_init_func = (is_numeric($selected) === true || $selected === '*') ? 'post_process_select_init' : 'post_process_select_init_inv';
@ -6666,7 +6699,7 @@ function html_print_extended_select_for_downtime_cron(
".$select_init_func."('$uniq_name','$selected'); ".$select_init_func."('$uniq_name','$selected');
post_process_select_events_unit('$uniq_name','$selected'); post_process_select_events_unit('$uniq_name','$selected');
}); });
</script>"; </script>";
$returnString = ob_get_clean(); $returnString = ob_get_clean();

View File

@ -2508,6 +2508,10 @@ function ui_print_help_tip(
$style='', $style='',
$blink=false $blink=false
) { ) {
if (empty($img) === true) {
$img = 'images/info@svg.svg';
}
$output = '<a href="javascript:" class="tip" style="'.$style.'" >'; $output = '<a href="javascript:" class="tip" style="'.$style.'" >';
$output .= html_print_image( $output .= html_print_image(
$img, $img,

View File

@ -11542,3 +11542,12 @@ ul.tag-editor {
.max-width-100p { .max-width-100p {
max-width: 100% !important; max-width: 100% !important;
} }
/* Datatables overrides */
.ui-dialog .ui-dialog-titlebar-close {
right: 1em !important;
}
.ui-dialog .ui-dialog-titlebar {
display: block !important;
}

View File

@ -530,6 +530,7 @@ table.filter-table-adv td {
vertical-align: top; vertical-align: top;
} }
div.filter-table-adv-manual > div,
table.filter-table-adv td > div { table.filter-table-adv td > div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -537,6 +538,7 @@ table.filter-table-adv td > div {
align-items: normal; align-items: normal;
} }
div.filter-table-adv-manual > div label,
table.filter-table-adv td > div label { table.filter-table-adv td > div label {
color: #161628; color: #161628;
font-size: 13px; font-size: 13px;