Skip to content
Browse files

MDL-28489 site news forum - support multilang filter

  • Loading branch information...
1 parent b7424c7 commit 65ab1ffa5bba3f4051a9f3109b648f6b7479e37e @stronk7 stronk7 committed with Sam Hemelryk Aug 29, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 index.php
View
12 index.php
@@ -153,7 +153,13 @@
if (! $newsforum = forum_get_course_forum($SITE->id, 'news')) {
print_error('cannotfindorcreateforum', 'forum');
}
- echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower($newsforum->name)), array('href'=>'#skipsitenews', 'class'=>'skip-block'));
+
+ // fetch news forum context for proper filtering to happen
+ $newsforumcm = get_coursemodule_from_instance('forum', $newsforum->id, $SITE->id, false, MUST_EXIST);
+ $newsforumcontext = get_context_instance(CONTEXT_MODULE, $newsforumcm->id, MUST_EXIST);
+
+ $forumname = format_string($newsforum->name, true, array('context' => $newsforumcontext));
+ echo html_writer::tag('a', get_string('skipa', 'access', moodle_strtolower(strip_tags($forumname))), array('href'=>'#skipsitenews', 'class'=>'skip-block'));
if (isloggedin()) {
$SESSION->fromdiscussion = $CFG->wwwroot;
@@ -165,11 +171,11 @@
} else {
$subtext = get_string('subscribe', 'forum');
}
- echo $OUTPUT->heading($newsforum->name, 2, 'headingblock header');
+ echo $OUTPUT->heading($forumname, 2, 'headingblock header');
$suburl = new moodle_url('/mod/forum/subscribe.php', array('id' => $newsforum->id, 'sesskey' => sesskey()));
echo html_writer::tag('div', html_writer::link($suburl, $subtext), array('class' => 'subscribelink'));
} else {
- echo $OUTPUT->heading($newsforum->name, 2, 'headingblock header');
+ echo $OUTPUT->heading($forumname, 2, 'headingblock header');
}
forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');

0 comments on commit 65ab1ff

Please sign in to comment.
Something went wrong with that request. Please try again.