Exemplo n.º 1
0
 /**
  * Список тестов (главная страница)
  * @return void
  */
 public function indexAction()
 {
     if ($this->_authorize('test', 'view')) {
         $objFilterForm = new Form_Test_Filter();
         $objCategories = new Categories();
         $arrCategory = $objCategories->getCategoryList();
         $objFilterForm->setFilterSelectOptions($arrCategory);
         if ($this->getRequest()->isPost()) {
             $arrParams = $this->_request->getPost();
             $categoryId = (int) $arrParams['categoryId'];
             $strTestFilter = !empty($arrParams['strTestFilter']) ? strip_tags(trim($arrParams['strTestFilter'])) : null;
             $objFilterForm->populate($arrParams);
         } else {
             $categoryId = -1;
             $strTestFilter = null;
         }
         $objTests = new Tests();
         $arrTest = $objTests->getTestListByCategoryId($categoryId, $strTestFilter);
         $this->view->arrTest = $arrTest;
         $this->view->objFilterForm = $objFilterForm;
     }
 }