Public bug reported:

Now we are using $_SERVER['HTTP_REFERER'] to get a previous view page.
But for example the following 2nd case, we can not go back to the Top Page.

1. Top Page > Links and Resources > Site view 001 > Back > Top Page
2. Top Page > Links and Resources > Site view 001 > Public view by user001 > 
Back > Site view 001 > Back > public view by user001 > Back > Site view 001

So how about changing view/view.php as below?

File: view/view.php
Line: 179

[ Before ]
if ($USER->is_logged_in() && !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']);
    }
}

[ After ]
if ($USER->is_logged_in() && !empty($_SERVER['HTTP_REFERER'])) {
    $page = get_config('wwwroot') . 'view/view.php?id=' . $viewid . ($new ? 
'&new=1' : '');
    if ($_SERVER['HTTP_REFERER'] != $page) {
        $smarty->assign('backurl', 'javascript:history.back()');
    }
}

** Affects: mahara
     Importance: Wishlist
         Status: New

-- 
Using javascript for Back link
https://bugs.launchpad.net/bugs/628113
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.

Status in Mahara ePortfolio: New

Bug description:
Now we are using $_SERVER['HTTP_REFERER'] to get a previous view page.
But for example the following 2nd case, we can not go back to the Top Page.

1. Top Page > Links and Resources > Site view 001 > Back > Top Page
2. Top Page > Links and Resources > Site view 001 > Public view by user001 > 
Back > Site view 001 > Back > public view by user001 > Back > Site view 001

So how about changing view/view.php as below?

File: view/view.php
Line: 179

[ Before ]
if ($USER->is_logged_in() && !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']);
    }
}

[ After ]
if ($USER->is_logged_in() && !empty($_SERVER['HTTP_REFERER'])) {
    $page = get_config('wwwroot') . 'view/view.php?id=' . $viewid . ($new ? 
'&new=1' : '');
    if ($_SERVER['HTTP_REFERER'] != $page) {
        $smarty->assign('backurl', 'javascript:history.back()');
    }
}



_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to