Esempio n. 1
0
 public function executeIndex()
 {
     if ($this->hasRequestParameter('faq_id')) {
         $this->setVar('selectedFaq', sfFaqFaqPeer::retrieveByPk($this->getRequestParameter('faq_id')));
         if (!$this->selectedFaq->getsfFaqCategory()->getActivate()) {
             $this->redirect('sfFaq/index');
         }
     }
     if (!isset($this->selectedFaq) && !$this->selectedFaq) {
         if ($this->hasRequestParameter('category_id')) {
             $this->setVar('selectedCategory', sfFaqCategoryPeer::retrieveByPk($this->getRequestParameter('category_id')));
             if (!$this->selectedCategory->getActivate()) {
                 $this->redirect('sfFaq/index');
             }
             $this->defaultQuestionSelection();
         } else {
             $this->defaultSelection();
         }
     } else {
         $this->setVar('selectedCategory', $this->selectedFaq->getsfFaqCategory());
     }
 }