]> git.mjollnir.org Git - moodle.git/commitdiff
lang editing: MDL-18776 fix regression from MDL-18669.
authortjhunt <tjhunt>
Thu, 2 Apr 2009 09:37:29 +0000 (09:37 +0000)
committertjhunt <tjhunt>
Thu, 2 Apr 2009 09:37:29 +0000 (09:37 +0000)
admin/lang.php
lib/moodlelib.php

index f20cc1225dfaf50d9d726239c148031d64dcec66..eac9c15c14476f97b777be6779f54e4f0d942984 100644 (file)
@@ -1186,7 +1186,7 @@ function lang_standard_locations() {
 function lang_extra_locations() {
     global $CFG;
     $files = array();
-    $places = places_to_search_for_lang_strings();
+    $places = string_manager::instance()->get_registered_plugin_types();
     foreach ($places as $prefix => $directories) {
         if ($prefix != '__exceptions') {
             foreach ($directories as $directory) {
@@ -1288,7 +1288,7 @@ function lang_help_standard_locations() {
 function lang_help_extra_locations() {
     global $CFG;
     $files = array();
-    $places = places_to_search_for_lang_strings();
+    $places = string_manager::instance()->get_registered_plugin_types();
     foreach ($places as $prefix => $directories) {
         if ($prefix != '__exceptions') {
             foreach ($directories as $directory) {
index 08692780368ce22e6a7c5d82b0f1f247b26ce341..7ece4cffadde939fe1c6cba86c3f35dc86c4cad1 100644 (file)
@@ -5319,6 +5319,17 @@ class string_manager {
         $SESSION->extralangsearchlocations[$plugintype] = $path;
     }
 
+    /**
+     * This returns an array of all the types of plugin that may have language
+     * strings. 
+     * The array keys are the lang file prefix, like qtype_, and the value is
+     * an array of paths relative to $CFG->dirroot.
+     * @return array as described above.
+     */
+    public function get_registered_plugin_types() {
+        return fullclone($this->searchplacesbyplugintype);
+    }
+
     protected function fix_deprecated_module_name($module) {
         debugging('The module name you passed to get_string is the deprecated format ' .
                 'like mod/mymod or block/myblock. The correct form looks like mymod, or block_myblock.' , DEBUG_DEVELOPER);
@@ -5382,8 +5393,8 @@ class string_manager {
 
     protected function add_extra_locations($locations, $extralocations) {
         // This is an old, deprecated mechanism that predates the
-        // places_to_search_for_lang_strings mechanism that comes later in
-        // this function. So tell people who use it to change.
+        // current mechanism that lets plugins include their lang strings in the
+        // plugin folder. So tell people who use it to change.
         debugging('The fourth, $extralocations parameter to get_string is deprecated. ' .
                 'See http://docs.moodle.org/en/Development:Places_to_search_for_lang_strings ' .
                 'for a better way to package language strings with your plugin.', DEBUG_DEVELOPER);