From ecd7978c0590133c38e83e62e51148144354b906 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 14 Apr 2010 14:38:33 +0000 Subject: [PATCH] MDL-22015 fixed more string_manager encapsulation issues --- admin/blocks.php | 2 +- admin/modules.php | 4 ++-- lib/setup.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/blocks.php b/admin/blocks.php index 44b35d02266..b2f2a212ec2 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -51,7 +51,7 @@ print_error('blockdoesnotexist', 'error'); } - if (file_exists("$CFG->dirroot/blocks/$block->name/lang/en/block_$block->name.php")) { + if (get_string_manager()->string_exists('pluginname', "block_$block->name")) { $strblockname = get_string('pluginname', "block_$block->name"); } else { $strblockname = $block->name; diff --git a/admin/modules.php b/admin/modules.php index 2a3c8f24065..d95c5ec67b0 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -74,8 +74,8 @@ echo $OUTPUT->header(); echo $OUTPUT->heading($stractivities); - if (file_exists("$CFG->dirroot/mod/$delete/lang/en/$delete.php")) { - $strmodulename = get_string("modulename", "$delete"); + if (get_string_manager()->string_exists('modulename', $delete)) { + $strmodulename = get_string('modulename', $delete); } else { $strmodulename = $delete; } diff --git a/lib/setup.php b/lib/setup.php index 7f62cd37855..b6571ddbeb2 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -582,7 +582,7 @@ if (!isset($CFG->theme)) { // majority of cases), use the stored locale specified by admin. // note: do not accept lang parameter from POST if (isset($_GET['lang']) and ($lang = optional_param('lang', '', PARAM_SAFEDIR))) { - if (file_exists($CFG->langotherroot.'/'.$lang) or file_exists($CFG->dirroot.'/lang/'.$lang)) { + if (get_string_manager()->translation_exists($lang, false)) { $SESSION->lang = $lang; } } -- 2.43.0