NewsNewsFeaturesDownloadsDevelopmentSupportForumDocumentsAbout Us

AdminAddResourceAlbumAction 類別 參考文件
[Action]

類別AdminAddResourceAlbumAction的繼承圖:

AdminAction Action Object 全部成員列表

公開方法(Public Methods)

 AdminAddResourceAlbumAction ($actionInfo, $request)
 perform ()

公開屬性

 $_albumName
 $_albumDescription
 $_parentId

詳細描述

Adds a new album

定義在 adminaddresourcealbumaction.class.php 檔案之第 17 行.


建構子與解構子說明文件

AdminAddResourceAlbumAction::AdminAddResourceAlbumAction actionInfo,
request
 

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         }


函式成員說明文件

AdminAddResourceAlbumAction::perform  ) 
 

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::$_albumDescription
 

定義在 adminaddresourcealbumaction.class.php 檔案之第 21 行.

AdminAddResourceAlbumAction::$_albumName
 

定義在 adminaddresourcealbumaction.class.php 檔案之第 20 行.

AdminAddResourceAlbumAction::$_parentId
 

定義在 adminaddresourcealbumaction.class.php 檔案之第 22 行.


此類別(class) 文件是由下列檔案中產生: