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

Fix malformed 'display page' urls when cleanurls are enabled



The editviewtabs.tpl template assumed that view urls contained a query
string.  This is no longer true, so the 'new' parameter is now added
in view/(edit|layout|blocks).php rather than inside the template.

Change-Id: I5b2cc7e937834bea3379f409fee1ec19687b3441
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 93d4824a
......@@ -3,6 +3,6 @@
{if $edittitle}<li {if $selected == 'title'} class="current-tab"{/if}><a{if $selected == 'title'} class="current-tab"{/if} href="{$WWWROOT}view/edit.php?id={$viewid}{if $new}&new=1{/if}">{str tag=edittitleanddescription section=view}</a></li>{/if}
<li {if $selected == 'layout'} class="current-tab"{/if}><a{if $selected == 'layout'} class="current-tab"{/if} href="{$WWWROOT}view/layout.php?id={$viewid}{if $new}&new=1{/if}">{str tag=editlayout section=view}</a></li>
<li {if $selected == 'content'} class="current-tab"{/if}><a{if $selected == 'content'} class="current-tab"{/if} href="{$WWWROOT}view/blocks.php?id={$viewid}{if $new}&new=1{/if}">{str tag=editcontent section=view}</a></li>
<li class="displaypage"><a href="{$displaylink}{if $new}&new=1{/if}">{str tag=displayview section=view} &raquo;</a></li>
<li class="displaypage"><a href="{$displaylink}">{str tag=displayview section=view} &raquo;</a></li>
{if $edittitle || $viewtype == 'profile'}<li class="sharepage"><a href="{$WWWROOT}view/access.php?id={$viewid}{if $new}&new=1{/if}">{str tag=shareview section=view} &raquo;</a></li>{/if}
</ul></div>
......@@ -180,8 +180,12 @@ foreach (array_keys($_POST + $_GET) as $key) {
}
$viewid = $view->get('id');
$displaylink = $view->get_url();
if ($new) {
$displaylink .= (strpos($displaylink, '?') === false ? '?' : '&') . 'new=1';
}
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
$smarty->assign('displaylink', $displaylink);
$smarty->assign('formurl', get_config('wwwroot') . 'view/blocks.php');
$smarty->assign('category', $category);
$smarty->assign('new', $new);
......
......@@ -228,12 +228,17 @@ function editview_submit(Pieform $form, $values) {
redirect('/view/blocks.php?id=' . $view->get('id'));
}
$displaylink = $view->get_url();
if ($new) {
$displaylink .= (strpos($displaylink, '?') === false ? '?' : '&') . 'new=1';
}
$smarty = smarty(array(), array(), array(), array('sidebars' => false));
$smarty->assign('editview', $editview);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
$smarty->assign('displaylink', $displaylink);
$smarty->assign('new', $new);
if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
......
......@@ -71,6 +71,11 @@ $layoutform = new Pieform(array(
),
));
$displaylink = $view->get_url();
if ($new) {
$displaylink .= (strpos($displaylink, '?') === false ? '?' : '&') . 'new=1';
}
$smarty = smarty(array(), array(), array(), array('sidebars' => false));
$smarty->assign('layouts', $layouts);
$smarty->assign('currentlayout', $currentlayout);
......@@ -81,7 +86,7 @@ $smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewtype', $view->get('type'));
$smarty->assign('viewtitle', $view->get('title'));
$smarty->assign('edittitle', $view->can_edit_title());
$smarty->assign('displaylink', $view->get_url());
$smarty->assign('displaylink', $displaylink);
$smarty->assign('new', $new);
if (get_config('viewmicroheaders')) {
$smarty->assign('microheaders', true);
......
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