3 require_once($CFG->libdir
.'/formslib.php');
5 class course_import_groups_form
extends moodleform
{
7 function definition() {
10 $mform =& $this->_form
;
11 $maxuploadsize = $this->_customdata
['maxuploadsize'];
12 $strimportgroups = get_string("importgroups");
14 $this->set_upload_manager(new upload_manager('userfile', true, false, '', false, $maxuploadsize, true, true));
15 //$this->set_max_file_size('', $maxuploadsize);
17 $mform->addElement('header', 'general', '');//fill in the data depending on page params
18 //later using set_data
21 $mform->addElement('file', 'userfile', '');
22 $mform->setHelpButton('userfile', array('attachment', get_string('attachment', 'forum'), 'forum'));
25 $this->add_action_buttons(false, $strimportgroups);
28 function get_import_name(){
29 if ($this->is_submitted() and $this->is_validated()) {
30 // return the temporary filename to process
31 return $this->_upload_manager
->files
['userfile']['tmp_name'];