Merge branch 'ent-9044-Mejorar-interfaz-de-herramienta-de-copia-de-configuraciones-remotas' into 'develop'

Added Go Back input function

pandora_enterprise#9044

See merge request artica/pandorafms!4997
This commit is contained in:
Jimmy Olano 2022-07-18 22:35:09 +00:00
commit 8f00e9da6c
1 changed files with 33 additions and 0 deletions

View File

@ -6134,3 +6134,36 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
return $output;
}
/**
* Prints a simple 'Go Back' button.
*
* @param string $url Destination Url.
* @param array $options Options.
* `button_class`: Class for button. 'w100p' by default.
* `title`: Title of the button. 'Go Back' by default.
* `action_class`: Class of icon of button. 'cancel' by default.
* @param boolean $return If true, return a formed HTML element.
*
* @return mixed
*/
function html_print_go_back_button(string $url, array $options=[], bool $return=false)
{
$output = html_print_div(
[
'class' => ($options['button_class'] ?? 'w100p'),
'content' => html_print_button(
($options['title'] ?? __('Go back')),
'go_back',
false,
'window.location.href = \''.$url.'\'',
'class="sub '.($options['action_class'] ?? ' cancel').' right"',
true
),
],
$return
);
return $output;
}