} else { if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) { admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php'); admin_externalpage_print_header(); $currenttab = 'check'; include_once 'tabs.php'; } else { $currenttab = 'check'; include_once 'tabs.php'; } } } /// Print heading. print_heading_with_help($title, 'checkpermissions'); /// If a user has been chosen, show all the permissions for this user. $reportuser = $userselector->get_selected_user(); if (!is_null($reportuser)) { print_box_start('generalbox boxaligncenter boxwidthwide'); print_heading(get_string('permissionsforuser', 'role', fullname($reportuser)), '', 3); $table = new explain_capability_table($context, $reportuser, $contextname); $table->display(); print_box_end(); $selectheading = get_string('selectanotheruser', 'role'); } else { $selectheading = get_string('selectauser', 'role'); } /// Show UI for choosing a user to report on. print_box_start('generalbox boxwidthnormal boxaligncenter', 'chooseuser'); echo '<form method="get" action="' . $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php" >'; /// Hidden fields. echo '<input type="hidden" name="contextid" value="' . $context->id . '" />';