3 require_once ($CFG->dirroot
.'/course/moodleform_mod.php');
4 class category_add_form
extends moodleform
{
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
{
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'));