mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-49845 navigation: Fix breadcrumbs for links in my profile.
This commit is contained in:
parent
6e9abef568
commit
298c9da5f1
@ -4226,7 +4226,7 @@ class settings_navigation extends navigation_node {
|
||||
// Add nodes for forum posts and discussions if the user can view either or both
|
||||
// There are no capability checks here as the content of the page is based
|
||||
// purely on the forums the current user has access too.
|
||||
$forumtab = $dashboard->add(get_string('forumposts', 'forum'));
|
||||
$forumtab = $profilenode->add(get_string('forumposts', 'forum'));
|
||||
$forumtab->add(get_string('posts', 'forum'), new moodle_url('/mod/forum/user.php', $baseargs), null, 'myposts');
|
||||
$forumtab->add(get_string('discussions', 'forum'), new moodle_url('/mod/forum/user.php',
|
||||
array_merge($baseargs, array('mode' => 'discussions'))), null, 'mydiscussions');
|
||||
@ -4244,7 +4244,7 @@ class settings_navigation extends navigation_node {
|
||||
}
|
||||
|
||||
if (count($options) > 0) {
|
||||
$blogs = $dashboard->add(get_string('blogs', 'blog'), null, navigation_node::TYPE_CONTAINER);
|
||||
$blogs = $profilenode->add(get_string('blogs', 'blog'), null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($options as $type => $option) {
|
||||
if ($type == "rss") {
|
||||
$blogs->add($option['string'], $option['link'], self::TYPE_SETTING, null, null,
|
||||
@ -4284,7 +4284,7 @@ class settings_navigation extends navigation_node {
|
||||
if ($coursecontext->instanceid != SITEID) {
|
||||
$url->param('course', $coursecontext->instanceid);
|
||||
}
|
||||
$dashboard->add(get_string('notes', 'notes'), $url);
|
||||
$profilenode->add(get_string('notes', 'notes'), $url);
|
||||
}
|
||||
|
||||
// Show the grades node.
|
||||
|
@ -379,6 +379,8 @@ function note_view($context, $userid) {
|
||||
* @return bool
|
||||
*/
|
||||
function core_notes_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course) {
|
||||
global $USER;
|
||||
|
||||
$url = new moodle_url("/notes/index.php", array('user' => $user->id));
|
||||
$title = get_string('notes', 'core_notes');
|
||||
if (empty($course)) {
|
||||
@ -387,7 +389,9 @@ function core_notes_myprofile_navigation(core_user\output\myprofile\tree $tree,
|
||||
// No cap, nothing to do.
|
||||
return false;
|
||||
}
|
||||
$url->param('course', 0);
|
||||
if ($user->id != $USER->id) {
|
||||
$url->param('course', 0);
|
||||
}
|
||||
} else {
|
||||
if (!has_capability('moodle/notes:view', context_course::instance($course->id))) {
|
||||
// No cap, nothing to do.
|
||||
|
Loading…
x
Reference in New Issue
Block a user