* @see wcf\system\SingletonFactory::init()
*/
protected function init() {
- // set default menu item
- $landingPage = PageMenu::getInstance()->getLandingPage();
- if ($landingPage !== null) {
- PageMenu::getInstance()->setActiveMenuItem($landingPage->menuItem);
-
- // add main breadcrumbs entry
- $this->add(new Breadcrumb(WCF::getLanguage()->get(PAGE_TITLE), $landingPage->getLink()));
- }
+ // add main breadcrumbs entry
+ $this->add(new Breadcrumb(WCF::getLanguage()->get(PAGE_TITLE), PageMenu::getInstance()->getLandingPage()->getLink()));
}
/**
use wcf\system\breadcrumb\Breadcrumb;
use wcf\system\cache\CacheHandler;
use wcf\system\event\EventHandler;
+use wcf\system\exception\SystemException;
use wcf\system\menu\ITreeMenuItem;
use wcf\system\menu\TreeMenu;
use wcf\system\WCF;
* Builds the page menu.
*
* @author Marcel Werk
- * @copyright 2001-2012 WoltLab GmbH
+ * @copyright 2001-2013 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu.page
}
}
}
+
+ if ($this->landingPage === null) {
+ throw new SystemException("Missing landing page");
+ }
+
+ $this->setActiveMenuItem($this->landingPage->menuItem);
}
/**