From 7b5d414c7f07fd277d051917f485bc8eb06c61bd Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 17 Sep 2015 13:46:08 +0200 Subject: [PATCH] Introduce form class MenuItemForm refs #5600 --- application/forms/Navigation/MenuItemForm.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 application/forms/Navigation/MenuItemForm.php diff --git a/application/forms/Navigation/MenuItemForm.php b/application/forms/Navigation/MenuItemForm.php new file mode 100644 index 000000000..9f17495a3 --- /dev/null +++ b/application/forms/Navigation/MenuItemForm.php @@ -0,0 +1,32 @@ +getParent()->listAvailableParents('menu-item'); + $this->addElement( + 'select', + 'parent', + array( + 'allowEmpty' => true, + 'label' => $this->translate('Parent'), + 'description' => $this->translate( + 'The parent menu to assign this menu entry to. Select "None" to make this a main menu entry' + ), + 'multiOptions' => array_merge( + array('' => $this->translate('None', 'No parent for a navigation item')), + empty($availableParents) ? array() : array_combine($availableParents, $availableParents) + ) + ) + ); + + parent::createElements($formData); + } +}