2 require_once ($CFG->dirroot
.'/course/moodleform_mod.php');
3 class editcategory_form
extends moodleform
{
6 function definition() {
8 $mform =& $this->_form
;
10 // get list of categories to use as parents, with site as the first one
11 $options = array(get_string('top'));
13 make_categories_list($options, $parents);
15 $mform->addElement('select', 'parent', get_string('parentcategory'), $options);
16 $mform->addElement('text', 'name', get_string('categoryname'), array('size'=>'30'));
17 $mform->addRule('name', get_string('required'), 'required', null);
18 $mform->addElement('htmleditor', 'description', get_string('description'));
19 $mform->setType('description', PARAM_RAW
);
20 if (!empty($CFG->allowcategorythemes
)) {
22 $themes[''] = get_string('forceno');
23 $themes +
= get_list_of_themes();
24 $mform->addElement('select', 'theme', get_string('forcetheme'), $themes);
26 $mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton');
28 $mform->addElement('hidden', 'id', null);
29 $mform->addElement('hidden', 'categoryadd', 0);
30 $mform->setType('id', PARAM_INT
);
31 $this->add_action_buttons(true, get_string('savechanges'));