-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathimport_form.php
More file actions
53 lines (38 loc) · 1.63 KB
/
import_form.php
File metadata and controls
53 lines (38 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* This view allows checking deck states
*
* @package mod-flashcard
* @category mod
* @author Valery Fremaux (valery.fremaux@club-internet.fr)
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
require_once($CFG->libdir.'/formslib.php');
class flashcard_import_form extends moodleform{
var $flashcardid;
function flashcard_import_form($flashcardid){
$this->flashcardid = $flashcardid;
parent::moodleform();
}
function definition(){
$mform =& $this->_form;
$mform->addElement('hidden', 'a', $this->flashcardid);
$mform->addElement('hidden', 'what', 'doimport');
$mform->addElement('hidden', 'view', 'edit');
$mform->addElement('header', 'cardimport', '');
$cardsepoptions[0] = ':';
$cardsepoptions[1] = ';';
$cardsepoptions[2] = '[CR]';
$cardsepoptions[3] = '[CR][LF]';
$mform->addElement('select', 'cardsep', get_string('cardsep', 'flashcard'), $cardsepoptions);
$fieldsepoptions[0] = ',';
$fieldsepoptions[1] = ':';
$fieldsepoptions[2] = '[TAB]';
$fieldsepoptions[3] = '[SP]';
$mform->addElement('select', 'fieldsep', get_string('fieldsep', 'flashcard'), $fieldsepoptions);
$mform->addElement('textarea', 'import', get_string('imported', 'flashcard'), array('ROWS' => 10, 'COLS' => 40));
$mform->addElement('checkbox', 'confirm', get_string('confirm', 'flashcard'), get_string('importadvice', 'flashcard'));
$this->add_action_buttons(true, get_string('import', 'flashcard'));
}
}
?>