MDL-50289 notes: No navigation to notes if the feature is disabled

This commit is contained in:
David Mudrák 2015-05-25 12:28:49 +02:00
parent 803f565753
commit e9acc1d6c5

View File

@ -379,6 +379,13 @@ function note_view($context, $userid) {
* @return bool
*/
function core_notes_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course) {
global $CFG;
if (empty($CFG->enablenotes)) {
// Notes are disabled, nothing to do.
return false;
}
$url = new moodle_url("/notes/index.php", array('user' => $user->id));
$title = get_string('notes', 'core_notes');
if (empty($course)) {