MDL-23174 Private files editing page needs headings, navbar etc like a normal page
[moodle.git] / tag / edit_form.php
CommitLineData
18ec15e8 1<?php
c933a060 2
bfebaf64
MD
3if (!defined('MOODLE_INTERNAL')) {
4 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
5}
6
c933a060 7require_once($CFG->dirroot.'/lib/formslib.php');
8
9class tag_edit_form extends moodleform {
10
7e6e76a6 11 function definition () {
c933a060 12
7e6e76a6 13 $mform =& $this->_form;
d4be9d6d 14
c933a060 15 $mform->addElement('header', 'tag', get_string('description','tag'));
d4be9d6d 16
c933a060 17 $mform->addElement('hidden', 'id');
d18e0fe6 18 $mform->setType('id', PARAM_INT);
d4be9d6d 19
7e6e76a6 20 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
21
22 if (has_capability('moodle/tag:manage', $systemcontext)) {
6bfe7aac 23 $mform->addElement('text', 'rawname', get_string('name', 'tag'),
7e6e76a6 24 'maxlength="'.TAG_MAX_LENGTH.'" size="'.TAG_MAX_LENGTH.'"');
25 }
26
8bdc9cac 27 $mform->addElement('editor', 'description_editor', get_string('description', 'tag'), null, $this->_customdata['editoroptions']);
d4be9d6d 28
603443b5 29 if (has_capability('moodle/tag:manage', $systemcontext)) {
6bfe7aac 30 $mform->addElement('checkbox', 'tagtype', get_string('officialtag', 'tag'));
603443b5 31 }
32
c933a060 33 $mform->addElement('html', '<br/><div id="relatedtags-autocomplete-container">');
34 $mform->addElement('textarea', 'relatedtags', get_string('relatedtags','tag'), 'cols="50" rows="3"');
0d626493 35 $mform->setType('relatedtags', PARAM_TAGLIST);
c933a060 36 $mform->addElement('html', '<div id="relatedtags-autocomplete"></div>');
18ec15e8 37 $mform->addElement('html', '</div>');
d4be9d6d 38
c933a060 39 $this->add_action_buttons(false, get_string('updatetag', 'tag'));
d4be9d6d 40
c933a060 41 }
42
43}