declare a new class file in admin lib, define name type in main class (OTPR) and add case of 'switch' in run() method * * @param string $sAdminType : type of interface to display * @param array $aRequest : request * @return array $aDisplay : empty => false / not empty => true */ public function run($sAdminType, $aRequest) { // set $aDisplay = array(); // include interface require_once(_OTPR_PATH_LIB_ADMIN . 'i-admin.php'); switch ($sAdminType) { case 'display' : // include matched admin object require_once(_OTPR_PATH_LIB_ADMIN . 'admin-display_class.php'); $oAdminType = BT_AdminDisplay::create(); break; case 'update' : // update basic settings / // include matched admin object require_once(_OTPR_PATH_LIB_ADMIN . 'admin-update_class.php'); $oAdminType = BT_AdminUpdate::create(); break; case 'export' : // export report / // include matched admin object require_once(_OTPR_PATH_LIB_ADMIN . 'admin-export_class.php'); $oAdminType = BT_AdminExport::create(); break; default : $oAdminType = false; break; } // process data to use in view (tpl) if (!empty($oAdminType)) { $aDisplay = $oAdminType->run($aRequest); // destruct unset($oAdminType); } return $aDisplay; } }