Commit d72aeaf3 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove view title display logic from my views template (bug #860154)



As a result of profile view access changes in bug #807278, profile
views are displayed on the share page.  So the 'editing' version
of view titles needs to be displayed in two places (my views/
group views etc., and on the share page).  It makes sense to use
the same View methods in both cases, and remove the old logic to
get the view title and url from the template.

Change-Id: Ifa36651dc3358acd71ca63407df79799ddd47299
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 1661f54e
......@@ -2505,7 +2505,7 @@ class View {
$userid = (!$groupid && !$institution) ? $USER->get('id') : null;
$select = '
SELECT v.id,v.title,v.description,v.type,v.mtime,v.locked';
SELECT v.id, v.title, v.description, v.type, v.mtime, v.owner, v.group, v.institution, v.locked';
$from = '
FROM {view} v';
$where = '
......@@ -2550,10 +2550,13 @@ class View {
$data = array();
if ($viewdata) {
for ($i = 0; $i < count($viewdata); $i++) {
$view = new View(0, $viewdata[$i]);
$view->set('dirty', false);
$index[$viewdata[$i]->id] = $i;
$data[$i]['id'] = $viewdata[$i]->id;
$data[$i]['type'] = $viewdata[$i]->type;
$data[$i]['title'] = $viewdata[$i]->title;
$data[$i]['displaytitle'] = $view->display_title_editing();
$data[$i]['url'] = $view->get_url();
$data[$i]['mtime'] = $viewdata[$i]->mtime;
$data[$i]['locked'] = $viewdata[$i]->locked;
$data[$i]['removable'] = self::can_remove_viewtype($viewdata[$i]->type);
......
......@@ -23,16 +23,7 @@
{foreach from=$views item=view}
<tr class="{cycle values='r0,r1'}">
<td>
{if $view.type == 'profile'}
<h3><a href="{$WWWROOT}user/view.php">{str tag=profileviewtitle section=view}</a></h3>
{elseif $view.type == 'dashboard'}
<h3><a href="{$WWWROOT}">{str tag=dashboardviewtitle section=view}</a></h3>
{elseif $view.type == 'grouphomepage'}
<h3><a href="{$WWWROOT}group/view.php?id={$GROUP->id}">{str tag=grouphomepage section=view}</a></h3>
{else}
<h3><a href="{$WWWROOT}view/view.php?id={$view.id}">{$view.title}</a></h3>
{/if}
<h3><a href="{$view.url}">{$view.displaytitle}</a></h3>
{if $view.submittedto}
<div class="submitted-viewitem">{$view.submittedto|clean_html|safe}</div>
{elseif $view.type == 'profile'}
......
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