]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10970 Someone was using
authornicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 06:01:15 +0000 (06:01 +0000)
committernicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 06:01:15 +0000 (06:01 +0000)
$locations = array('location1');
$locations += array('location2', 'location3', 'location4');

to save the hassle of doing one $locations[] = 'location1'; for each location.

But += doesn't add any entry if the key of the new array already exists in the original array. So, using my example, the resulting array would be:

$locations: array('location1', 'location3', 'location4');

grade/lib.php
lib/moodlelib.php

index 627ca0772f3ba8964eee6770ee56dcaa8a100904..31898c9783e9f4638cff8f1a8acecab25559efcb 100644 (file)
@@ -35,7 +35,7 @@ function print_grade_plugin_selector($courseid, $active_type, $active_plugin, $r
             if ($active_type == 'report' and $active_plugin == $plugin ) {
                 $active = $url;
             }
-            $reportnames[$url] = get_string('modulename', 'gradereport_'.$plugin, NULL, $CFG->dirroot.'/grade/report/'.$plugin.'lang/');
+            $reportnames[$url] = get_string('modulename', 'gradereport_'.$plugin, NULL, $CFG->dirroot.'/grade/report/'.$plugin.'/lang/');
         }
         asort($reportnames);
     }
@@ -59,7 +59,7 @@ function print_grade_plugin_selector($courseid, $active_type, $active_plugin, $r
             if ($active_type == 'import' and $active_plugin == $plugin ) {
                 $active = $url;
             }
-            $importnames[$url] = get_string('modulename', 'gradeimport_'.$plugin, NULL, $CFG->dirroot.'/grade/import/'.$plugin.'lang/');
+            $importnames[$url] = get_string('modulename', 'gradeimport_'.$plugin, NULL, $CFG->dirroot.'/grade/import/'.$plugin.'/lang/');
         }
         asort($importnames);
     }
@@ -83,7 +83,7 @@ function print_grade_plugin_selector($courseid, $active_type, $active_plugin, $r
             if ($active_type == 'export' and $active_plugin == $plugin ) {
                 $active = $url;
             }
-            $exportnames[$url] = get_string('modulename', 'gradeexport_'.$plugin, NULL, $CFG->dirroot.'/grade/export/'.$plugin.'lang/');
+            $exportnames[$url] = get_string('modulename', 'gradeexport_'.$plugin, NULL, $CFG->dirroot.'/grade/export/'.$plugin.'/lang/');
         }
         asort($exportnames);
     }
index 443e375a371dc09c1aecfdc664aeac960428b0a5..03eb2395961695fd38da43d18f3cea1df1d2051d 100644 (file)
@@ -4481,10 +4481,13 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) {
     if (isset($CFG->running_installer)) {
         $module = 'installer';
         $filetocheck = 'installer.php';
-        $locations += array( $CFG->dirroot.'/install/lang/', $CFG->dataroot.'/lang/',  $CFG->dirroot.'/lang/' );
+        $locations[] = $CFG->dirroot.'/install/lang/';
+        $locations[] = $CFG->dataroot.'/lang/';
+        $locations[] = $CFG->dirroot.'/lang/';
         $defaultlang = 'en_utf8';
     } else {
-        $locations += array( $CFG->dataroot.'/lang/',  $CFG->dirroot.'/lang/' );
+        $locations[] = $CFG->dataroot.'/lang/';
+        $locations[] = $CFG->dirroot.'/lang/';
     }
 
 /// Add extra places to look for strings for particular plugin types.
@@ -4525,7 +4528,7 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) {
                 eval($result);
                 return $resultstring;
             }
-        }
+       }
     }
 
 /// If the preferred language was English (utf8) we can abort now