/** * Edit album */ public function editalbumAction() { $request = $this->getRequest(); $Albums = new Application_Model_Albums(); $album_form = new Application_Form_EditAlbum(); $this->view->album_form = $album_form; $total_count = $Albums->getAlbumsCount($this->profile->id); $album_id = $request->getParam('id'); $this->prepareProfile($this->profile); $this->prepareImagesAlbumsCount(); $album = $Albums->getAlbum($album_id); $this->view->active_item = $album['name']; if ($request->isPost() && $album_form->isValid($_POST)) { $album_name = $album_form->getValue('album_name'); $album_description = $album_form->getValue('description'); $result = $Albums->updateAlbum($album_id, $album_name, $album_description); if ($result) { Application_Plugin_Alerts::success($this->view->translate('Album updated')); } $this->redirect('profiles/editalbum/id/' . $album_id); } }