Commit 3b2ee711 authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Fix loop bug with back button on various view pages



Affected the following:
- view/view.php
- view/artefact.php
- user/view.php

Works by using javascript to go back. If javascript is
not available, then no back button is displayed.

Bug #628113

Change-Id: I91fbc873e8e59d4ac779ec4cc2a9f8f5efbe942e
Signed-off-by: default avatarHugh Davenport <hugh@catalyst.net.nz>
parent bc4cc476
......@@ -13,8 +13,8 @@
{foreach from=$microheaderlinks item=item}
<a class="btn" href="{$item.url}">{$item.name}</a>
{/foreach}
{elseif $backurl}<a class="btn" href="{$backurl}">{str tag=back}</a>
{/if}
<a class="btn nojs-hidden-inline" href="javascript:history.back()">{str tag=back}</a>
</div>
<div class="fl">
<a class="small-logo" href="{$WWWROOT}"><img src="{theme_url filename='images/site-logo-small.png'}" alt="{$sitename}"></a>
......
......@@ -298,9 +298,6 @@ if (get_config('viewmicroheaders')) {
);
$smarty->assign('microheaderlinks', $microheaderlinks);
}
if (isset($_SERVER['HTTP_REFERER'])) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
}
else {
if ($loggedinid && $loggedinid == $userid) {
......
......@@ -164,14 +164,6 @@ $smarty->assign('INLINEJAVASCRIPT', $inlinejavascript);
if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
$smarty->assign('microheadertitle', $view->display_title(true, false));
if ($USER->is_logged_in()) {
if (!empty($_SERVER['HTTP_REFERER'])) {
$page = get_config('wwwroot') . 'view/artefact.php?id=' . $artefactid . '&view=' . $viewid;
if ($_SERVER['HTTP_REFERER'] != $page) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
}
}
}
$smarty->assign('viewid', $viewid);
......
......@@ -237,14 +237,6 @@ if (get_config('viewmicroheaders')) {
$smarty->assign('microheaderlinks', $microheaderlinks);
}
if ($USER->is_logged_in()) {
if (!empty($_SERVER['HTTP_REFERER'])) {
$page = get_config('wwwroot') . 'view/view.php?id=' . $viewid . ($new ? '&new=1' : '');
if ($_SERVER['HTTP_REFERER'] != $page) {
$smarty->assign('backurl', $_SERVER['HTTP_REFERER']);
}
}
}
}
else if ($can_edit) {
$smarty->assign('editurl', get_config('wwwroot') . 'view/blocks.php?id=' . $viewid . ($new ? '&new=1' : ''));
......
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