MDL-29012 Show which user profile field is being deleted
authorTomasz Muras <nexor1984@gmail.com>
Sat, 20 Aug 2011 15:29:21 +0000 (16:29 +0100)
committerTomasz Muras <nexor1984@gmail.com>
Sat, 20 Aug 2011 15:29:21 +0000 (16:29 +0100)
Improve usability by showing the name of the profile field
being deleted.

lang/en/admin.php
user/profile/index.php

index 77021d9..dc80da1 100644 (file)
@@ -804,7 +804,7 @@ $string['profiledefaultcategory'] = 'Other fields';
 $string['profiledefaultdata'] = 'Default value';
 $string['profiledefaultchecked'] = 'Checked by default';
 $string['profiledeletecategory'] = 'Deleting a category';
 $string['profiledefaultdata'] = 'Default value';
 $string['profiledefaultchecked'] = 'Checked by default';
 $string['profiledeletecategory'] = 'Deleting a category';
-$string['profiledeletefield'] = 'Deleting a field';
+$string['profiledeletefield'] = 'Deleting field &quot;{$a}&quot;';
 $string['profiledescription'] = 'Description of the field';
 $string['profiledscript'] = 'This script has been profiled';
 $string['profiledscriptview'] = 'View profiling information for this script';
 $string['profiledescription'] = 'Description of the field';
 $string['profiledscript'] = 'This script has been profiled';
 $string['profiledscriptview'] = 'View profiling information for this script';
index d61c405..0617d17 100644 (file)
@@ -55,8 +55,9 @@ switch ($action) {
         }
 
         //ask for confirmation
         }
 
         //ask for confirmation
+        $fieldname = $DB->get_field('user_info_field', 'name', array('id'=>$id));
         $optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletefield', 'sesskey'=>sesskey());
         $optionsyes = array ('id'=>$id, 'confirm'=>1, 'action'=>'deletefield', 'sesskey'=>sesskey());
-        $strheading = get_string('profiledeletefield', 'admin');
+        $strheading = get_string('profiledeletefield', 'admin', $fieldname);
         $PAGE->navbar->add($strheading);
         echo $OUTPUT->header();
         echo $OUTPUT->heading($strheading);
         $PAGE->navbar->add($strheading);
         echo $OUTPUT->header();
         echo $OUTPUT->heading($strheading);