Пример #1
0
 public function pageAction()
 {
     $this->view->menu_page = 'selected';
     $this->view->item = $this->_getParam('item', 'new');
     $this->view->lang = $this->_getParam('lang', 'ua');
     $this->view->pages = Model_Page::getAll();
     $this->view->galleries = Model_Gallery::getAll('image');
     $this->view->videos = Model_Gallery::getAll('video');
     $this->view->audios = Model_Gallery::getAll('audio');
     $this->view->actionname = '/admin/savepage';
     $this->view->idname = 'idpage';
     //перевіряємо на видалення
     $delete = $this->_getParam('delete', false);
     if ($delete && Zend_Validate::is($this->view->item, 'Digits')) {
         Model_Page::deletepage($this->view->item);
         $this->_redirect('/admin/page');
     }
     // якщо треба отримати дані за id сторінки
     if (Zend_Validate::is($this->view->item, 'Digits')) {
         $this->view->data = Model_Page::getById($this->view->item, $this->view->lang);
     } else {
         $this->view->data = Model_Page::getById(NULL);
     }
 }