[ 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/adminsiteblogslistview.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/view/admin/admineditsiteblogview.class.php" ); 6 lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" ); 7 lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" ); 8 9 /** 10 * \ingroup Action 11 * @private 12 * 13 * Action that shows a form to change the settings of a blog. 14 */ 15 class AdminEditBlogAction extends AdminAction 16 { 17 18 var $_editBlogId; 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 AdminEditBlogAction( $actionInfo, $request ) 25 { 26 $this->AdminAction( $actionInfo, $request ); 27 28 // data validation 29 $this->registerFieldValidator( "blogId", new IntegerValidator()); 30 $view = new AdminSiteBlogsListView( $this->_blogInfo ); 31 $view->setErrorMessage( $this->_locale->tr("error_incorrect_blog_id" )); 32 $this->setValidationErrorView( $view ); 33 34 $this->requireAdminPermission( "update_site_blog" ); 35 } 36 37 /** 38 * Carries out the specified action 39 */ 40 function perform() 41 { 42 // get the blog and its settings 43 $this->_editBlogId = $this->_request->getValue( "blogId" ); 44 $blogs = new Blogs(); 45 $blogInfo = $blogs->getBlogInfo( $this->_editBlogId); 46 47 if( !$blogInfo ) { 48 $this->_view = new AdminSiteBlogsListView( $this->_blogInfo ); 49 $this->_view->setErrorMessage( $this->_locale->tr("error_incorrect_blog_id" )); 50 $this->setCommonData(); 51 return false; 52 } 53 54 $this->notifyEvent( EVENT_BLOG_LOADED, Array( "blog" => &$blogInfo )); 55 56 // create the view and render the contents 57 $this->_view = new AdminEditSiteBlogView( $this->_blogInfo, $blogInfo ); 58 $this->setCommonData(); 59 60 // better to return true if everything fine 61 return true; 62 } 63 } 64 ?>
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 |
![]() |