From e9acc1d6c589abff23d57532044cb08cda9163f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20Mudr=C3=A1k?= Date: Mon, 25 May 2015 12:28:49 +0200 Subject: [PATCH] MDL-50289 notes: No navigation to notes if the feature is disabled --- notes/lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/notes/lib.php b/notes/lib.php index 7b86046f436..ea05994e0c2 100644 --- a/notes/lib.php +++ b/notes/lib.php @@ -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)) { -- 2.43.0