forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrouping_edit_form.php
41 lines (31 loc) · 1.43 KB
/
grouping_edit_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php //$Id$
require_once($CFG->dirroot.'/lib/formslib.php');
/// get url variables
class grouping_edit_form extends moodleform {
// Define the form
function definition () {
global $USER, $CFG, $COURSE;
$strrequired = get_string('required');
$buttonstr = get_string('creategrouping', 'group');
if (!empty($this->_customdata['grouping'])) {
$grouping = $this->_customdata['grouping'];
$id = $grouping->id;
}
$courseid = $this->_customdata['courseid'];
$mform =& $this->_form;
$mform->addElement('text','name', get_string('groupingname', 'group'),'maxlength="254" size="50"');
$mform->setDefault('name', get_string('defaultgroupingname', 'group'));
$mform->addRule('name', get_string('missingname'), 'required', null, 'server');
$mform->setType('name', PARAM_MULTILANG);
$mform->addElement('htmleditor', 'description', get_string('groupdescription', 'group'), array('rows'=> '15', 'course' => $courseid, 'cols'=>'45'));
$mform->setType('description', PARAM_RAW);
if (!empty($id)) {
$buttonstr = get_string('save', 'group');
$mform->addElement('hidden','id', null);
$mform->setType('id', PARAM_INT);
}
$this->add_action_buttons(true, $buttonstr);
$mform->addElement('hidden', 'courseid', $courseid);
}
}
?>