forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploadpicture_form.php
34 lines (23 loc) · 1.17 KB
/
uploadpicture_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once $CFG->libdir.'/formslib.php';
class admin_uploadpicture_form extends moodleform {
function definition (){
global $CFG, $USER;
$mform =& $this->_form;
$mform->addElement('header', 'settingsheader', get_string('upload'));
$options = array();
$options['accepted_types'] = array('archive');
$mform->addElement('filepicker', 'userpicturesfile', get_string('file'), 'size="40"', $options);
$mform->addRule('userpicturesfile', null, 'required');
$choices =& $this->_customdata;
$mform->addElement('select', 'userfield', get_string('uploadpicture_userfield', 'admin'), $choices);
$mform->setType('userfield', PARAM_INT);
$choices = array( 0 => get_string('no'), 1 => get_string('yes') );
$mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
$mform->setType('overwritepicture', PARAM_INT);
$this->add_action_buttons(false, get_string('uploadpictures', 'admin'));
}
}