Exemplo n.º 1
0
 public function actionUpdateSection($id = '', $sub = 'section')
 {
     if (!$this->user->isAllowed(self::RESSEC, 'moderate')) {
         throw new \Nette\Application\ForbiddenRequestException();
     }
     if ($sub == 'section') {
         $this->sectionDat = $this->articleManager->getSection($id);
     } elseif ($sub == 'sub') {
         $this->sectionDat = $this->articleManager->getSection($id, 'subSectionDat');
     } elseif ($sub == 'ser') {
         $this->sectionDat = $this->articleManager->getSection($id, 'serialDat');
     }
     if (!$this->sectionDat) {
         throw new Nette\Application\BadRequestException();
     }
     $this->template->section = $this->sectionDat;
 }