Merged MDL-13676 Fixed some mistakes I just made
[moodle.git] / tag / edit_form.php
CommitLineData
c933a060 1<?php // $Id$
2
3require_once($CFG->dirroot.'/lib/formslib.php');
4
5class tag_edit_form extends moodleform {
6
7e6e76a6 7 function definition () {
c933a060 8
7e6e76a6 9 $mform =& $this->_form;
d4be9d6d 10
c933a060 11 $mform->addElement('header', 'tag', get_string('description','tag'));
d4be9d6d 12
c933a060 13 $mform->addElement('hidden', 'id');
d4be9d6d 14
7e6e76a6 15 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
16
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.'"');
20 }
21
c933a060 22 $mform->addElement('htmleditor', 'description', get_string('description', 'tag'), array('rows'=>20));
d4be9d6d 23
c933a060 24 $mform->addElement('format', 'descriptionformat', get_string('format'));
d4be9d6d 25
c933a060 26 $mform->addElement('html', '<br/><div id="relatedtags-autocomplete-container">');
27 $mform->addElement('textarea', 'relatedtags', get_string('relatedtags','tag'), 'cols="50" rows="3"');
0d626493 28 $mform->setType('relatedtags', PARAM_TAGLIST);
c933a060 29 $mform->addElement('html', '</div>');
30 $mform->addElement('html', '<div id="relatedtags-autocomplete"></div>');
d4be9d6d 31
32
c933a060 33 $this->add_action_buttons(false, get_string('updatetag', 'tag'));
d4be9d6d 34
c933a060 35 }
36
37}
38
39?>