Esempio n. 1
0
 public function renderArticle($url)
 {
     if (!\App\Helper\Helper::isIndexBot()) {
         $this->articleManager->viewForArticleUrl($url, $this->getSession());
     }
     $this->template->serial = $this->articleDat->ref('underSerial');
     if ($this->template->serial) {
         $this->template->articleInSerial = $this->articleManager->getArticlesUnderSerial($this->template->serial->articleOrder);
     }
     $this->template->article = $this->articleDat;
 }
Esempio n. 2
0
 public function handleRate($points)
 {
     if (!$points || !is_numeric($points) || $points > $this->points || $points < $this->from) {
         throw new Nette\Application\BadRequestException();
     }
     if (\App\Helper\Helper::isIndexBot()) {
         return;
     }
     if ($this->ratingManager->addVote($points)) {
         $this->redrawAjax('Hodnocení přidáno');
     }
 }