類別AdminAddResourceAlbumAction的繼承圖:

公開方法(Public Methods) | |
| AdminAddResourceAlbumAction ($actionInfo, $request) | |
| perform () | |
公開屬性 | |
| $_albumName | |
| $_albumDescription | |
| $_parentId | |
定義在 adminaddresourcealbumaction.class.php 檔案之第 17 行.
|
||||||||||||
|
Constructor. If nothing else, it also has to call the constructor of the parent class, BlogAction with the same parameters 定義在 adminaddresourcealbumaction.class.php 檔案之第 28 行. 參考 $request, AdminAction::AdminAction(), Action::registerFieldValidator(), 及 Action::setValidationErrorView(). 00029 { 00030 $this->AdminAction( $actionInfo, $request ); 00031 00032 // validation stuff 00033 $this->registerFieldValidator( "albumName", new StringValidator()); 00034 $this->registerFieldValidator( "parentId", new IntegerValidator()); 00035 $this->_form->registerField( "albumDescription" ); 00036 $this->setValidationErrorView( new AdminNewAlbumView( $this->_blogInfo )); 00037 }
|
|
|
Carries out the specified action 依據Action重新實作. 定義在 adminaddresourcealbumaction.class.php 檔案之第 42 行. 參考 $result, $t, false, AdminAction::notifyEvent(), CacheControl::resetBlogCache(), 及 AdminAction::setCommonData(). 00043 { 00044 // fetch our data 00045 $this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" )); 00046 $this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" )); 00047 $this->_parentId = $this->_request->getValue( "parentId" ); 00048 $showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0; 00049 00050 // create the album 00051 $albums = new GalleryAlbums(); 00052 $t = new Timestamp(); 00053 $album = new GalleryAlbum( $this->_blogInfo->getId(), $this->_albumName, 00054 $this->_albumDescription, 00055 GALLERY_RESOURCE_PREVIEW_AVAILABLE, 00056 $this->_parentId, 00057 $t->getTimestamp(), 00058 Array(), 00059 $showAlbum); 00060 00061 $this->notifyEvent( EVENT_PRE_ALBUM_ADD, Array( "album" => &$album )); 00062 // and add it to the database 00063 $result = $albums->addAlbum( $album ); 00064 $this->_view = new AdminResourcesListView( $this->_blogInfo, Array( "albumId" => $this->_parentId )); 00065 if( $result ) { 00066 $this->_view->setSuccessMessage( $this->_locale->pr( "album_added_ok", $album->getName())); 00067 $this->notifyEvent( EVENT_POST_ALBUM_ADD, Array( "album" => &$album )); 00068 // clear the cache if everything went fine 00069 CacheControl::resetBlogCache( $this->_blogInfo->getId(), false ); 00070 } 00071 else { 00072 $this->_view->setErrorMessage( $this->_locale->tr("error_adding_album" ) ); 00073 } 00074 $this->setCommonData(); 00075 00076 // better to return true if everything fine 00077 return true; 00078 }
|
|
|
定義在 adminaddresourcealbumaction.class.php 檔案之第 21 行. |
|
|
定義在 adminaddresourcealbumaction.class.php 檔案之第 20 行. |
|
|
定義在 adminaddresourcealbumaction.class.php 檔案之第 22 行. |