/** * Carries out the specified action */ function perform() { $this->_albumId = $this->_request->getValue("albumId"); $this->_parentId = $this->_request->getValue("parentId"); $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue("albumName")); $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue("albumDescription")); $this->_showAlbum = $this->_request->getValue("showAlbum"); if ($this->_showAlbum == "") { $this->_showAlbum = 0; } // fetch the albums for this blog $albums = new GalleryAlbums(); $album = $albums->getAlbum($this->_albumId, $this->_blogInfo->getId()); if (!$album) { $this->_view = new AdminResourcesListView($this->_blogInfo); $this->_blogInfo; $this->_view->setErrorMessage($this->_locale->tr("error_updating_album")); $this->setCommonData(); return false; } // update the fields in the object $album->setName($this->_albumName); $album->setDescription($this->_albumDescription); $album->setParentId($this->_parentId); $album->setShowAlbum($this->_showAlbum); $this->notifyEvent(EVENT_PRE_ALBUM_UPDATE, array("album" => &$album)); // and update the data in the database if (!$albums->updateAlbum($album)) { $this->_view = new AdminResourcesListView($this->_blogInfo); $this->_blogInfo; $this->_view->setErrorMessage($this->_locale->tr("error_updating_album")); $this->setCommonData(); return false; } $this->_view = new AdminResourcesListView($this->_blogInfo); $this->_view->setSuccessMessage($this->_locale->pr("album_updated_ok", $album->getName())); $this->notifyEvent(EVENT_POST_ALBUM_UPDATE, array("album" => &$album)); $this->setCommonData(); // clear the cache CacheControl::resetBlogCache($this->_blogInfo->getId(), false); // better to return true if everything fine return true; }