Commit ae74c4b7 authored by Nigel McNie's avatar Nigel McNie
Browse files

Remember the category and new setting on the layout page

parent 5496ee63
......@@ -18,7 +18,7 @@
<div id="blocktype-footer"></div>
</div>
<a id="layout-link" href="layout.php?id=1"{if !$can_change_layout} style="display: none;"{/if}>Change View Layout</a>
<a id="layout-link" href="layout.php?id=1&c={$category}&new={$new}"{if !$can_change_layout} style="display: none;"{/if}>Change View Layout</a>
<div id="bottom-pane">
<div id="column-container">
......
......@@ -33,6 +33,8 @@ require_once('view.php');
define('TITLE', 'Views Layout [DANGER construction site]');
$id = param_integer('id');
$new = param_boolean('new');
$category = param_alpha('c');
$view = new View($id);
if ($view->get('numcolumns') > 1) {
......@@ -43,7 +45,7 @@ if ($view->get('numcolumns') > 1) {
}
}
else {
redirect('/view/blocks.php?id=' . $id);
redirect('/view/blocks.php?id=' . $id . '&c=' . $category . '&new=' . $new);
}
// NOTE: not building the form, that's left to the template
......@@ -69,11 +71,11 @@ $smarty->assign('options', $options);
$smarty->display('view/layout.tpl');
function viewlayout_submit(Pieform $form, $values) {
global $view, $SESSION;
global $view, $SESSION, $category, $new;
$view->set('layout', $values['layout']);
$view->commit();
$SESSION->add_ok_msg('View layout changed');
redirect('/view/blocks.php?id=' . $view->get('id'));
redirect('/view/blocks.php?id=' . $view->get('id') . '&c=' . $category . '&new=' . $new);
}
?>
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