weekly release 2.1.1+
[moodle.git] / admin / uploadpicture_form.php
blobea0ab6fa40f230310250aa03b76f40f2fdb9110a
1 <?php
3 if (!defined('MOODLE_INTERNAL')) {
4 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
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 $mform->addElement('header', 'settingsheader', get_string('upload'));
18 $options = array();
19 $options['accepted_types'] = array('archive');
20 $mform->addElement('filepicker', 'userpicturesfile', get_string('file'), 'size="40"', $options);
21 $mform->addRule('userpicturesfile', null, 'required');
23 $choices =& $this->_customdata;
24 $mform->addElement('select', 'userfield', get_string('uploadpicture_userfield', 'admin'), $choices);
25 $mform->setType('userfield', PARAM_INT);
27 $choices = array( 0 => get_string('no'), 1 => get_string('yes') );
28 $mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
29 $mform->setType('overwritepicture', PARAM_INT);
31 $this->add_action_buttons(false, get_string('uploadpictures', 'admin'));