]> git.mjollnir.org Git - moodle.git/commitdiff
administration MDL-19525 remove global $userfields usage from uploadpicture_form...
authorjerome <jerome>
Tue, 16 Jun 2009 09:09:33 +0000 (09:09 +0000)
committerjerome <jerome>
Tue, 16 Jun 2009 09:09:33 +0000 (09:09 +0000)
admin/uploadpicture.php
admin/uploadpicture_form.php

index b68ab092d7f784803417ec01bfed7098cb1a8758..28f1b0672004a35ac75da8905c5a38b93331c87c 100644 (file)
@@ -61,7 +61,7 @@ $overwritepicture = optional_param('overwritepicture', 0, PARAM_BOOL);
 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'));
index 542477cc0edc86fbb042080bb436407835a0fc5b..9ed7d1c6a6d83d9f570639ac15632fc019ad5907 100644 (file)
@@ -4,7 +4,6 @@
     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);