Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / course / editcategory_form.php
blob37efa02b629629892a8b39c74928154a494863ad
1 <?php
2 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
3 class editcategory_form extends moodleform {
5 // form definition
6 function definition() {
7 global $CFG;
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'));
12 $parents = array();
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)) {
21 $themes=array();
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'));