Adapted views

This commit is contained in:
jose.gonzalez@pandorafms.com 2022-10-24 19:55:22 +02:00
parent 3634aab807
commit 00de0faac3
8 changed files with 71 additions and 51 deletions

View File

@ -285,8 +285,8 @@ function mainModuleGroups()
'srcbutton',
false,
[
'icon' => 'search',
'secondary' => true,
'icon' => 'search',
'mode' => 'secondary',
]
);
echo '</form>';

View File

@ -967,26 +967,34 @@ echo '</span>';
if ($id_agente) {
echo '<div class="action-buttons">';
html_print_submit_button(
$submitButton = html_print_submit_button(
__('Update'),
'updbutton',
false,
'class="sub upd"'
[ 'icon' => 'update'],
true
);
html_print_input_hidden('update_agent', 1);
html_print_input_hidden('id_agente', $id_agente);
$submitButton .= html_print_input_hidden('update_agent', 1);
$submitButton .= html_print_input_hidden('id_agente', $id_agente);
} else {
html_print_submit_button(
$submitButton = html_print_submit_button(
__('Create'),
'crtbutton',
false,
'class="sub wand"'
[ 'icon' => 'wand'],
true
);
html_print_input_hidden('create_agent', 1);
$submitButton .= html_print_input_hidden('create_agent', 1);
}
echo '</div></form>';
html_print_div(
[
'class' => 'action-buttons',
'content' => $submitButton,
]
);
echo '</form>';
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');

View File

@ -374,8 +374,8 @@ html_print_submit_button(
'srcbutton',
false,
[
'icon' => 'search',
'secondary' => true,
'icon' => 'search',
'mode' => 'mini',
]
);
echo '</form>';
@ -955,19 +955,23 @@ if ($agents !== false) {
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
// Create agent button.
echo '<div class="action-buttons">';
echo '<form method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
html_print_submit_button(
__('Create agent'),
'crt-2',
false,
html_print_div(
[
'icon' => 'search',
'secondary' => true,
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Create agent'),
'crt-2',
false,
[
'icon' => 'cog',
'mode' => 'secondary',
],
true
),
]
);
echo '</form>';
echo '</div>';
}
echo '</td></tr></table>';

View File

@ -231,8 +231,8 @@ if (($policy_page) || (isset($agent))) {
'updbutton',
false,
[
'icon' => 'next',
'secondary' => true,
'icon' => 'next',
'mode' => 'secondary',
]
);
echo '</td>';

View File

@ -675,10 +675,10 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) {
html_print_input_hidden('update', 1);
html_print_input_hidden('id', $id);
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
html_print_submit_button(__('Update'), 'crt', false, ['icon' => 'update']);
} else {
html_print_input_hidden('create', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand']);
}
echo '</div>';

View File

@ -553,16 +553,13 @@ if ($load_filter_modal) {
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$table->class = 'databox';
if (is_metaconsole()) {
$filter_id_width = '200px';
if (is_metaconsole() === true) {
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters';
}
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$filter_id_width = '200px';
if (is_metaconsole()) {
$filter_id_width = '150px';
}
@ -587,7 +584,10 @@ if ($load_filter_modal) {
__('Load filter'),
'load_filter',
false,
'class="sub upd"',
[
'icon' => 'update',
'mode' => 'secondary',
],
true
);
$data[1] .= html_print_input_hidden('load_filter', 1, true);
@ -726,14 +726,14 @@ if ($save_filter_modal) {
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox';
if (is_metaconsole()) {
if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$table->styleTable = 'font-weight: bold; text-align:left;';
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
$table->style[0] = 'width: 50%; width:50%;';
}
@ -824,15 +824,23 @@ if ($save_filter_modal) {
$table->rowclass[] = '';
html_print_table($table);
echo '<div>';
echo html_print_submit_button(
__('Save filter'),
'save_filter',
false,
'class="sub upd float-right" onclick="save_new_filter();"',
true
);
echo '</div>';
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Save filter'),
'save_filter',
false,
[
'icon' => 'update',
'mode' => 'secondary',
'onClick' => 'save_new_filter();',
],
true
),
]
);
} else {
include 'general/noaccess.php';
}

View File

@ -998,16 +998,16 @@ class ModuleTemplates extends HTML
{
global $config;
$createNewTemplate = ($this->id_np == 0) ? true : false;
$createNewTemplate = ((int) $this->id_np === 0);
if ($createNewTemplate) {
if ($createNewTemplate === true) {
// Assignation for submit button.
$formButtonClass = 'sub wand';
$formButtonClass = 'wand';
$formAction = 'create';
$formButtonLabel = __('Create');
} else {
// Assignation for submit button.
$formButtonClass = 'sub upd';
$formButtonClass = 'update';
$formAction = 'update';
$formButtonLabel = __('Update');
}
@ -1099,7 +1099,7 @@ class ModuleTemplates extends HTML
'name' => 'action_button',
'label' => $formButtonLabel,
'type' => 'submit',
'attributes' => 'class="float-right '.$formButtonClass.'"',
'attributes' => [ 'icon' => $formButtonClass ],
'return' => true,
],
];
@ -1110,7 +1110,7 @@ class ModuleTemplates extends HTML
'name' => 'add_components_button',
'label' => __('Add components'),
'type' => 'button',
'attributes' => 'class="float-right sub cog"',
'attributes' => [ 'icon' => 'cog' ],
'script' => 'showAddComponent();',
'return' => true,
],

View File

@ -292,8 +292,8 @@ html_print_submit_button(
'srcbutton',
false,
[
'icon' => 'search',
'secondary' => true,
'icon' => 'search',
'mode' => 'secondary',
]
);