public function actionDefault($section, $subsection) { if (!$this->session->started) { $this->session->start(); } $this->template->editorial = $this->textManager->getText(TextManager::EDITORIAL); $get = $this->getRequest()->parameters; if (isset($get['log']) && $get['log'] == 'in' && !$this->session->started) { $this->template->customFlashMessage = 'Nemáte zapnuté soubory cookies, pro přihlášení musí být povoleny.'; } if (!$subsection && !$section) { $this->paginator = new Paginator(); $this->paginator->setItemCount($this->articleManager->countNewArticleList()); $this->paginator->setItemsPerPage(8); $this->template->articles = $this->articleManager->getNewArticleList($this->paginator); return; } $this->template->setFile(__DIR__ . '/templates/Article/section.latte'); if ($section && !$subsection) { $sectionDat = $this->articleManager->getSectionByUrl($section); if (!$sectionDat) { throw new Nette\Application\BadRequestException(); } $this->template->section = $sectionDat; $this->template->subSections = $this->articleManager->getSubSectionFor($sectionDat->id); $this->template->articles = $this->articleManager->getArticleNotSubsection($sectionDat); $this->template->serials = $this->articleManager->getSerialForSection($sectionDat->id); } if ($subsection) { $subSectionDat = $this->articleManager->getSectionByUrl($subsection, 'subSectionDat'); if (!$subSectionDat) { throw new Nette\Application\BadRequestException(); } $this->template->section = $subSectionDat; $this->template->subSections = null; $this->template->articles = $this->articleManager->getArticleBySubSection($subSectionDat); $this->template->serials = $this->articleManager->getSerialForSubSection($subSectionDat->id); } }
public function actionArticleList() { $itemPerPage = 10; $this->notPublicPaginator = new Paginator(); $this->notPublicPaginator->setItemsPerPage($itemPerPage); $this->notPublicPaginator->setPage($this->notPublicPage); $this->notPublicPaginator->setItemCount($this->articleManager->countNotPublicArticleList()); $this->publicPaginator = new Paginator(); $this->publicPaginator->setItemsPerPage($itemPerPage); $this->publicPaginator->setPage($this->publicPage); $this->publicPaginator->setItemCount($this->articleManager->countNewArticleList()); $this->deletedPaginator = new Paginator(); $this->deletedPaginator->setItemsPerPage($itemPerPage); $this->deletedPaginator->setPage($this->deletedPage); $this->deletedPaginator->setItemCount($this->articleManager->countDeletedArticleList()); }