Esempio n. 1
0
 public function __construct($model_name, $options = array())
 {
     $options['id'] = $model_name;
     parent::__construct($options);
     $this->_modelList = new Modules_Publications_Model_List();
     $this->_modelFields = new Modules_Publications_Model_Fields();
     $this->_rubric = $this->_modelList->getRubricInfo($model_name);
     $this->_addElements();
     if (Zend_Registry::isRegistered('current_route')) {
         $this->setAction(Zend_Registry::get('view')->url(array('route_id' => Zend_Registry::get('current_route')->route_id)));
     }
 }
Esempio n. 2
0
 /**
  * Выводим список маршрутов к которому подключён раздел
  *
  */
 public function routesAction()
 {
     if ($rubric_id = $this->getParam('rubric_id')) {
         $rubricInfo = $this->_modelList->getRubricInfo($rubric_id);
         $this->view->routes = Modules_Router_Model_Router::getInstance()->fetchAll($sql = Modules_Router_Model_Router::getInstance()->select()->setIntegrityCheck(false)->from(array('r' => Modules_Router_Model_Router::getInstance()->info('name')))->join(array('p' => $this->_modelPublications->info('name')), 'p.route_id = r.route_id', array())->group('r.route_id'));
         $this->view->rubric_id = $rubric_id;
         $this->view->publications = $this->_modelPublications->getWithoutRubrics($this->getParam('page', 1));
         $this->view->paginator = $this->view->publications;
     }
 }
Esempio n. 3
0
 public function init()
 {
     $this->_modelList = new Modules_Publications_Model_List();
     $this->_modelFields = new Modules_Publications_Model_Fields();
     $this->_model = new Modules_Publications_Model_Table($this->_name);
     /* Устанавливаем рубрику к которой привязаны публикации */
     $this->_routeId = Zend_Registry::get('RouteCurrentId');
     if ($this->getParam('route_id')) {
         $this->_routeId = $this->getParam('route_id');
     }
     if ($this->getParam('skip_route')) {
         $this->_routeId = null;
     }
     $this->view->route_id = $this->_routeId;
     $this->_model->setRouteId($this->_routeId);
     /* Находим текущий тип публикаций */
     $this->_currentPublicationType = $this->_modelList->getRubricInfo($this->_name);
     if ($this->_currentPublicationType) {
         $this->view->pub_rubric_id = $this->_currentPublicationType->rubric_id;
     } else {
         throw new Exception('Тип публикации "' . $this->_name . '" не найден');
     }
 }