Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

administration MDL-19525 remove global $userfields usage from uploadp…

…icture_form class
  • Loading branch information...
commit 3f34186fec28b2159c825c04f5b1f18695137974 1 parent 88b8207
jerome authored
Showing with 4 additions and 5 deletions.
  1. +1 −1  admin/uploadpicture.php
  2. +3 −4 admin/uploadpicture_form.php
View
2  admin/uploadpicture.php
@@ -61,7 +61,7 @@
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'));
View
7 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 @@ function definition (){
$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);
Please sign in to comment.
Something went wrong with that request. Please try again.