Ejemplo n.º 1
0
 function definition()
 {
     global $CFG, $COURSE, $DB;
     $mform = $this->_form;
     $pluginconfig = get_config('dialogue');
     $mform->addElement('header', 'general', get_string('general', 'form'));
     $mform->addElement('text', 'name', get_string('dialoguename', 'dialogue'), array('size' => '64'));
     $mform->setType('name', PARAM_TEXT);
     $mform->addRule('name', null, 'required', null, 'client');
     moodleform_mod::standard_intro_elements();
     $choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, $pluginconfig->maxbytes);
     $mform->addElement('select', 'maxbytes', get_string('maxattachmentsize', 'dialogue'), $choices);
     $mform->addHelpButton('maxbytes', 'maxattachmentsize', 'dialogue');
     $mform->setDefault('maxbytes', $pluginconfig->maxbytes);
     $choices = range(0, $pluginconfig->maxattachments);
     $choices[0] = get_string('uploadnotallowed');
     $mform->addElement('select', 'maxattachments', get_string('maxattachments', 'dialogue'), $choices);
     $mform->addHelpButton('maxattachments', 'maxattachments', 'dialogue');
     $mform->setDefault('maxattachments', $pluginconfig->maxattachments);
     $mform->addElement('checkbox', 'usecoursegroups', get_string('usecoursegroups', 'dialogue'));
     $mform->addHelpButton('usecoursegroups', 'usecoursegroups', 'dialogue');
     $mform->setDefault('usecoursegroups', 0);
     $this->standard_grading_coursemodule_elements();
     $this->standard_coursemodule_elements();
     $this->add_action_buttons();
 }