p_master::set_display PHP Method

set_display() public method

Toggle whether this module will be displayed or not
public set_display ( $id, $mode = false, $display = true )
    function set_display($id, $mode = false, $display = true)
    {
        foreach ($this->module_ary as $row_id => $item_ary) {
            if (($item_ary['name'] === $id || $item_ary['name'] === $this->p_class . '_' . $id || $item_ary['id'] === (int) $id) && (!$mode || $item_ary['mode'] === $mode)) {
                $this->module_ary[$row_id]['display'] = (int) $display;
            }
        }
    }

Usage Example

Beispiel #1
0
            break;
        case 'split':
        case 'merge':
            $module->set_active('main', 'topic_view');
            break;
        default:
            trigger_error("{$action} not allowed as quickmod", E_USER_ERROR);
            break;
    }
} else {
    // Select the active module
    $module->set_active($id, $mode);
}
// Hide some of the options if we don't have the relevant information to use them
if (!$post_id) {
    $module->set_display('main', 'post_details', false);
    $module->set_display('warn', 'warn_post', false);
}
if ($mode == '' || $mode == 'unapproved_topics' || $mode == 'unapproved_posts') {
    $module->set_display('queue', 'approve_details', false);
}
if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details') {
    $module->set_display('reports', 'report_details', false);
}
if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'report_details') {
    $module->set_display('pm_reports', 'pm_report_details', false);
}
if (!$topic_id) {
    $module->set_display('main', 'topic_view', false);
    $module->set_display('logs', 'topic_logs', false);
}
All Usage Examples Of p_master::set_display