Differences Between: [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]
1 <?php 2 3 if (!defined('MOODLE_INTERNAL')) { 4 die('Direct access to this script is forbidden!'); 5 } 6 require_once($CFG->libdir . '/formslib.php'); 7 8 9 class data_existing_preset_form extends moodleform { 10 public function definition() { 11 $this->_form->addElement('header', 'presets', get_string('usestandard', 'data')); 12 $this->_form->addHelpButton('presets', 'usestandard', 'data'); 13 14 $this->_form->addElement('hidden', 'd'); 15 $this->_form->setType('d', PARAM_INT); 16 $this->_form->addElement('hidden', 'action', 'confirmdelete'); 17 $this->_form->setType('action', PARAM_ALPHANUM); 18 $delete = get_string('delete'); 19 foreach ($this->_customdata['presets'] as $preset) { 20 $this->_form->addElement('radio', 'fullname', null, ' '.$preset->description, $preset->userid.'/'.$preset->shortname); 21 } 22 $this->_form->addElement('submit', 'importexisting', get_string('choose')); 23 } 24 } 25 26 class data_import_preset_zip_form extends moodleform { 27 public function definition() { 28 $this->_form->addElement('header', 'uploadpreset', get_string('fromfile', 'data')); 29 $this->_form->addHelpButton('uploadpreset', 'fromfile', 'data'); 30 31 $this->_form->addElement('hidden', 'd'); 32 $this->_form->setType('d', PARAM_INT); 33 $this->_form->addElement('hidden', 'action', 'importzip'); 34 $this->_form->setType('action', PARAM_ALPHANUM); 35 $this->_form->addElement('filepicker', 'importfile', get_string('chooseorupload', 'data')); 36 $this->_form->addRule('importfile', null, 'required'); 37 $this->_form->addElement('submit', 'uploadzip', get_string('import')); 38 } 39 } 40 41 class data_export_form extends moodleform { 42 public function definition() { 43 $this->_form->addElement('header', 'exportheading', get_string('exportaszip', 'data')); 44 $this->_form->addElement('hidden', 'd'); 45 $this->_form->setType('d', PARAM_INT); 46 $this->_form->addElement('hidden', 'action', 'export'); 47 $this->_form->setType('action', PARAM_ALPHANUM); 48 $this->_form->addElement('submit', 'export', get_string('export', 'data')); 49 } 50 } 51 52 class data_save_preset_form extends moodleform { 53 public function definition() { 54 $this->_form->addElement('header', 'exportheading', get_string('saveaspreset', 'data')); 55 $this->_form->addElement('hidden', 'd'); 56 $this->_form->setType('d', PARAM_INT); 57 $this->_form->addElement('hidden', 'action', 'save2'); 58 $this->_form->setType('action', PARAM_ALPHANUM); 59 $this->_form->addElement('text', 'name', get_string('name')); 60 $this->_form->setType('name', PARAM_FILE); 61 $this->_form->addRule('name', null, 'required'); 62 $this->_form->addElement('checkbox', 'overwrite', get_string('overwrite', 'data'), get_string('overrwritedesc', 'data')); 63 $this->_form->addElement('submit', 'saveaspreset', get_string('continue')); 64 } 65 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body