lifetype-1.1.6/class/action/admin/adminaddlinkcategoryaction.class.php
Go to the documentation of this file.00001 <?php
00002
00003 include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
00004 include_once( PLOG_CLASS_PATH."class/dao/mylinkscategories.class.php" );
00005 include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
00006 include_once( PLOG_CLASS_PATH."class/view/admin/adminlinkcategorieslistview.class.php" );
00007 include_once( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
00008
00015 class AdminAddLinkCategoryAction extends AdminAction
00016 {
00017
00018 var $_linkCategoryName;
00019 var $_properties;
00020
00025 function AdminAddLinkCategoryAction( $actionInfo, $request )
00026 {
00027 $this->AdminAction( $actionInfo, $request );
00028
00029
00030 $this->registerFieldValidator( "linkCategoryName", new StringValidator());
00031 $this->setValidationErrorView( new AdminTemplatedView( $this->_blogInfo, "newlinkcategory" ));
00032 }
00033
00034
00038 function perform()
00039 {
00040
00041 $this->_linkCategoryName = Textfilter::filterAllHTML($this->_request->getValue( "linkCategoryName" ));
00042 $mylinksCategories = new MyLinksCategories();
00043 $mylinksCategory = new MyLinksCategory( $this->_linkCategoryName,
00044 $this->_blogInfo->getId(),
00045 0,
00046 $this->_properties );
00047
00048 $this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
00049
00050 if( !$mylinksCategories->addMyLinksCategory( $mylinksCategory, $this->_blogInfo->getId())) {
00051
00052 $this->_view->setErrorMessage( $this->_locale->tr("error_adding_link_category"));
00053 }
00054 else {
00055
00056 CacheControl::resetBlogCache( $this->_blogInfo->getId(), false );
00057 $this->_view->setSuccessMessage( $this->_locale->pr("link_category_added_ok", $mylinksCategory->getName()));
00058 }
00059
00060 $this->setCommonData();
00061
00062 return true;
00063 }
00064 }
00065 ?>