Commit 2dd689fe authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't double escape latest view headings; move clean_html call into template


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 0dc1f7d1
{if $views}
<ul class="viewlist">
{foreach from=$views item=view}
<div><strong><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a></strong></div>
<div>{$view.shortdescription}</div>
{if $view.sharedby}
<div>
{if $view.group && $loggedin}
<a href="{$WWWROOT}group/view.php?id={$view.group|escape}">{$view.sharedby|escape}</a>
{elseif $view.owner && $loggedin}
<a href="{$WWWROOT}user/view.php?id={$view.owner|escape}">{$view.sharedby|escape}</a>
{else}
{$view.sharedby|escape}
<li>
<div><strong><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title}</a></strong></div>
<div>{$view.shortdescription|safe|clean_html}</div>
{if $view.sharedby}
<div>
{if $view.group && $loggedin}
<a href="{$WWWROOT}group/view.php?id={$view.group}">{$view.sharedby}</a>
{elseif $view.owner && $loggedin}
<a href="{$WWWROOT}user/view.php?id={$view.owner}">{$view.sharedby}</a>
{else}
{$view.sharedby}
{/if}
<span class="postedon">
{if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view.mtime|strtotime|format_date:'strftimedate'}
</span>
</div>
{/if}
<span class="postedon">
{if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view.mtime|strtotime|format_date:'strftimedate'}
</span>
</div>
{/if}
</li>
{/foreach}
</ul>
{else}
{str tag=noviews section=view}
{/if}
......@@ -2566,7 +2566,7 @@ class View {
$institutions['mahara']->displayname = get_config('sitename');
}
foreach ($viewdata as &$v) {
$v->shortdescription = clean_html(str_shorten_html(str_replace('<br />', ' ', $v->description), 100, true));
$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]);
} else if ($v->group) {
......
......@@ -1642,3 +1642,14 @@ form#search input.text {
.help, .help a, .help a img {
vertical-align: top;
}
ul.viewlist {
list-style: none;
margin: 0 0 0 0.25em;
}
ul.viewlist li:first-child {
margin: 0;
}
ul.viewlist li {
margin: 0.75em 0 0;
}
......@@ -50,7 +50,7 @@
{$view.sharedby}
{/if}
{/if}
<div>{$view.shortdescription}</div>
<div>{$view.shortdescription|clean_html}</div>
{if $view.tags}<div class="tags">{str tag=tags}: {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
{if $view.template}
<div><a href="">{str tag=copythisview section=view}</a></div>
......
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