Skip to content

Commit

Permalink
MDL-47365 mod_forum: Add permalink to forum posts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 12, 2016
1 parent 2f45a11 commit 75debb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions mod/forum/lang/en/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
$string['page-mod-forum-discuss'] = 'Forum module discussion thread page';
$string['parent'] = 'Show parent';
$string['parentofthispost'] = 'Parent of this post';
$string['permalink'] = 'Permalink';
$string['posttomygroups'] = 'Post a copy to all groups';
$string['posttomygroups_help'] = 'Posts a copy of this message to all groups you have access to. Participants in groups you do not have access to will not see this post';
$string['prevdiscussiona'] = 'Previous discussion: {$a}';
Expand Down
5 changes: 5 additions & 0 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3190,6 +3190,11 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
// Prepare an array of commands
$commands = array();

// Add a permalink.
$permalink = new moodle_url($discussionlink);
$permalink->set_anchor('p' . $post->id);
$commands[] = array('url' => $permalink, 'text' => get_string('permalink', 'forum'));

// SPECIAL CASE: The front page can display a news item post to non-logged in users.
// Don't display the mark read / unread controls in this case.
if ($istracked && $CFG->forum_usermarksread && isloggedin()) {
Expand Down

0 comments on commit 75debb4

Please sign in to comment.