[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 lt_include( PLOG_CLASS_PATH."class/controller/controller.class.php" ); 4 lt_include( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" ); 5 lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" ); 6 7 $_plogAdminController_running = null; 8 9 /** 10 * \ingroup Controller 11 * 12 * Extends the Controller class so that the operation of loading the 13 * file with the mappings for admin.php is done automatically. The default action parameter becomes 14 * "op" and the file class/controller/admincontrollermap.class.php will be used as the default 15 * action class map. 16 * 17 * You will rarely need to use this class in real life, see the main Controller class. 18 * 19 * @see Controller 20 */ 21 class AdminController extends Controller 22 { 23 24 /** 25 * Constructor. Automatically loads the maps 26 */ 27 function AdminController() 28 { 29 $actionMap = $this->_loadActionMaps(); 30 $defaultActionParam = "op"; 31 32 global $_plogAdminController_running; 33 $_plogAdminController_running = true; 34 35 $this->Controller( $actionMap, $defaultActionParam ); 36 37 $this->setActionFolderPath( PLOG_CLASS_PATH.'class/action/admin/' ); 38 $this->setActionFolderPath( PLOG_CLASS_PATH.'class/action/admin/chooser/' ); 39 40 // set the 'fallback' action in case a user does not have enough permissions 41 // to execute an action 42 $this->setCannotPerformAction( "AdminPermissionRequiredAction" ); 43 } 44 45 /** 46 * If a plugin adds an action 47 * for the public side and an action for the admin side, the action will be accessible via 48 * both index.php?op=theActionName and admin.php?op=theActionName. We will use 49 * use a global variable that is initialized when the constructor of 50 * this class is called. If that variable is set to 'true', then it means that our constructor 51 * was initialized and that we can go ahead and add the action. If not, then we skip the whole 52 * thing and the action is not added. 53 * 54 * This method should therefore be called when adding new actions but <b>only for the public side</b>. In 55 * case of plugins, please use PluginBase::registerBlogAction() and PluginBase::registerAdminAction() 56 * which will nicely hide all these things from you. 57 * 58 * @param actionKey Action key to add 59 * @param actionClass Action class to which the class will map 60 * @see Controller 61 */ 62 function registerAction( $actionKey, $actionClass ) 63 { 64 global $_plogAdminController_running; 65 66 if( $_plogAdminController_running ) 67 Controller::registerAction( $actionKey, $actionClass ); 68 69 return true; 70 } 71 72 /** 73 * Loads the maps 74 * 75 * @private 76 */ 77 function _loadActionMaps() 78 { 79 // NOTE: this is an acceptable use of include() 80 include ( PLOG_CLASS_PATH."class/controller/admincontrollermap.properties.php" ); 81 82 return $actions; 83 } 84 } 85 ?>
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 |
![]() |