From 7bbc452daea5a6cd01494d4dec36b1602631fb62 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 1 May 2013 19:36:16 +0200 Subject: [PATCH] Fixed issues in page menu administration --- .../files/acp/templates/pageMenuItemAdd.tpl | 16 ++++++++-------- .../lib/acp/form/PageMenuItemEditForm.class.php | 8 ++++++++ .../lib/acp/page/PageMenuItemListPage.class.php | 4 +++- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl b/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl index 4a8f040419..4750e11f95 100644 --- a/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageMenuItemAdd.tpl @@ -60,8 +60,8 @@ -
-
+ +
{lang}wcf.acp.pageMenu.data{/lang} @@ -194,11 +194,11 @@
{event name='fields'} - -
- -
- -
+
+ +
+ +
+ {include file='footer'} diff --git a/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php b/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php index eb3c43a1a4..ed8317061c 100644 --- a/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageMenuItemEditForm.class.php @@ -109,6 +109,14 @@ class PageMenuItemEditForm extends PageMenuItemAddForm { ))); $this->objectAction->executeAction(); + // update children + if ($this->menuItem->menuPosition == 'header' && $this->menuPosition != 'header') { + $sql = "UPDATE wcf".WCF_N."_page_menu_item + SET parentMenuItem = '' + WHERE parentMenuItem = ?"; + $statement = WCF::getDB()->prepareStatement($sql); + $statement->execute(array($this->menuItem->menuItem)); + } $this->saved(); WCF::getTPL()->assign('success', true); diff --git a/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php b/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php index d92df71cb1..7aae2e95ae 100644 --- a/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PageMenuItemListPage.class.php @@ -59,7 +59,9 @@ class PageMenuItemListPage extends AbstractPage { } else { if ($menuItem->parentMenuItem) { - $this->headerItems[$menuItem->parentMenuItem]->addChild($menuItem); + if (isset($this->headerItems[$menuItem->parentMenuItem])) { + $this->headerItems[$menuItem->parentMenuItem]->addChild($menuItem); + } } else { $this->headerItems[$menuItem->menuItem] = new ViewablePageMenuItem($menuItem); -- 2.20.1