Opening external links in a new window is already covered by a global option, therefore no custom handling is required.
<nav id="mainMenu" class="mainMenu">
<ul>
{foreach from=$__wcf->getPageMenu()->getMenuItems('header') item=menuItem}
- <li{if $__wcf->getPageMenu()->getActiveMenuItem() == $menuItem->menuItem} class="active"{/if}><a href="{$menuItem->getProcessor()->getLink()}"{if $menuItem->newWindow} target="_blank"{/if}>{lang}{$menuItem->menuItem}{/lang}{if $menuItem->getProcessor()->getNotifications()} <span class="badge badgeUpdate">{#$menuItem->getProcessor()->getNotifications()}</span>{/if}</a></li>
+ <li{if $__wcf->getPageMenu()->getActiveMenuItem() == $menuItem->menuItem} class="active"{/if}><a href="{$menuItem->getProcessor()->getLink()}">{lang}{$menuItem->menuItem}{/lang}{if $menuItem->getProcessor()->getNotifications()} <span class="badge badgeUpdate">{#$menuItem->getProcessor()->getNotifications()}</span>{/if}</a></li>
{/foreach}
</ul>
</nav>
{if $__wcf->getPageMenu()->getMenuItems($menuItem->menuItem)|count > 0 && $__wcf->getPageMenu()->getActiveMenuItem() == $menuItem->menuItem}
<ul class="navigationMenuItems">
{foreach from=$__wcf->getPageMenu()->getMenuItems($menuItem->menuItem) item=subMenuItem}
- <li><a href="{$subMenuItem->getProcessor()->getLink()}"{if $menuItem->newWindow} target="_blank"{/if}><span>{lang}{$subMenuItem->menuItem}{/lang}</span></a>{if $subMenuItem->getProcessor()->getNotifications()} <span class="badge badgeUpdate">{#$subMenuItem->getProcessor()->getNotifications()}</span>{/if}</li>
+ <li><a href="{$subMenuItem->getProcessor()->getLink()}"><span>{lang}{$subMenuItem->menuItem}{/lang}</span></a>{if $subMenuItem->getProcessor()->getNotifications()} <span class="badge badgeUpdate">{#$subMenuItem->getProcessor()->getNotifications()}</span>{/if}</li>
{/foreach}
</ul>
{/if}
{include file='multipleLanguageInputJavascript' elementIdentifier='menuItemLink' forceSelection=false}
</dd>
</dl>
-
- <dl>
- <dd>
- <label><input type="checkbox" name="newWindow" id="newWindow" value="1"{if $newWindow} checked="checked"{/if} /> <span>{lang}wcf.acp.pageMenu.newWindow{/lang}</span></label>
- </dd>
- </dl>
</fieldset>
<fieldset>
*/
public $neededPermissions = array('admin.display.canManagePageMenu');
- /**
- * open link in new window
- * @var boolean
- */
- public $newWindow = false;
-
/**
* page menu item name
* @var string
if (isset($_POST['isLandingPage'])) $this->isLandingPage = true;
if (isset($_POST['menuItemController'])) $this->menuItemController = StringUtil::trim($_POST['menuItemController']);
if (isset($_POST['menuPosition'])) $this->menuPosition = StringUtil::trim($_POST['menuPosition']);
- if (isset($_POST['newWindow'])) $this->newWindow = true;
if (isset($_POST['parentMenuItem'])) $this->parentMenuItem = StringUtil::trim($_POST['parentMenuItem']);
if (isset($_POST['showOrder'])) $this->showOrder = intval($_POST['showOrder']);
}
'menuItemController' => $this->menuItemController,
'menuItemLink' => $this->menuItemLink,
'menuPosition' => $this->menuPosition,
- 'newWindow' => ($this->newWindow) ? 1 : 0,
'parentMenuItem' => $this->parentMenuItem,
'showOrder' => $this->showOrder
)));
WCF::getTPL()->assign('success', true);
// reset variables
- $this->isDisabled = $this->isInternalLink = $this->isLandingPage = $this->newWindow = false;
+ $this->isDisabled = $this->isInternalLink = $this->isLandingPage = false;
$this->menuPosition = 'header';
$this->menuItemController = $this->menuItemLink = $this->pageMenuItem = $this->parentMenuItem = '';
$this->showOrder = 0;
'menuItemController' => $this->menuItemController,
'menuItemLink' => $this->menuItemLink,
'menuPosition' => $this->menuPosition,
- 'newWindow' => $this->newWindow,
'pageMenuItem' => $this->pageMenuItem,
'parentMenuItem' => $this->parentMenuItem,
'showOrder' => $this->showOrder
$this->menuItemController = $this->menuItem->menuItemController;
$this->menuItemLink = $this->menuItem->menuItemLink;
$this->menuPosition = $this->menuItem->menuPosition;
- $this->newWindow = ($this->menuItem->newWindow) ? true : false;
$this->pageMenuItem = $this->menuItem->menuItem;
$this->parentMenuItem = $this->menuItem->parentMenuItem;
$this->showOrder = $this->menuItem->showOrder;
'isLandingPage' => ($this->isLandingPage) ? 1 : 0,
'menuItemController' => $this->menuItemController,
'menuItemLink' => $this->menuItemLink,
- 'newWindow' => ($this->newWindow) ? 1 : 0,
'parentMenuItem' => ($this->menuItem->menuPosition == 'header' ? $this->parentMenuItem : ''),
'showOrder' => $this->showOrder
)));
<item name="wcf.acp.pageMenu.menuPosition"><![CDATA[Position]]></item>
<item name="wcf.acp.pageMenu.menuPosition.footer"><![CDATA[Fußzeile]]></item>
<item name="wcf.acp.pageMenu.menuPosition.header"><![CDATA[Hauptmenü]]></item>
- <item name="wcf.acp.pageMenu.newWindow"><![CDATA[Link in neuem Fenster öffnen]]></item>
<item name="wcf.acp.pageMenu.pageMenuItem"><![CDATA[Name]]></item>
<item name="wcf.acp.pageMenu.parentMenuItem"><![CDATA[Übergeordneter Menüpunkt]]></item>
<item name="wcf.acp.pageMenu.showOrder"><![CDATA[Reihenfolge]]></item>
isDisabled TINYINT(1) NOT NULL DEFAULT 0,
className VARCHAR(255) NOT NULL DEFAULT '',
isLandingPage TINYINT(1) NOT NULL DEFAULT 0,
- newWindow TINYINT(1) NOT NULL DEFAULT 0,
UNIQUE KEY (packageID, menuItem)
);