load() public method

Load module as the current active one without the need for registering it
public load ( string $class, string $name, string $mode = false )
$class string module class (acp/mcp/ucp)
$name string module name (class name of the module, or its basename phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra)
$mode string mode, as passed through to the module
示例#1
0
$mode = request_var('mode', '');
if ($mode == 'login' || $mode == 'logout' || $mode == 'confirm') {
    define('IN_LOGIN', true);
}
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('ucp');
// Setting a variable to let the style designer know where he is...
$template->assign_var('S_IN_UCP', true);
$module = new p_master();
$default = false;
// Basic "global" modes
switch ($mode) {
    case 'activate':
        $module->load('ucp', 'activate');
        $module->display($user->lang['UCP_ACTIVATE']);
        redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
        break;
    case 'resend_act':
        $module->load('ucp', 'resend');
        $module->display($user->lang['UCP_RESEND']);
        break;
    case 'sendpassword':
        $module->load('ucp', 'remind');
        $module->display($user->lang['UCP_REMIND']);
        break;
    case 'register':
        if ($user->data['is_registered'] || isset($_REQUEST['not_agreed'])) {
            redirect(append_sid("{$phpbb_root_path}index.{$phpEx}"));
        }
示例#2
0
 $mode = 'quickmod';
 switch ($action) {
     case 'lock':
     case 'unlock':
     case 'lock_post':
     case 'unlock_post':
     case 'make_sticky':
     case 'make_announce':
     case 'make_global':
     case 'make_normal':
     case 'fork':
     case 'move':
     case 'delete_post':
     case 'delete_topic':
     case 'trash_topic':
         $module->load('mcp', 'main', 'quickmod');
         return;
         break;
     case 'topic_logs':
         // Reset start parameter if we jumped from the quickmod dropdown
         if (request_var('start', 0)) {
             $_REQUEST['start'] = 0;
         }
         $module->set_active('logs', 'topic_logs');
         break;
     case 'merge_topic':
         $module->set_active('main', 'forum_view');
         break;
     case 'split':
     case 'merge':
         $module->set_active('main', 'topic_view');