/** * @see \wcf\system\dashboard\box\IDashboardBox::init() */ public function init(DashboardBox $box, IPage $page) { parent::init($box, $page); $this->pageList = new PageList(); $this->pageList->getConditionBuilder()->add('page.clicks > 0'); $this->pageList->sqlLimit = CMS_DASHBOARD_SIDEBAR_ENTRIES; $this->pageList->sqlOrderBy = 'page.clicks DESC'; $this->pageList->readObjects(); $this->fetched(); }
/** * Returns whether this page has other pages assigned as children * * @return boolean */ public function hasChildren() { $list = new PageList(); $list->getConditionBuilder()->add('page.parentID = (?)', array($this->pageID)); if ($list->countObjects() != 0) { return true; } return false; }