From 06670c2669114b4443a0e0115b63ec6d1c9dba9f Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 30 Mar 2007 06:01:53 +0000 Subject: [PATCH] MDL-9112: Fixed htmleditor height. --- group/edit_form.php | 2 +- group/grouping_edit_form.php | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 group/grouping_edit_form.php diff --git a/group/edit_form.php b/group/edit_form.php index b9af51f43f..f42c2a7d11 100644 --- a/group/edit_form.php +++ b/group/edit_form.php @@ -31,7 +31,7 @@ class group_edit_form extends moodleform { $mform->addRule('name', get_string('missingname'), 'required', null, 'client'); $mform->setType('name', PARAM_MULTILANG); - $mform->addElement('htmleditor', 'description', get_string('groupdescription', 'group'), array('rows'=> '5', 'cols'=>'45')); + $mform->addElement('htmleditor', 'description', get_string('groupdescription', 'group'), array('rows'=> '15', 'course' => $courseid, 'cols'=>'45')); $mform->setType('description', PARAM_RAW); $mform->addElement('text', 'enrolmentkey', get_string('enrolmentkey', 'group'), 'maxlength="254" size="24"', get_string('enrolmentkey')); diff --git a/group/grouping_edit_form.php b/group/grouping_edit_form.php new file mode 100644 index 0000000000..5d23ecae97 --- /dev/null +++ b/group/grouping_edit_form.php @@ -0,0 +1,41 @@ +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); + } +} +?> -- 2.39.5