MDL-10897 - Backup is horribly inefficient when getting the users to include
[moodle.git] / question / export_form.php
CommitLineData
515ed4c3 1<?php //$Id$
2
3require_once($CFG->libdir.'/formslib.php');
4
5class question_export_form extends moodleform {
6
7 function definition() {
8 $mform =& $this->_form;
9
10 $defaultcategory = $this->_customdata['defaultcategory'];
11 $contexts = $this->_customdata['contexts'];
12 $defaultfilename = $this->_customdata['defaultfilename'];
13//--------------------------------------------------------------------------------
14 $mform->addElement('header','general', get_string('general', 'form'));
15
16 $mform->addElement('questioncategory', 'category', get_string('category','quiz'), compact('contexts'));
17 $mform->setDefault('category', $defaultcategory);
18 $mform->setHelpButton('category', array('exportcategory', get_string('exportcategory','question'), 'quiz'));
19
20 $categorygroup = array();
21 $categorygroup[] =& $mform->createElement('checkbox', 'cattofile', '', get_string('tofilecategory', 'question'));
22 $categorygroup[] =& $mform->createElement('checkbox', 'contexttofile', '', get_string('tofilecontext', 'question'));
23 $mform->addGroup($categorygroup, 'categorygroup', '', '', false);
24 $mform->disabledIf('categorygroup', 'cattofile', 'notchecked');
25 $mform->setDefault('cattofile', 1);
26 $mform->setDefault('contexttofile', 1);
27
28
29 $fileformatnames = get_import_export_formats('export');
30 $mform->addElement('select', 'format', get_string('fileformat','quiz'), $fileformatnames);
31 $mform->setDefault('format', 'gift');
32 $mform->setHelpButton('format', array('export', get_string('exportquestions', 'quiz'), 'quiz'));
33
34 $mform->addElement('text', 'exportfilename', get_string('exportname', 'quiz'), array('size'=>40));
35 $mform->setDefault('exportfilename', $defaultfilename);
36 $mform->setType('exportfilename', PARAM_CLEANFILE);
37
38
39//--------------------------------------------------------------------------------
40 $this->add_action_buttons(false, get_string('exportquestions', 'quiz'));
41//--------------------------------------------------------------------------------
42 }
43}
44?>