Merge branch 'wip-mdl-42560' of git://github.com/rajeshtaneja/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 29 Oct 2013 05:09:23 +0000 (13:09 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 29 Oct 2013 05:09:23 +0000 (13:09 +0800)
1  2 
admin/roles/override.php

diff --combined admin/roles/override.php
@@@ -53,19 -53,9 +53,19 @@@ if (!has_capability('moodle/role:overri
      $safeoverridesonly = true;
  }
  $PAGE->set_url($url);
 -$PAGE->set_context($context);
  $PAGE->set_pagelayout('admin');
  
 +if ($context->contextlevel == CONTEXT_USER and $USER->id != $context->instanceid) {
 +    $PAGE->navigation->extend_for_user($user);
 +    $PAGE->set_context(context_course::instance($course->id));
 +    navigation_node::override_active_url(new moodle_url('/admin/roles/permissions.php',
 +        array('contextid'=>$context->id, 'userid'=>$context->instanceid, 'courseid'=>$course->id)));
 +
 +} else {
 +    $PAGE->set_context($context);
 +    navigation_node::override_active_url(new moodle_url('/admin/roles/permissions.php', array('contextid'=>$context->id)));
 +}
 +
  $courseid = $course->id;
  
  $returnurl = new moodle_url('/admin/roles/permissions.php', array('contextid' => $context->id));
@@@ -101,11 -91,12 +101,11 @@@ switch ($context->contextlevel) 
          $showroles = 1;
          break;
      case CONTEXT_COURSECAT:
 -        $PAGE->set_heading("$SITE->fullname: ".get_string("categories"));
 +        $PAGE->set_heading($SITE->fullname);
          break;
      case CONTEXT_COURSE:
          if ($isfrontpage) {
 -            require_once($CFG->libdir.'/adminlib.php');
 -            admin_externalpage_setup('frontpageroles', '', array(), $PAGE->url);
 +            $PAGE->set_heading(get_string('frontpage', 'admin'));
          } else {
              $PAGE->set_heading($course->fullname);
          }
@@@ -139,8 -130,7 +139,7 @@@ if (optional_param('savechanges', false
          array(
              'context' => $context,
              'objectid' => $roleid,
-             'courseid' => $courseid,
-             'other' => array('name' => $rolename)
+             'courseid' => $courseid
          )
      );