MDL-10985 import from remote xml file with key login option
[moodle.git] / grade / import / key_form.php
CommitLineData
a700b5de 1<?php //$Id$
2
3require_once($CFG->dirroot.'/lib/formslib.php');
4
5class key_form extends moodleform {
6
7 // Define the form
8 function definition () {
9 global $USER, $CFG, $COURSE;
10
11 $mform =& $this->_form;
12
13 $mform->addElement('static', 'value', get_string('keyvalue', 'userkey'));
14 $mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
15 $mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
16
17 $mform->setHelpButton('iprestriction', array(false, get_string('keyiprestriction', 'userkey'),
18 false, true, false, get_string("keyiprestrictionhelp", 'userkey')));
19 $mform->setHelpButton('validuntil', array(false, get_string('keyvaliduntil', 'userkey'), false, true, false, get_string("keyvaliduntilhelp", 'userkey')));
20
21 $mform->addElement('hidden','id');
22 $mform->setType('id', PARAM_INT);
23
24 $mform->addElement('hidden','courseid');
25 $mform->setType('courseid', PARAM_INT);
26
27 $this->add_action_buttons();
28 }
29}
30
31?>