Source
84
84
return $result;
85
85
}
86
86
87
87
/**
88
88
* Get ready for url params.
89
89
*
90
90
* @param mixed $param Param name or array with data depends from $getFromRequest.
91
91
* @param bool $getFromRequest Detect data source - input array or $_REQUEST variable.
92
92
* @param string|null $name If $_REQUEST variable is used this variable not used.
93
93
*/
94
-
function url_param($param, bool $getFromRequest = true, string $name = null): string {
94
+
function url_param($param, bool $getFromRequest = true, ?string $name = null): string {
95
95
if (is_array($param)) {
96
96
if ($getFromRequest) {
97
97
fatal_error(_('URL parameter cannot be array.'));
98
98
}
99
99
}
100
100
elseif ($name === null) {
101
101
if (!$getFromRequest) {
102
102
fatal_error(_('URL parameter name is empty.'));
103
103
}
104
104
598
598
}
599
599
600
600
/**
601
601
* Renders a form footer with the given buttons.
602
602
*
603
603
* @param CButtonInterface|null $main_button Main button that will be displayed on the left.
604
604
* @param CButtonInterface[] $other_buttons
605
605
*
606
606
* @throws InvalidArgumentException if an element of $other_buttons contain something other than CButtonInterface
607
607
*/
608
-
function makeFormFooter(CButtonInterface $main_button = null, array $other_buttons = []): CList {
608
+
function makeFormFooter(?CButtonInterface $main_button = null, array $other_buttons = []): CList {
609
609
foreach ($other_buttons as $other_button) {
610
610
$other_button->addClass(ZBX_STYLE_BTN_ALT);
611
611
}
612
612
613
613
if ($main_button !== null) {
614
614
array_unshift($other_buttons, $main_button);
615
615
}
616
616
617
617
return (new CList())
618
618
->addClass(ZBX_STYLE_TABLE_FORMS)