Fix a possible race condition in the PaintWeb DML code.
[moodle/mihaisucan.git] / tag / edit_form.php
blob5aaec36198e7dc44bb987063ccd71c3bc2a522a9
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');
14 $mform->setType('id', PARAM_INT);
16 $systemcontext = get_context_instance(CONTEXT_SYSTEM);
18 if (has_capability('moodle/tag:manage', $systemcontext)) {
19 $mform->addElement('text', 'rawname', get_string('name', 'tag'),
20 'maxlength="'.TAG_MAX_LENGTH.'" size="'.TAG_MAX_LENGTH.'"');
23 $mform->addElement('htmleditor', 'description', get_string('description', 'tag'), array('rows'=>20));
25 $mform->addElement('format', 'descriptionformat', get_string('format'));
27 if (has_capability('moodle/tag:manage', $systemcontext)) {
28 $mform->addElement('checkbox', 'tagtype', get_string('officialtag', 'tag'));
31 $mform->addElement('html', '<br/><div id="relatedtags-autocomplete-container">');
32 $mform->addElement('textarea', 'relatedtags', get_string('relatedtags','tag'), 'cols="50" rows="3"');
33 $mform->setType('relatedtags', PARAM_TAGLIST);
34 $mform->addElement('html', '</div>');
35 $mform->addElement('html', '<div id="relatedtags-autocomplete"></div>');
37 $this->add_action_buttons(false, get_string('updatetag', 'tag'));