mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
blog MDL-22161 Fixed up blog menu block and added navigation options for users.
This commit is contained in:
parent
f65d7c1399
commit
27bad0a629
4 changed files with 360 additions and 71 deletions
|
@ -1237,6 +1237,19 @@ class global_navigation extends navigation_node {
|
|||
}
|
||||
}
|
||||
|
||||
// Add blog nodes
|
||||
if (!empty($CFG->bloglevel)) {
|
||||
require_once($CFG->dirroot.'/blog/lib.php');
|
||||
// Get all options for the user
|
||||
$options = blog_get_options_for_user($user);
|
||||
if (count($options) > 0) {
|
||||
$blogs = $usernode->add(get_string('blogs', 'blog'), null, navigation_node::TYPE_CONTAINER);
|
||||
foreach ($options as $option) {
|
||||
$blogs->add($option['string'], $option['link']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add a node to view the users notes if permitted
|
||||
if (!empty($CFG->enablenotes) && has_any_capability(array('moodle/notes:manage', 'moodle/notes:view'), $coursecontext)) {
|
||||
$url = new moodle_url('/notes/index.php',array('user'=>$user->id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue