From d94ad7737a4dd5979758c4797cd486224c764cb6 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 15 May 2014 18:14:59 +0200 Subject: [PATCH] Use page object types to select page when creating page menu item --- .../files/acp/templates/pageMenuItemAdd.tpl | 41 ++++++++++++++++++- .../acp/form/PageMenuItemAddForm.class.php | 36 +++++++++++++++- .../acp/form/PageMenuItemEditForm.class.php | 6 +++ wcfsetup/install/lang/de.xml | 4 +- wcfsetup/install/lang/en.xml | 4 +- 5 files changed, 86 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl b/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl index 2b427ee997..3b0665713d 100644 --- a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl @@ -9,6 +9,8 @@ var $menuItemControllerContainer = $('#menuItemControllerContainer'); var $menuItemLinkContainer = $('#menuItemLinkContainer'); var $menuItemParametersContainer = $('#menuItemParametersContainer'); + var $menuItemPageContainer = $('#menuItemPageContainer'); + var $menuItemPage = $('#menuItemPage'); function handleMenuPosition() { if ($menuPosition.val() === 'header') { @@ -21,22 +23,37 @@ function handleIsInternalLink() { if ($isInternalLink.is(':checked')) { + $menuItemPageContainer.show(); $menuItemControllerContainer.show(); $menuItemParametersContainer.show(); $menuItemLinkContainer.hide(); } else { + $menuItemPageContainer.hide(); $menuItemControllerContainer.hide(); $menuItemParametersContainer.hide(); $menuItemLinkContainer.show(); } } + function handleMenuPage() { + if ($menuItemPage.val() != '0') { + $menuItemControllerContainer.addClass('disabled'); + $menuItemControllerContainer.find('input').disable(); + } + else { + $menuItemControllerContainer.removeClass('disabled'); + $menuItemControllerContainer.find('input').enable(); + } + } + $menuPosition.change(handleMenuPosition); $('input[name=isInternalLink]').change(handleIsInternalLink); + $menuItemPage.change(handleMenuPage); handleMenuPosition(); handleIsInternalLink(); + handleMenuPage(); }); //]]> @@ -138,10 +155,32 @@ + +