MDL-22388 Added some checks to kill these scripts dead with an unequivocal notice...
[moodle.git] / admin / uploadpicture_form.php
1 <?php
3 if (!defined('MOODLE_INTERNAL')) {
4     die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
5 }
7 require_once $CFG->libdir.'/formslib.php';
9 class admin_uploadpicture_form extends moodleform {
10     function definition (){
11         global $CFG, $USER;
13         $mform =& $this->_form;
15         $this->set_upload_manager(new upload_manager('userpicturesfile', false, false, null, false, 0, true, true, false));
17         $mform->addElement('header', 'settingsheader', get_string('upload'));
19         $mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"');
20         $mform->addRule('userpicturesfile', null, 'required');
22         $choices =& $this->_customdata;
23         $mform->addElement('select', 'userfield', get_string('uploadpicture_userfield', 'admin'), $choices);
24         $mform->setType('userfield', PARAM_INT);
26         $choices = array( 0 => get_string('no'), 1 => get_string('yes') );
27         $mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
28         $mform->setType('overwritepicture', PARAM_INT);
30         $this->add_action_buttons(false, get_string('uploadpictures', 'admin'));
31     }
32 }