admin_externalpage_print_header();
print_heading_with_help($struploadpictures, 'uploadpictures');
-$mform = new admin_uploadpicture_form();
+$mform = new admin_uploadpicture_form(null, $userfields);
if ($formdata = $mform->get_data()) {
if (!array_key_exists($userfield, $userfields)) {
notify(get_string('uploadpicture_baduserfield','admin'));
class admin_uploadpicture_form extends moodleform {
function definition (){
global $CFG, $USER;
- global $userfields;
$mform =& $this->_form;
$mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"');
$mform->addRule('userpicturesfile', null, 'required');
-
- $choices = $userfields;
+
+ $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);