Skip to content

Commit

Permalink
Merge branch 'MDL-52237-master' of git://github.com/StudiUM/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao authored and stronk7 committed Dec 3, 2015
2 parents e070165 + 20dde5e commit 00419a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/navigationlib.php
Expand Up @@ -2342,6 +2342,15 @@ protected function load_for_user($user=null, $forceforcontext=false) {
}
}

// Let plugins hook into user navigation.
$pluginsfunction = get_plugins_with_function('extend_navigation_user', 'lib.php');
foreach ($pluginsfunction as $plugintype => $plugins) {
if ($plugintype != 'report') {
foreach ($plugins as $pluginfunction) {
$pluginfunction($usernode, $user, $usercontext, $course, $coursecontext);
}
}
}
}
return true;
}
Expand Down Expand Up @@ -4306,6 +4315,17 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
}
$dashboard->add(get_string('grades', 'grades'), $url, self::TYPE_SETTING, null, 'mygrades');
}

// Let plugins hook into user navigation.
$pluginsfunction = get_plugins_with_function('extend_navigation_user', 'lib.php');
foreach ($pluginsfunction as $plugintype => $plugins) {
if ($plugintype != 'report') {
foreach ($plugins as $pluginfunction) {
$pluginfunction($profilenode, $user, $usercontext, $course, $coursecontext);
}
}
}

$usersetting = navigation_node::create(get_string('preferences', 'moodle'), $prefurl, self::TYPE_CONTAINER, null, $key);
$dashboard->add_node($usersetting);
} else {
Expand Down
7 changes: 7 additions & 0 deletions lib/upgrade.txt
@@ -1,6 +1,13 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.

=== 3.1 ===

* Plugins can extend the navigation for user by declaring the following callback:
<frankenstyle>_extend_navigation_user(navigation_node $parentnode, stdClass $user,
context_user $context, stdClass $course,
context_course $coursecontext)

=== 3.0 ===

* Minify updated to 2.2.1
Expand Down

0 comments on commit 00419a7

Please sign in to comment.