MDL-58165 navigation: Add node key to private files navigation node

This commit is contained in:
Alexander Bias 2017-05-17 08:18:23 +02:00
parent 590292d48e
commit 27456a6422

View File

@ -2339,7 +2339,7 @@ class global_navigation extends navigation_node {
// This link doesn't have a unique display for course context so only display it under the user's profile.
if ($issitecourse && $iscurrentuser && has_capability('moodle/user:manageownfiles', $usercontext)) {
$url = new moodle_url('/user/files.php');
$usernode->add(get_string('privatefiles'), $url, self::TYPE_SETTING);
$usernode->add(get_string('privatefiles'), $url, self::TYPE_SETTING, null, 'privatefiles');
}
// Add a node to view the users notes if permitted.
@ -2775,7 +2775,7 @@ class global_navigation extends navigation_node {
$usercontext = context_user::instance($USER->id);
if (has_capability('moodle/user:manageownfiles', $usercontext)) {
$url = new moodle_url('/user/files.php');
$node = $coursenode->add(get_string('privatefiles'), $url, self::TYPE_SETTING);
$node = $coursenode->add(get_string('privatefiles'), $url, self::TYPE_SETTING, null, 'privatefiles');
$node->display = false;
$node->showinflatnavigation = true;
}
@ -4677,7 +4677,7 @@ class settings_navigation extends navigation_node {
// This link doesn't have a unique display for course context so only display it under the user's profile.
if ($issitecourse && $iscurrentuser && has_capability('moodle/user:manageownfiles', $usercontext)) {
$url = new moodle_url('/user/files.php');
$dashboard->add(get_string('privatefiles'), $url, self::TYPE_SETTING);
$dashboard->add(get_string('privatefiles'), $url, self::TYPE_SETTING, null, 'privatefiles');
}
// Add a node to view the users notes if permitted.