1 |
efrain |
1 |
<?php
|
|
|
2 |
if (!defined('MOODLE_INTERNAL')) {
|
|
|
3 |
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
|
|
4 |
}
|
|
|
5 |
|
|
|
6 |
require_once($CFG->libdir.'/formslib.php');
|
|
|
7 |
|
|
|
8 |
class mod_glossary_import_form extends moodleform {
|
|
|
9 |
|
|
|
10 |
function definition() {
|
|
|
11 |
global $CFG;
|
|
|
12 |
$mform =& $this->_form;
|
|
|
13 |
$cmid = $this->_customdata['id'] ?? null;
|
|
|
14 |
|
|
|
15 |
$mform->addElement('filepicker', 'file', get_string('filetoimport', 'glossary'));
|
|
|
16 |
$mform->addHelpButton('file', 'filetoimport', 'glossary');
|
|
|
17 |
$options = array();
|
|
|
18 |
$options['current'] = get_string('currentglossary', 'glossary');
|
|
|
19 |
$options['newglossary'] = get_string('newglossary', 'glossary');
|
|
|
20 |
$mform->addElement('select', 'dest', get_string('destination', 'glossary'), $options);
|
|
|
21 |
$mform->addHelpButton('dest', 'destination', 'glossary');
|
|
|
22 |
$mform->addElement('checkbox', 'catsincl', get_string('importcategories', 'glossary'));
|
|
|
23 |
$submit_string = get_string('submit');
|
|
|
24 |
$mform->addElement('hidden', 'id');
|
|
|
25 |
$mform->setType('id', PARAM_INT);
|
|
|
26 |
$this->add_action_buttons(true, $submit_string);
|
|
|
27 |
}
|
|
|
28 |
}
|