Exemple #1
0
 public function getPage($data)
 {
     if (isset($data->loadType)) {
         $page = Application_Model_Page::getById($data->idPage);
         if ($data->loadType == self::TYPE_NEXT_PAGE) {
             return $this->_getNextPage($page);
         } else {
             return $this->_getPreviousPage($page);
         }
     } else {
         return $this->_pageRepository->getLastPage();
     }
 }
 public function editAction()
 {
     parent::editAction();
     $this->_entity = Application_Model_Page::getById($this->_getParam('id'));
     if ($this->getRequest()->isPost()) {
         $data = (object) $this->getRequest()->getPost();
         try {
             $this->_setData($data);
             $this->_entity->validate();
             $this->_entity->save();
             $this->__goBack();
         } catch (Exception $e) {
             $this->view->showMessage($e);
         }
     } else {
         $this->__postContentFields();
         $_POST['url'] = $this->_entity->getRoute()->getRoutingUrl()->getInitialUrl();
         $this->view->action = $this->_entity->getRoute()->getAction();
     }
 }