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;
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;
}
// 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;
}
}