Commit 404ca468 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean urls in watchlist block



Bug #1006634, part 3

Passes the view records through get_extra_view_info.

Change-Id: I71fbf2e56bee243a1cd4590aefaa3a0ebfe3841d
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 0ed69fcf
......@@ -58,15 +58,15 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
$smarty = smarty_core();
$sql =
'SELECT v.title, v.id
$sql = '
SELECT v.id, v.title, v.owner, v.group, v.institution, v.ownerformat, v.urlid
FROM {view} v
JOIN {usr_watchlist_view} wv ON wv.view = v.id
WHERE wv.usr = ?
ORDER BY v.title
LIMIT ?';
$results = get_records_sql_array($sql, array($userid, $limit));
$results = get_records_sql_assoc($sql, array($userid, $limit));
// if there are no watched views, notify the user
if (!$results) {
......@@ -74,8 +74,13 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
return $smarty->fetch('blocktype:watchlist:watchlist.tpl');
}
View::get_extra_view_info($results, false, false);
foreach ($results as &$r) {
$r = (object) $r;
}
$smarty->assign('blockid', 'blockinstance_' . $instance->get('id'));
$smarty->assign('views', $results);
$smarty->assign('views', array_values($results));
return $smarty->fetch('blocktype:watchlist:watchlist.tpl');
}
......
......@@ -5,7 +5,7 @@
{foreach $views as item=view}
<tr>
<td class="{cycle values='r0,r1'}">
<h4><a href="{$WWWROOT}view/view.php?id={$view->id}" class="watchlist-showview">{$view->title}</a></h4>
<h4><a href="{$view->fullurl}" class="watchlist-showview">{$view->title}</a></h4>
</td>
</tr>
{/foreach}
......
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