</nav>
</div>
-<div class="container containerPadding marginTop">
- <form method="post" action="{if $action == 'add'}{link controller='PageMenuItemAdd'}{/link}{else}{link controller='PageMenuItemEdit' id=$menuItem->menuItemID}{/link}{/if}">
+<form method="post" action="{if $action == 'add'}{link controller='PageMenuItemAdd'}{/link}{else}{link controller='PageMenuItemEdit' id=$menuItem->menuItemID}{/link}{/if}">
+ <div class="container containerPadding marginTop">
<fieldset>
<legend>{lang}wcf.acp.pageMenu.data{/lang}</legend>
</fieldset>
{event name='fields'}
-
- <div class="formSubmit">
- <input type="submit" value="{lang}wcf.global.button.submit{/lang}" />
- </div>
- </form>
-</div>
+ </div>
+
+ <div class="formSubmit">
+ <input type="submit" value="{lang}wcf.global.button.submit{/lang}" />
+ </div>
+</form>
{include file='footer'}
)));
$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);
}
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);