Added copyright notice
[moodle.git] / grade / import / key_form.php
1 <?php //$Id$
3 ///////////////////////////////////////////////////////////////////////////
4 //                                                                       //
5 // NOTICE OF COPYRIGHT                                                   //
6 //                                                                       //
7 // Moodle - Modular Object-Oriented Dynamic Learning Environment         //
8 //          http://moodle.com                                            //
9 //                                                                       //
10 // Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
11 //                                                                       //
12 // This program is free software; you can redistribute it and/or modify  //
13 // it under the terms of the GNU General Public License as published by  //
14 // the Free Software Foundation; either version 2 of the License, or     //
15 // (at your option) any later version.                                   //
16 //                                                                       //
17 // This program is distributed in the hope that it will be useful,       //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of        //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
20 // GNU General Public License for more details:                          //
21 //                                                                       //
22 //          http://www.gnu.org/copyleft/gpl.html                         //
23 //                                                                       //
24 ///////////////////////////////////////////////////////////////////////////
26 require_once($CFG->dirroot.'/lib/formslib.php');
28 class key_form extends moodleform {
30     // Define the form
31     function definition () {
32         global $USER, $CFG, $COURSE;
34         $mform =& $this->_form;
36         $mform->addElement('static', 'value', get_string('keyvalue', 'userkey'));
37         $mform->addElement('text', 'iprestriction', get_string('keyiprestriction', 'userkey'), array('size'=>80));
38         $mform->addElement('date_time_selector', 'validuntil', get_string('keyvaliduntil', 'userkey'), array('optional'=>true));
40         $mform->setHelpButton('iprestriction', array(false, get_string('keyiprestriction', 'userkey'),
41                 false, true, false, get_string("keyiprestrictionhelp", 'userkey')));
42         $mform->setHelpButton('validuntil', array(false, get_string('keyvaliduntil', 'userkey'), false, true, false, get_string("keyvaliduntilhelp", 'userkey')));
44         $mform->addElement('hidden','id');
45         $mform->setType('id', PARAM_INT);
47         $mform->addElement('hidden','courseid');
48         $mform->setType('courseid', PARAM_INT);
50         $this->add_action_buttons();
51     }
52 }
54 ?>