Skip to content

Commit

Permalink
MDL-22015 fixed more string_manager encapsulation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Apr 14, 2010
1 parent db975a4 commit ecd7978
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ function stripslashes_deep($value) {
// 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;
}
}
Expand Down

0 comments on commit ecd7978

Please sign in to comment.