[ 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/admintemplatedview.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/view/admin/adminpermissionslistview.class.php" ); 6 lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" ); 7 lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" ); 8 9 /** 10 * \ingroup Action 11 * @private 12 * 13 * Adds a new permission to the database 14 */ 15 class AdminEditPermissionAction extends AdminAction 16 { 17 function AdminEditPermissionAction( $actionInfo, $request ) 18 { 19 $this->AdminAction( $actionInfo, $request ); 20 21 // register two validators 22 $this->registerFieldValidator( "permId", new IntegerValidator()); 23 $errorView = new AdminPermissionsListView( $this->_blogInfo ); 24 $errorView->setErrorMessage( $this->_locale->tr("error_fetching_permission" )); 25 $this->setValidationErrorView( $errorView ); 26 27 $this->requireAdminPermission( "update_permission" ); 28 } 29 30 function perform() 31 { 32 // add the permission and check success 33 $perms = new Permissions(); 34 $perm = $perms->getPermission( $this->_request->getValue( "permId" )); 35 36 if( !$perm ) { 37 $this->_view = new AdminPermissionsListView( $this->_blogInfo ); 38 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_permission" )); 39 $this->setCommonData(); 40 return( false ); 41 } 42 43 $this->_view = new AdminTemplatedView( $this->_blogInfo, "editpermission" ); 44 $this->_view->setValue( "permissionName", $perm->getName()); 45 $this->_view->setValue( "permissionDescription", $perm->getDescription()); 46 $this->_view->setValue( "permissionId", $perm->getId()); 47 $this->_view->setValue( "corePermission", $perm->isCorePermission()); 48 $this->_view->setValue( "adminOnlyPermission", $perm->isAdminOnlyPermission()); 49 $this->setCommonData(); 50 51 return( true ); 52 } 53 } 54 ?>
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 |
![]() |