"MDL-15592, change js function name toggle() to menu_toggle(), to be friendly with...
[moodle-linuxchix.git] / tag / edit_form.php
blobfbfdf067b895cd79661f22f961e919050ca91902
1 <?php // $Id$
3 require_once($CFG->dirroot.'/lib/formslib.php');
5 class tag_edit_form extends moodleform {
7 function definition () {
9 $mform =& $this->_form;
11 $mform->addElement('header', 'tag', get_string('description','tag'));
13 $mform->addElement('hidden', 'id');
15 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
17 if (has_capability('moodle/tag:manage', $systemcontext)) {
18 $mform->addElement('text', 'rawname', get_string('name', 'tag'),
19 'maxlength="'.TAG_MAX_LENGTH.'" size="'.TAG_MAX_LENGTH.'"');
22 $mform->addElement('htmleditor', 'description', get_string('description', 'tag'), array('rows'=>20));
24 $mform->addElement('format', 'descriptionformat', get_string('format'));
26 if (has_capability('moodle/tag:manage', $systemcontext)) {
27 $mform->addElement('checkbox', 'tagtype', get_string('officialtag', 'tag'));
30 $mform->addElement('html', '<br/><div id="relatedtags-autocomplete-container">');
31 $mform->addElement('textarea', 'relatedtags', get_string('relatedtags','tag'), 'cols="50" rows="3"');
32 $mform->setType('relatedtags', PARAM_TAGLIST);
33 $mform->addElement('html', '</div>');
34 $mform->addElement('html', '<div id="relatedtags-autocomplete"></div>');
36 $this->add_action_buttons(false, get_string('updatetag', 'tag'));