Commit 6c6c24e7 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use clean urls in profile sideblock



Bug #1006634, part 3

Only affects views that the owner has tagged 'profile'.

Change-Id: Id4a6b641ab46e6cf105d9dbf295fb16f8d343987
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent ef835efe
......@@ -2449,13 +2449,21 @@ function profile_sideblock() {
$data['pendingfriendsmessage'] = $data['pendingfriends'] == 1 ? get_string('pendingfriend') : get_string('pendingfriends');
$data['groups'] = group_get_user_groups($USER->get('id'));
$data['views'] = get_records_sql_array(
'SELECT v.id, v.title
'SELECT v.id, v.title, v.urlid, v.owner
FROM {view} v
INNER JOIN {view_tag} vt ON (vt.tag = ? AND vt.view = v.id)
WHERE v.owner = ?
ORDER BY v.title',
array(get_string('profile'), $USER->get('id'))
);
if ($data['views']) {
require_once('view.php');
foreach($data['views'] as $v) {
$view = new View(0, (array)$v);
$view->set('dirty', false);
$v->fullurl = $view->get_url();
}
}
$data['artefacts'] = get_records_sql_array(
'SELECT a.id, a.artefacttype, a.title
FROM {artefact} a
......
......@@ -32,7 +32,7 @@
<li id="views"><label><a href="{$WWWROOT}view/">{str tag="views"}:</a></label>
<ul>
{foreach from=$sbdata.views item=view}
<li><a href="{$WWWROOT}view/view.php?id={$view->id}">{$view->title}</a></li>
<li><a href="{$view->fullurl}">{$view->title}</a></li>
{/foreach}
</ul>
</li>
......
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