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', 'srcbutton',
false, false,
[ [
'icon' => 'search', 'icon' => 'search',
'secondary' => true, 'mode' => 'secondary',
] ]
); );
echo '</form>'; echo '</form>';

View File

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

View File

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

View File

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

View File

@ -675,10 +675,10 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) { if ($id) {
html_print_input_hidden('update', 1); html_print_input_hidden('update', 1);
html_print_input_hidden('id', $id); 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 { } else {
html_print_input_hidden('create', 1); 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>'; echo '</div>';

View File

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

View File

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

View File

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