From dd06db0bf0e39a912738e5fbc9898352e27ad33b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 23 Mar 2016 15:54:20 -0400 Subject: [PATCH 1/2] remove duplication --- web/skins/classic/views/options.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 4011d423b..93f013f56 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -64,18 +64,9 @@ xhtmlHeaders( __FILE__, translate('Options') ); $value ) { - if ( $tab == $name ) - { ?> -
  • + > -
  • - From 757740ede5d76853b64e90f5d948c03ce5336784 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 23 Mar 2016 16:12:51 -0400 Subject: [PATCH 2/2] Move skin and css changing up above the include of header.php so that the set cookie call will work --- web/skins/classic/views/options.php | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 93f013f56..2cde77a03 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -54,6 +54,29 @@ else $focusWindow = true; xhtmlHeaders( __FILE__, translate('Options') ); + +# Have to do this stuff up here before including header.php because fof the cookie setting +$skin_options = array_map( 'basename', glob('skins/*',GLOB_ONLYDIR) ); +if($tab == 'skins') { + $current_skin = $_COOKIE['zmSkin']; + $reload = false; + if ( isset($_GET['skin-choice']) && ( $_GET['skin-choice'] != $current_skin ) ) { + setcookie('zmSkin',$_GET['skin-choice'], time()+3600*24*30*12*10 ); + //header("Location: index.php?view=options&tab=skins&reset_parent=1"); + $reload = true; + } + $current_css = $_COOKIE['zmCSS']; +Error("Current css $current_css"); + if ( isset($_GET['css-choice']) and ( $_GET['css-choice'] != $current_css ) ) { +Error("setting css $current_css to " . $_GET['css-choice']); + setcookie('zmCSS',$_GET['css-choice'], time()+3600*24*30*12*10 ); + //header("Location: index.php?view=options&tab=skins&reset_parent=1"); + $reload = true; + } + if ( $reload ) + echo ""; +} # end if tab == skins + ?> @@ -73,25 +96,7 @@ foreach ( $tabs as $name=>$value )
    window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\""; - ?>