Commit 1661f54e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Overwrite the profile view title on the Share page (bug #860154)



The profile view title is now displayed on the share page, due to
recent changes in profile view access (see bug #807278).  However
the view title from the database is now displayed on the share page
instead of the translatable string.

Change-Id: Ic691469731923faa0cef0c204b1207a9152e9fe2
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent cfa75df1
......@@ -3531,6 +3531,19 @@ class View {
return $title;
}
public function display_title_editing() {
if ($this->type == 'profile') {
return get_string('profileviewtitle', 'view');
}
if ($this->type == 'dashboard') {
return get_string('dashboardviewtitle', 'view');
}
if ($this->type == 'grouphomepage') {
return get_string('grouphomepage', 'view');
}
return $this->title;
}
public function visit_message() {
$visitcountstart = max(get_config('stats_installation_time'), $this->ctime);
$visitcountend = get_config('viewloglatest');
......@@ -3798,10 +3811,20 @@ class View {
}
foreach ($records as &$r) {
// Construct a View object temporarily just so we can use display_title_editing, get_url
$view = new View(0, array(
'id' => $r->vid,
'title' => $r->vname,
'type' => $r->vtype,
'owner' => $owner,
'group' => $group,
));
$view->set('dirty', false);
$v = array(
'id' => $r->vid,
'type' => $r->vtype,
'name' => $r->vname,
'name' => $view->display_title_editing(),
'url' => $view->get_url(),
'startdate' => $r->startdate,
'stopdate' => $r->stopdate,
'template' => $r->template,
......
<tr class="{cycle values='r0,r1'}">
<td class="cv"><a href="{$WWWROOT}view/view.php?id={$item.viewid}">{$item.name|str_shorten_text:50:true}</a></td>
<td class="cv"><a href="{$item.url}">{$item.name|str_shorten_text:50:true}</a></td>
<td class="al">
{if $item.access}<div>{$item.access}</div>{/if}
{if $item.accessgroups}
......
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