/** * Carries out the specified action */ function perform() { // check that we have at least one album where to put our pictures $albums = new GalleryAlbums(); if ($albums->getNumUserAlbums($this->_blogInfo->getId()) == 0) { $this->_view = new AdminNewAlbumView($this->_blogInfo); $this->_view->setErrorMessage($this->_locale->tr("error_must_create_album_first")); $this->setCommonData(); return false; } // if all's fine, continue... $this->_view = new AdminNewResourceView($this->_blogInfo); $this->setCommonData(); $this->_view->setValue("albums", $blogAlbums); // better to return true if everything fine return true; }