From: tjhunt Date: Thu, 2 Apr 2009 09:37:29 +0000 (+0000) Subject: lang editing: MDL-18776 fix regression from MDL-18669. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d8413bf3d2ee5e02b6f91ec46e5d6a27f2c954c7;p=moodle.git lang editing: MDL-18776 fix regression from MDL-18669. --- diff --git a/admin/lang.php b/admin/lang.php index f20cc1225d..eac9c15c14 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -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) { diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 0869278036..7ece4cffad 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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);