From d4080dcdbd71c8522bd06cb6cd8934bdd9c4fe1d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 1 Nov 2017 12:19:27 -0400 Subject: [PATCH] when saving a new layout, auto-select it --- web/includes/actions.php | 4 ++++ web/skins/classic/views/montage.php | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/includes/actions.php b/web/includes/actions.php index 08496809f..1d8ae70f4 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -694,6 +694,10 @@ if ( canEdit( 'System' ) ) { } $Layout->Positions( $_REQUEST['Positions'] ); $Layout->save(); + session_start(); + $_SESSION['zmMontageLayout'] = $Layout->Id(); + session_write_close(); + unset( $_COOKIE['zmMontageLayout'] ); } // end if save } else if ( $_REQUEST['object'] == 'server' ) { diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index 60f605f16..d4f058212 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -65,11 +65,15 @@ foreach ( $layouts as $l ) { $layoutsById[$l->Id()] = $l->Name(); } -$layout = ''; -if ( isset($_COOKIE['zmMontageLayout']) ) - $layout = $_COOKIE['zmMontageLayout']; session_start(); + +$layout = ''; +if ( isset($_COOKIE['zmMontageLayout']) ) + $layout = $_SESSION['zmMontageLayout'] = $_COOKIE['zmMontageLayout']; +elseif ( isset($_SESSION['zmMontageLayout']) ) + $layout = $_SESSION['zmMontageLayout']; + $options = array(); if ( isset($_COOKIE['zmMontageWidth']) and $_COOKIE['zmMontageWidth'] ) { $_SESSION['zmMontageWidth'] = $options['width'] = $_COOKIE['zmMontageWidth'];