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} {if $views}
<ul class="viewlist">
{foreach from=$views item=view} {foreach from=$views item=view}
<div><strong><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title|escape}</a></strong></div> <li>
<div>{$view.shortdescription}</div> <div><strong><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title}</a></strong></div>
{if $view.sharedby} <div>{$view.shortdescription|safe|clean_html}</div>
<div> {if $view.sharedby}
{if $view.group && $loggedin} <div>
<a href="{$WWWROOT}group/view.php?id={$view.group|escape}">{$view.sharedby|escape}</a> {if $view.group && $loggedin}
{elseif $view.owner && $loggedin} <a href="{$WWWROOT}group/view.php?id={$view.group}">{$view.sharedby}</a>
<a href="{$WWWROOT}user/view.php?id={$view.owner|escape}">{$view.sharedby|escape}</a> {elseif $view.owner && $loggedin}
{else} <a href="{$WWWROOT}user/view.php?id={$view.owner}">{$view.sharedby}</a>
{$view.sharedby|escape} {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} {/if}
<span class="postedon"> </li>
{if $view.mtime == $view.ctime}{str tag=Created}{else}{str tag=Updated}{/if}
{$view.mtime|strtotime|format_date:'strftimedate'}
</span>
</div>
{/if}
{/foreach} {/foreach}
</ul>
{else} {else}
{str tag=noviews section=view} {str tag=noviews section=view}
{/if} {/if}
...@@ -2566,7 +2566,7 @@ class View { ...@@ -2566,7 +2566,7 @@ class View {
$institutions['mahara']->displayname = get_config('sitename'); $institutions['mahara']->displayname = get_config('sitename');
} }
foreach ($viewdata as &$v) { 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) { if ($v->owner) {
$v->sharedby = View::owner_name($v->ownerformat, $owners[$v->owner]); $v->sharedby = View::owner_name($v->ownerformat, $owners[$v->owner]);
} else if ($v->group) { } else if ($v->group) {
......
...@@ -1642,3 +1642,14 @@ form#search input.text { ...@@ -1642,3 +1642,14 @@ form#search input.text {
.help, .help a, .help a img { .help, .help a, .help a img {
vertical-align: top; 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 @@ ...@@ -50,7 +50,7 @@
{$view.sharedby} {$view.sharedby}
{/if} {/if}
{/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.tags}<div class="tags">{str tag=tags}: {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
{if $view.template} {if $view.template}
<div><a href="">{str tag=copythisview section=view}</a></div> <div><a href="">{str tag=copythisview section=view}</a></div>
......
Supports Markdown
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