MDL-50851 course: use new tag API

This commit is contained in:
Marina Glancy
2016-01-10 15:25:47 +08:00
parent abea2c5deb
commit 74fa9f76dc
11 changed files with 117 additions and 60 deletions
+3 -2
View File
@@ -304,11 +304,12 @@ class course_edit_form extends moodleform {
}
}
if (!empty($CFG->usetags) &&
if (core_tag_tag::is_enabled('core', 'course') &&
((empty($course->id) && guess_if_creator_will_have_course_capability('moodle/course:tag', $categorycontext))
|| (!empty($course->id) && has_capability('moodle/course:tag', $coursecontext)))) {
$mform->addElement('header', 'tagshdr', get_string('tags', 'tag'));
$mform->addElement('tags', 'tags', get_string('tags'));
$mform->addElement('tags', 'tags', get_string('tags'),
array('itemtype' => 'course', 'component' => 'core'));
}
// When two elements we need a group.