Merge branch 'MDL-74363' of https://github.com/Chocolate-lightning/moodle
This commit is contained in:
+12
-6
@@ -140,15 +140,23 @@ switch ($mode) {
|
||||
require_once($CFG->dirroot . '/user/lib.php');
|
||||
// Get the correct 'Grades' url to point to.
|
||||
$activeurl = user_mygrades_url();
|
||||
$navbar = $PAGE->navbar->add(get_string('grades', 'grades'), $activeurl, navigation_node::TYPE_SETTING);
|
||||
$navbar = $PAGE->navbar->add(get_string('grades', 'grades'), $activeurl, navigation_node::TYPE_SETTING, null, 'grades');
|
||||
$activenode = $navbar->add($course->shortname);
|
||||
$activenode->make_active();
|
||||
// Find the course node and collapse it.
|
||||
$coursenode = $PAGE->navigation->find($course->id, navigation_node::TYPE_COURSE);
|
||||
$coursenode->collapse = true;
|
||||
$coursenode->make_inactive();
|
||||
$url = new moodle_url('/course/user.php', array('id' => $id, 'user' => $user->id, 'mode' => $mode));
|
||||
$reportnode = $activenode->add(get_string('pluginname', 'gradereport_user'), $url);
|
||||
|
||||
if (!preg_match('/^user\d{0,}$/', $activenode->key)) { // No user name found.
|
||||
$userurl = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id));
|
||||
// Add the user name.
|
||||
$usernode = $activenode->add(fullname($user), $userurl, navigation_node::TYPE_SETTING);
|
||||
$usernode->add(get_string('grades'));
|
||||
} else {
|
||||
$url = new moodle_url('/course/user.php', array('id' => $id, 'user' => $user->id, 'mode' => $mode));
|
||||
$reportnode = $activenode->add(get_string('pluginname', 'gradereport_user'), $url);
|
||||
}
|
||||
} else {
|
||||
if ($course->id == SITEID) {
|
||||
$activenode = $PAGE->navigation->find('user' . $user->id, null);
|
||||
@@ -168,11 +176,10 @@ switch ($mode) {
|
||||
// Add the 'grades' node to the navbar.
|
||||
$navbar = $PAGE->navbar->add(get_string('grades', 'grades'), $gradeurl, navigation_node::TYPE_SETTING);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if ($course->id !== SITEID) {
|
||||
$backurl = new moodle_url('/user/view.php', ['id' => $user->id, 'course' => $course->id]);
|
||||
echo $OUTPUT->single_button($backurl, get_string('back'), 'get', ['class' => 'mb-3']);
|
||||
$userheading = array(
|
||||
'heading' => fullname($user, has_capability('moodle/site:viewfullnames', $PAGE->context)),
|
||||
'user' => $user,
|
||||
@@ -207,5 +214,4 @@ switch ($mode) {
|
||||
echo $OUTPUT->header();
|
||||
}
|
||||
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -44,7 +44,7 @@ Feature: User can view activity log.
|
||||
And I follow "Ann, Jill, Grainne, Beauchamp"
|
||||
When I follow "Today's logs"
|
||||
And I should see "Assignment: Test assignment name"
|
||||
And I click on "Back" "button"
|
||||
And I follow "Ann, Jill, Grainne, Beauchamp"
|
||||
And I follow "All logs"
|
||||
Then I should see "Assignment: Test assignment name"
|
||||
|
||||
|
||||
+2
-4
@@ -79,6 +79,7 @@ $PAGE->set_url('/report/log/user.php', array('id' => $user->id, 'course' => $cou
|
||||
$PAGE->navigation->extend_for_user($user);
|
||||
$PAGE->navigation->set_userid_for_parent_checks($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
|
||||
$PAGE->set_title("$course->shortname: $stractivityreport");
|
||||
$PAGE->navbar->add(get_string('alllogs'));
|
||||
|
||||
// Create the appropriate breadcrumb.
|
||||
$navigationnode = array(
|
||||
@@ -104,9 +105,6 @@ $event->trigger();
|
||||
|
||||
echo $OUTPUT->header();
|
||||
if ($courseid != SITEID) {
|
||||
$backurl = new moodle_url('/user/view.php', ['id' => $userid, 'course' => $courseid]);
|
||||
echo $OUTPUT->single_button($backurl, get_string('back'), 'get', ['class' => 'mb-3']);
|
||||
|
||||
$userheading = array(
|
||||
'heading' => fullname($user, has_capability('moodle/site:viewfullnames', $PAGE->context)),
|
||||
'user' => $user,
|
||||
@@ -149,4 +147,4 @@ report_log_print_graph($course, $user, $mode, 0, $logreader);
|
||||
echo '</div>';
|
||||
|
||||
echo $output->render($reportlog);
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -67,7 +67,6 @@ class boostnavbar implements \renderable {
|
||||
$this->remove('permissions');
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->page->context->contextlevel == CONTEXT_COURSE) {
|
||||
// Remove any duplicate navbar nodes.
|
||||
$this->remove_duplicate_items();
|
||||
@@ -94,6 +93,9 @@ class boostnavbar implements \renderable {
|
||||
case 'course-reset':
|
||||
// Remove the 'Import' navbar node in the Backup, Restore, Copy course and Reset pages.
|
||||
$this->remove('import');
|
||||
case 'course-user':
|
||||
$this->remove('mygrades');
|
||||
$this->remove('grades');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user