From 70f01544e1e9970bb6d4a0cbd979c8f6c72a243d Mon Sep 17 00:00:00 2001 From: jerome Date: Tue, 16 Jun 2009 09:09:33 +0000 Subject: [PATCH] administration MDL-19525 remove global $userfields usage from uploadpicture_form class, merged from 1.9 --- admin/uploadpicture.php | 2 +- admin/uploadpicture_form.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/admin/uploadpicture.php b/admin/uploadpicture.php index b68ab092d7..28f1b06720 100644 --- a/admin/uploadpicture.php +++ b/admin/uploadpicture.php @@ -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')); diff --git a/admin/uploadpicture_form.php b/admin/uploadpicture_form.php index 542477cc0e..9ed7d1c6a6 100644 --- a/admin/uploadpicture_form.php +++ b/admin/uploadpicture_form.php @@ -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); -- 2.39.5