administration MDL-19525 remove global $userfields usage from uploadpicture_form class, merged from 1.9

This commit is contained in:
jerome
2009-06-16 09:09:33 +00:00
parent 27c718a90e
commit 70f01544e1
2 changed files with 4 additions and 5 deletions
+1 -1
View 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'));
+3 -4
View File
@@ -4,7 +4,6 @@
class admin_uploadpicture_form extends moodleform {
function definition (){
global $CFG, $USER;
global $userfields;
$mform =& $this->_form;
@@ -14,11 +13,11 @@
$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);