[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" ); 4 lt_include( PLOG_CLASS_PATH."class/view/admin/admineditresourcealbumview.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/view/admin/adminresourceslistview.class.php" ); 6 lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" ); 7 lt_include( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" ); 8 9 /** 10 * \ingroup Action 11 * @private 12 * 13 * Shows information about a resource 14 */ 15 class AdminEditResourceAlbumAction extends AdminAction 16 { 17 18 var $_albumId; 19 20 /** 21 * Constructor. If nothing else, it also has to call the constructor of the parent 22 * class, BlogAction with the same parameters 23 */ 24 function AdminEditResourceAlbumAction( $actionInfo, $request ) 25 { 26 $this->AdminAction( $actionInfo, $request ); 27 28 $this->registerFieldValidator( "albumId", new IntegerValidator()); 29 $view = new AdminResourcesListView( $this->_blogInfo ); 30 $view->setErrorMessage( $this->_locale->tr("error_incorrect_album_id")); 31 $this->setValidationErrorView( $view ); 32 33 $this->requirePermission( "update_album" ); 34 } 35 36 /** 37 * Carries out the specified action 38 */ 39 function perform() 40 { 41 // fetch the albums for this blog 42 $this->_albumId = $this->_request->getValue( "albumId" ); 43 $albums = new GalleryAlbums(); 44 $album = $albums->getAlbum( $this->_albumId, $this->_blogInfo->getId()); 45 46 if( !$album ) { 47 $this->_view = new AdminResourcesListView( $this->_blogInfo ); 48 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_album")); 49 } 50 else { 51 // and put everything into the template 52 $this->_view = new AdminEditResourceAlbumView( $this->_blogInfo ); 53 $this->_view->setValue( "albumName", $album->getName()); 54 $this->_view->setValue( "albumDescription", $album->getDescription()); 55 $this->_view->setValue( "showAlbum", $album->getShowAlbum()); 56 $this->_view->setValue( "parentId", $album->getParentId()); 57 $this->_view->setValue( "albumId", $album->getId()); 58 } 59 60 $this->setCommonData(); 61 62 // better to return true if everything fine 63 return true; 64 } 65 } 66 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |