Пример #1
0
 public function delFaqAction()
 {
     if ($this->getRequest()->isSecure()) {
         $faqMapper = new FaqMapper();
         $faqMapper->delete($this->getRequest()->getParam('id'));
         $this->addMessage('deleteSuccess');
     }
     $this->redirect(array('action' => 'index'));
 }
Пример #2
0
 public function showAction()
 {
     $categoryMapper = new CategoryMapper();
     $faqMapper = new FaqMapper();
     $faq = $faqMapper->getFaqById($this->getRequest()->getParam('id'));
     $category = $categoryMapper->getCategoryById($faq->getCatId());
     $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuFaqs'), array('action' => 'index'))->add($category->getTitle(), array('action' => 'index', 'catId' => $category->getId()))->add($faq->getQuestion(), array('action' => 'show', 'id' => $faq->getId()));
     $this->getView()->set('faq', $faqMapper->getFaqById($this->getRequest()->getParam('id')));
 }
Пример #3
0
 public function delCatAction()
 {
     $faqMapper = new FaqMapper();
     $countFaqs = count($faqMapper->getFaqs(array('cat_id' => $this->getRequest()->getParam('id'))));
     if ($countFaqs == 0) {
         if ($this->getRequest()->isSecure()) {
             $categoryMapper = new CategoryMapper();
             $categoryMapper->delete($this->getRequest()->getParam('id'));
             $this->addMessage('deleteSuccess');
             $this->redirect(array('action' => 'index'));
         }
     } else {
         $this->addMessage('deleteFailed', 'danger');
         $this->redirect(array('action' => 'index'));
     }
 }