"MDL-13766, remove debug code"
[moodle.git] / grade / import / key_form.php
CommitLineData
e060e33d 1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
8ad36f4c 17
a700b5de 18require_once($CFG->dirroot.'/lib/formslib.php');
19
20class key_form extends moodleform {
21
22 // Define the form
23 function definition () {
24 global $USER, $CFG, $COURSE;
25
26 $mform =& $this->_form;
27
28 $mform->addElement('static', 'value', get_string('keyvalue', 'userkey'));
29 $mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
30 $mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
31
4de3322d 32 $mform->setHelpButton('iprestriction', array('keyiprestriction', get_string('keyiprestriction', 'userkey'), 'userkey'));
33 $mform->setHelpButton('validuntil', array('keyvaliduntil', get_string('keyvaliduntil', 'userkey'), 'userkey'));
a700b5de 34
35 $mform->addElement('hidden','id');
36 $mform->setType('id', PARAM_INT);
37
38 $mform->addElement('hidden','courseid');
39 $mform->setType('courseid', PARAM_INT);
40
41 $this->add_action_buttons();
42 }
43}
44
45?>