mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Fix AddUrlForm::createElements() not returning self
This commit is contained in:
parent
ae9e5a40cc
commit
7215e273f6
@ -27,15 +27,13 @@ class AddUrlForm extends Form
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData)
|
public function createElements(array $formData)
|
||||||
{
|
{
|
||||||
$elements = array(
|
$this->addElement(
|
||||||
$this->createElement(
|
'text',
|
||||||
'text',
|
'url',
|
||||||
'url',
|
array(
|
||||||
array(
|
'required' => true,
|
||||||
'required' => true,
|
'label' => t('Url'),
|
||||||
'label' => t('Url'),
|
'helptext' => t('The url being loaded in the dashlet')
|
||||||
'helptext' => t('The url being loaded in the dashlet')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -44,7 +42,7 @@ class AddUrlForm extends Form
|
|||||||
((isset($formData['create_new_pane']) && $formData['create_new_pane'] != false) &&
|
((isset($formData['create_new_pane']) && $formData['create_new_pane'] != false) &&
|
||||||
(false === isset($formData['use_existing_dashboard']) || $formData['use_existing_dashboard'] != true))
|
(false === isset($formData['use_existing_dashboard']) || $formData['use_existing_dashboard'] != true))
|
||||||
) {
|
) {
|
||||||
$elements[] = $this->createElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
'pane',
|
'pane',
|
||||||
array(
|
array(
|
||||||
@ -53,7 +51,7 @@ class AddUrlForm extends Form
|
|||||||
'style' => 'display: inline-block'
|
'style' => 'display: inline-block'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$elements[] = $this->createElement( // Prevent the button from being displayed again on validation errors
|
$this->addElement( // Prevent the button from being displayed again on validation errors
|
||||||
'hidden',
|
'hidden',
|
||||||
'create_new_pane',
|
'create_new_pane',
|
||||||
array(
|
array(
|
||||||
@ -61,7 +59,7 @@ class AddUrlForm extends Form
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (false === empty($paneSelectionValues)) {
|
if (false === empty($paneSelectionValues)) {
|
||||||
$elements[] = $this->createElement(
|
$this->addElement(
|
||||||
'submit',
|
'submit',
|
||||||
'use_existing_dashboard',
|
'use_existing_dashboard',
|
||||||
array(
|
array(
|
||||||
@ -72,7 +70,7 @@ class AddUrlForm extends Form
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$elements[] = $this->createElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
'pane',
|
'pane',
|
||||||
array(
|
array(
|
||||||
@ -82,7 +80,7 @@ class AddUrlForm extends Form
|
|||||||
'multiOptions' => $paneSelectionValues
|
'multiOptions' => $paneSelectionValues
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$elements[] = $this->createElement(
|
$this->addElement(
|
||||||
'submit',
|
'submit',
|
||||||
'create_new_pane',
|
'create_new_pane',
|
||||||
array(
|
array(
|
||||||
@ -93,7 +91,7 @@ class AddUrlForm extends Form
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$elements[] = $this->createElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
'component',
|
'component',
|
||||||
array(
|
array(
|
||||||
@ -102,7 +100,8 @@ class AddUrlForm extends Form
|
|||||||
'helptext' => t('The title for the dashlet')
|
'helptext' => t('The title for the dashlet')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return $elements;
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user