mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Added Go Back input function
This commit is contained in:
parent
f48d3a9849
commit
d0622e7a3b
@ -6026,3 +6026,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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user