コード例 #1
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // categories
     $categoryTree = new NewsCategoryNodeTree($this->objectTypeName);
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // stats
     $this->stats = NewsStatsCacheBuilder::getInstance()->getData();
     $this->stats['categories'] = count(CategoryHandler::getInstance()->getCategories($this->objectTypeName));
     $this->stats['comments'] = count(CommentHandler::getInstance()->getObjectType('de.incendium.cms.news.comment'));
     // users online list
     if (MODULE_USERS_ONLINE && CMS_NEWS_ENABLE_USERS_ONLINE_LIST) {
         $this->usersOnlineList = new UsersOnlineList();
         $this->usersOnlineList->readStats();
         $this->usersOnlineList->getConditionBuilder()->add('session.userID IS NOT NULL');
         $this->usersOnlineList->readObjects();
     }
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms'))));
     if ($this->category !== null) {
         foreach ($this->category->getParentCategories() as $parentCategory) {
             WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb());
         }
     }
 }
 /**
  * @see	\wcf\system\event\IEventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     WCF::getTPL()->assign(array('newsStatsDashboardBox' => NewsStatsCacheBuilder::getInstance()->getData()));
 }