Example #1
0
 public function indexAction()
 {
     $IDAlbum = $this->_getParam('album');
     if (!isset($IDAlbum)) {
         $this->_helper->redirector('index', 'gallery');
     }
     $this->view->album = Zwe_Model_Album::getAlbumByID($IDAlbum);
     $this->view->uploadForm = new Admin_Form_Photo_Upload();
     $this->view->uploadForm->getElement('album')->setValue($IDAlbum);
     $this->view->deleteForm = new Admin_Form_Photo_Delete();
     $this->view->deleteForm->getElement('delete')->addMultiOptions($this->view->album->Photos);
 }
Example #2
0
 public function editAction()
 {
     $this->view->form = new Admin_Form_Album();
     $this->view->form->addID();
     if ($this->getRequest()->isPost()) {
         if ($this->view->form->isValid($this->getRequest()->getPost())) {
             Zwe_Model_Album::editAlbum($this->view->form->getValue('id'), $this->view->form->getValue('title'), $this->view->form->getValue('page'), $this->view->form->getValue('description'));
             $this->_helper->redirector('index');
         }
     }
     $Album = Zwe_Model_Album::getAlbumByID((int) $this->_getParam('album'));
     $this->view->form->populate($Album->toForm());
     $this->view->form->getElement('album')->setLabel('Edit the album');
 }