Commit 473f237f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Strip all html out of descriptions when listing views in my views, new views & group views blocks


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 6c20b69e
......@@ -6,7 +6,7 @@
<tr class="{cycle values='r0,r1'}">
<td>
<a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title}</a>
<div>{$view.shortdescription}</div>
<div>{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
{if $view.template}
<div><a href="">{str tag=copythisview section=view}</a></div>
......@@ -36,7 +36,7 @@
{$view.sharedby}
{/if}
{/if}
<div>{$view.shortdescription}</div>
<div>{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
{if $view.template}
<div><a href="">{str tag=copythisview section=view}</a></div>
......@@ -90,7 +90,7 @@
{if $view.submittedtime}
<span class="date s"><br />({str tag=timeofsubmission section=view}: {$view.submittedtime|format_date})</span>
{/if}
<div>{$view.shortdescription}</div>
<div>{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
</td>
</tr>
......
......@@ -5,7 +5,7 @@
<td class="{cycle values='r0,r1'}">
<h4><a href="{$WWWROOT}view/view.php?id={$item.id}">{$item.title}</a></h4>
{if $item.description}
<div class="details">{$item.description|str_shorten_html:100:true|safe}</div>
<div class="details">{$item.description|str_shorten_html:100:true|strip_tags|safe}</div>
{/if}
{if $item.tags}
<div class="tags s"><label>{str tag=tags}:</label> {list_tags owner=$item.owner tags=$item.tags}</div>
......
......@@ -3,7 +3,7 @@
{foreach from=$views item=view}
<tr class="{cycle values='r0,r1'}">
<td><h4><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title}</a></h4>
<div class="details">{$view.shortdescription|safe|clean_html}</div></td>
<div class="details">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div></td>
{if $view.sharedby}
<td class="right">
{if $view.group && $loggedin}
......
......@@ -2832,7 +2832,6 @@ class View {
$institutions['mahara']->displayname = get_config('sitename');
}
foreach ($viewdata as &$v) {
$v->shortdescription = str_shorten_html(str_replace('<br />', ' ', $v->description), 100, true);
if ($v->owner) {
$v->sharedby = View::owner_name($v->ownerformat, $owners[$v->owner]);
$v->user = $owners[$v->owner];
......
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