. /** * Allow overriding of roles by other roles * * @package core * @subpackage role * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../config.php'); require_once($CFG->libdir . '/adminlib.php'); require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php'); $mode = required_param('mode', PARAM_ACTION); $classformode = array( 'assign' => 'role_allow_assign_page', 'override' => 'role_allow_override_page', 'switch' => 'role_allow_switch_page' ); if (!isset($classformode[$mode])) { print_error('invalidmode', '', '', $mode); } $baseurl = new moodle_url('/admin/roles/allow.php', array('mode'=>$mode)); admin_externalpage_setup('defineroles', '', array(), $baseurl); $syscontext = get_context_instance(CONTEXT_SYSTEM); require_capability('moodle/role:manage', $syscontext); $controller = new $classformode[$mode](); if (optional_param('submit', false, PARAM_BOOL) && data_submitted() && confirm_sesskey()) { $controller->process_submission(); mark_context_dirty($syscontext->path); add_to_log(SITEID, 'role', 'edit allow ' . $mode, str_replace($CFG->wwwroot . '/', '', $baseurl), '', '', $USER->id); redirect($baseurl); } $controller->load_current_settings(); // Display the editing form. echo $OUTPUT->header(); $currenttab = $mode; require('managetabs.php'); $table = $controller->get_table(); echo $OUTPUT->box($controller->get_intro_text()); echo '
'; echo ''; echo html_writer::table($table); echo '
'; echo '
'; echo $OUTPUT->footer();