Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34148: Instead of using the module name from the filesystem, the …

…blog menu now fetches the module name with get_string().
  • Loading branch information...
commit d6d00b134e0d0b06f287dc815c004288b2a12496 1 parent 5d32507
@eriklundberg eriklundberg authored danpoltawski committed
Showing with 7 additions and 4 deletions.
  1. +7 −4 blog/lib.php
View
11 blog/lib.php
@@ -611,11 +611,14 @@ function blog_get_options_for_module($module, $user=null) {
$canparticipate = (is_enrolled($modcontext) or is_viewing($modcontext));
if (has_capability('moodle/blog:view', $modcontext)) {
+ // Save the correct module name for later usage
+ $module_name = strtolower(get_string('modulename', $module->modname));
+
// We can view!
if ($CFG->bloglevel >= BLOG_SITE_LEVEL) {
// View all entries about this module
$a = new stdClass;
- $a->type = $module->modname;
+ $a->type = $module_name;
$options['moduleview'] = array(
'string' => get_string('viewallmodentries', 'blog', $a),
'link' => new moodle_url('/blog/index.php', array('modid'=>$module->id))
@@ -623,13 +626,13 @@ function blog_get_options_for_module($module, $user=null) {
}
// View MY entries about this module
$options['moduleviewmine'] = array(
- 'string' => get_string('viewmyentriesaboutmodule', 'blog', $module->modname),
+ 'string' => get_string('viewmyentriesaboutmodule', 'blog', $module_name),
'link' => new moodle_url('/blog/index.php', array('modid'=>$module->id, 'userid'=>$USER->id))
);
if (!empty($user) && ($CFG->bloglevel >= BLOG_SITE_LEVEL)) {
// View the given users entries about this module
$a = new stdClass;
- $a->mod = $module->modname;
+ $a->mod = $module_name;
$a->user = fullname($user);
$options['moduleviewuser'] = array(
'string' => get_string('blogentriesbyuseraboutmodule', 'blog', $a),
@@ -641,7 +644,7 @@ function blog_get_options_for_module($module, $user=null) {
if (has_capability('moodle/blog:create', $sitecontext) and $canparticipate) {
// The user can blog about this module
$options['moduleadd'] = array(
- 'string' => get_string('blogaboutthismodule', 'blog', $module->modname),
+ 'string' => get_string('blogaboutthismodule', 'blog', $module_name),
'link' => new moodle_url('/blog/edit.php', array('action'=>'add', 'modid'=>$module->id))
);
}
Please sign in to comment.
Something went wrong with that request. Please try again.