Commit a7f35154 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Shorten forum posts in internal notifications and don't double-escape subject


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 88850291
......@@ -11,21 +11,21 @@
</td>
<td>
{if $i->message}
<a href="" class="inbox-showmessage{if !$i->read} unread{/if}">{$i->subject|escape}</a>
<div class="inbox-message hidden" id="inbox-message-{$i->id}">{$i->message|clean_html}
<a href="" class="inbox-showmessage{if !$i->read} unread{/if}">{$i->subject}</a>
<div class="inbox-message hidden" id="inbox-message-{$i->id}">{$i->message}
{if $i->url}<br><a href="{$i->url|escape}" class="s">{if $i->urltext}{$i->urltext|escape} &raquo;{else}{str tag="more..."}{/if}</a>{/if}
</div>
{elseif $i->url}
<a href="{$i->url|escape}">{$i->subject|escape}</a>
<a href="{$i->url}">{$i->subject}</a>
{else}
{$i->subject|escape}
{$i->subject}
{/if}
</td>
</tr>
{/foreach}
</table>
{if $desiredtypes}
<a href="{$WWWROOT}account/activity?type={$desiredtypes|escape}">{str tag=More section=blocktype.inbox} &raquo;</a>
<a href="{$WWWROOT}account/activity?type={$desiredtypes}">{str tag=More section=blocktype.inbox} &raquo;</a>
{/if}
<script>
{literal}
......
......@@ -499,10 +499,11 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$posttime = strftime(get_string('strftimedaydatetime'), $post->ctime);
$htmlbody = $post->body;
$this->message = str_shorten_html($htmlbody, 200, true); // For internal notification
$textbody = trim(html2text($post->body));
$postlink = get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topicid . '#post' . $this->postid;
$this->message = $textbody;
$this->url = $postlink;
$this->add_urltext(array(
'key' => 'Topic',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment