From 3f70351239275930943b565302457184bfc6196b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 21 Sep 2015 15:26:56 +0200 Subject: [PATCH] MenuItemForm: Only allow to select _blank and _main as url target refs #5600 --- application/forms/Navigation/MenuItemForm.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/forms/Navigation/MenuItemForm.php b/application/forms/Navigation/MenuItemForm.php index 924d313a1..583ae4753 100644 --- a/application/forms/Navigation/MenuItemForm.php +++ b/application/forms/Navigation/MenuItemForm.php @@ -16,6 +16,11 @@ class MenuItemForm extends NavigationItemForm public function createElements(array $formData) { parent::createElements($formData); + + // Remove _self and _next as for menu entries only _main is valid + $this->getElement('target')->removeMultiOption('_self'); + $this->getElement('target')->removeMultiOption('_next'); + $parentElement = $this->getParent()->getElement('parent'); if ($parentElement !== null) { $parentElement->setDescription($this->translate(