MDL-10689:
[moodle-linuxchix.git] / course / category_add_form.php
blobb9715f3097808978584bf178dc8c0704952d80f4
1 <?php
3 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
4 class category_add_form extends moodleform {
6 // form definition
7 function definition() {
8 $mform =& $this->_form;
9 $mform->addElement('header', 'general', get_string('addnewcategory')); // TODO: localize
10 $mform->addElement('text', 'addcategory', get_string('categoryname'), array('size'=>'30'));
11 $mform->addRule('addcategory', get_string('required'), 'required', null);
12 $mform->addElement('htmleditor', 'description', get_string('description'));
13 $mform->setType('description', PARAM_RAW);
14 $mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton');
16 $this->add_action_buttons(false, get_string('submit'));
20 class sub_category_add_form extends moodleform {
22 // form definition
23 function definition() {
24 $mform =& $this->_form;
25 $mform->addElement('header', 'general', get_string('addsubcategory')); // TODO: localize
26 $mform->addElement('text', 'addcategory', get_string('categoryname'), array('size'=>'30'));
27 $mform->addRule('addcategory', get_string('required'), 'required', null);
28 $mform->addElement('htmleditor', 'description', get_string('description'));
29 $mform->setType('description', PARAM_RAW);
30 $mform->addElement('hidden', 'id');
31 $mform->setType('id', PARAM_INT);
32 $mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton');
34 $this->add_action_buttons(false, get_string('submit'));