Ejemplo n.º 1
0
 public function createAction()
 {
     $this->setViewChange('form');
     if ($this->getRequest()->isPost()) {
         Model_Pages::createPage($this->getRequest()->getParams());
         $this->session->set('successfu_edite', true);
         $url = '';
         if ($this->getRequest()->getQuery('sub_of')) {
             $url = '?sub_of=' . $this->getRequest()->getQuery('sub_of');
         }
         $this->redirect($this->getRequest()->getBaseUrl() . $this->getRequest()->getModule() . '/pages/' . $url);
     }
     $this->getPageForm();
 }
Ejemplo n.º 2
0
 public function createAction()
 {
     if (!WM_Users::allow('create', $this->getRequest()->getController())) {
         $this->forward('error', 'noPermission');
     }
     $this->setViewChange('form_pages');
     if ($this->getRequest()->isPost()) {
         Model_Pages::createPage($this->getRequest()->getParams());
         $this->session->set('successfu_edite', true);
         $this->redirect($this->getRequest()->getBaseUrl() . $this->getRequest()->getModule() . '/pages/' . ($this->getRequest()->getQuery('parent_id') ? '?parent_id=' . $this->getRequest()->getQuery('parent_id') : ''));
     }
     if (JO_Session::get('come_from_index') === true) {
         $temporary_images = JO_Session::get('temporary_images');
         if ($temporary_images) {
             foreach ($temporary_images as $key => $image) {
                 $mi = new Helper_Images();
                 $mi->deleteImages($image['image']);
             }
         }
         JO_Session::clear('come_from_index');
         JO_Session::clear('temporary_images');
     }
     $this->getPageForm();
 }