3 require_once($CFG->dirroot
.'/lib/formslib.php');
6 class grouping_edit_form
extends moodleform
{
9 function definition () {
10 global $USER, $CFG, $COURSE;
12 $strrequired = get_string('required');
13 $buttonstr = get_string('creategrouping', 'group');
15 if (!empty($this->_customdata
['grouping'])) {
16 $grouping = $this->_customdata
['grouping'];
20 $courseid = $this->_customdata
['courseid'];
22 $mform =& $this->_form
;
24 $mform->addElement('text','name', get_string('groupingname', 'group'),'maxlength="254" size="50"');
25 $mform->setDefault('name', get_string('defaultgroupingname', 'group'));
26 $mform->addRule('name', get_string('missingname'), 'required', null, 'server');
27 $mform->setType('name', PARAM_MULTILANG
);
29 $mform->addElement('htmleditor', 'description', get_string('groupdescription', 'group'), array('rows'=> '15', 'course' => $courseid, 'cols'=>'45'));
30 $mform->setType('description', PARAM_RAW
);
33 $buttonstr = get_string('save', 'group');
34 $mform->addElement('hidden','id', null);
35 $mform->setType('id', PARAM_INT
);
37 $this->add_action_buttons(true, $buttonstr);
38 $mform->addElement('hidden', 'courseid', $courseid);