From ff1fc4d9f45c6070d7166862f2ebcd312b2b8953 Mon Sep 17 00:00:00 2001 From: Tomasz Muras Date: Tue, 8 Nov 2016 21:54:37 +0100 Subject: [PATCH] MDL-54646 tags: Hide manage tags in menu if tags disabled. --- admin/settings/appearance.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 398c777282a..95ab24626c1 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -236,8 +236,11 @@ preferences,moodle|/user/preferences.php|preferences', $temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1)); $ADMIN->add('appearance', $temp); - // link to tag management interface - $ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $CFG->wwwroot.'/tag/manage.php', 'moodle/tag:manage')); + // Link to tag management interface. + $url = new moodle_url('/tag/manage.php'); + $hidden = empty($CFG->usetags); + $page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden); + $ADMIN->add('appearance', $page); $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin')); $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));