summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-09-11 12:53:15 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-09-11 12:53:15 +0000
commitf69b0089bb417bdecbf1c3a655e5bba0d67e92fe (patch)
treefafcd3315c36152358707f7e94b5f7f2738bbf5f
parent2f5f99e0b32f042aba7bd6b540ffef84230e7d03 (diff)
downloadthemes-f69b0089bb417bdecbf1c3a655e5bba0d67e92fe.tar.gz
themes-f69b0089bb417bdecbf1c3a655e5bba0d67e92fe.tar.bz2
themes-f69b0089bb417bdecbf1c3a655e5bba0d67e92fe.zip
change behaviour of theme manager - require user approval before storing setting
-rw-r--r--admin/admin_themes_manager.php22
-rw-r--r--templates/admin_themes_manager.tpl9
-rw-r--r--templates/header_inc.tpl7
3 files changed, 30 insertions, 8 deletions
diff --git a/admin/admin_themes_manager.php b/admin/admin_themes_manager.php
index 2f9e660..2fa649c 100644
--- a/admin/admin_themes_manager.php
+++ b/admin/admin_themes_manager.php
@@ -11,15 +11,25 @@ if( !empty( $_REQUEST["site_icon_style"] ) ) {
// apply the style layout
if( !empty( $_REQUEST["site_style_layout"] ) ) {
- $gBitSystem->storeConfig( 'site_style_layout', ( ( $_REQUEST["site_style_layout"] != 'remove' ) ? $_REQUEST["site_style_layout"] : NULL ), THEMES_PKG_NAME );
+ if( !empty( $_REQUEST['approved'] ) ) {
+ $gBitSystem->storeConfig( 'site_style_layout', ( ( $_REQUEST["site_style_layout"] != 'remove' ) ? $_REQUEST["site_style_layout"] : NULL ), THEMES_PKG_NAME );
+ } else {
+ $gBitSystem->setConfig( 'site_style_layout', ( ( $_REQUEST["site_style_layout"] != 'remove' ) ? $_REQUEST["site_style_layout"] : NULL ), THEMES_PKG_NAME );
+ $gBitSmarty->assign( 'approve', TRUE );
+ }
}
// apply the site style
if( !empty( $_REQUEST["site_style"] ) ) {
- $gBitSystem->storeConfig( 'style', $_REQUEST["site_style"], THEMES_PKG_NAME );
- $gBitSystem->storeConfig( 'style_variation', !empty( $_REQUEST["style_variation"] ) ? $_REQUEST["style_variation"] : '', THEMES_PKG_NAME );
- $gPreviewStyle = $_REQUEST["site_style"];
- $gBitSystem->mStyle = $_REQUEST["site_style"];
+ if( !empty( $_REQUEST['approved'] ) ) {
+ $gBitSystem->storeConfig( 'style', $_REQUEST["site_style"], THEMES_PKG_NAME );
+ $gBitSystem->storeConfig( 'style_variation', !empty( $_REQUEST["style_variation"] ) ? $_REQUEST["style_variation"] : '', THEMES_PKG_NAME );
+ $gBitSystem->mStyle = $gPreviewStyle = $_REQUEST["site_style"];
+ } else {
+ $gPreviewStyle = $_REQUEST["site_style"];
+ $gBitSystem->setConfig( 'style_variation', !empty( $_REQUEST["style_variation"] ) ? $_REQUEST["style_variation"] : '', THEMES_PKG_NAME );
+ $gBitSmarty->assign( 'approve', TRUE );
+ }
}
// Get list of available styles
@@ -58,7 +68,7 @@ $sampleIcons = array(
$gBitSmarty->assign( "sampleIcons", $sampleIcons );
// crude method of loading css styling but we can fix this later
-$gBitSmarty->assign( "loadLayoutGalaCss", TRUE );
+$gBitSmarty->assign( "loadThemesCss", TRUE );
$gBitSystem->display( 'bitpackage:themes/admin_themes_manager.tpl', 'Themes Manager' );
?>
diff --git a/templates/admin_themes_manager.tpl b/templates/admin_themes_manager.tpl
index 68fac44..43c64b8 100644
--- a/templates/admin_themes_manager.tpl
+++ b/templates/admin_themes_manager.tpl
@@ -6,6 +6,15 @@
</div>
<div class="body">
+ {if $approve}
+ <div id="themeapprove">
+ <h1>{tr}Confirm Selection{/tr}</h1>
+ <p>{tr}The settings you have chosen has not been applied to the site yet. This allows you to test the styles before applying them to your site. To accept the change, please click on the accept button below{/tr}<p>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php">{biticon ipackage=icons iname="large/dialog-cancel" iexplain="Cancel"}</a>
+ <a href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php?site_style={$smarty.request.site_style}&amp;style_variation={$smarty.request.style_variation}&amp;site_style_layout={$smarty.request.site_style_layout}&amp;approved=1">{biticon ipackage=icons iname="large/dialog-ok" iexplain="Accept"}</a>
+ </div>
+ {/if}
+
{jstabs}
{jstab title="Site Style"}
{legend legend="Pick Site Style"}
diff --git a/templates/header_inc.tpl b/templates/header_inc.tpl
index 420a6a2..0c94169 100644
--- a/templates/header_inc.tpl
+++ b/templates/header_inc.tpl
@@ -1,4 +1,4 @@
-{* $Header: /cvsroot/bitweaver/_bit_themes/templates/header_inc.tpl,v 1.19 2006/08/29 21:02:44 wjames5 Exp $ *}
+{* $Header: /cvsroot/bitweaver/_bit_themes/templates/header_inc.tpl,v 1.20 2006/09/11 12:53:15 squareing Exp $ *}
{strip}
{if $gBitSystem->isFeatureActive( 'site_style_layout' )}
<link rel="stylesheet" title="{$style}" type="text/css" href="{$smarty.const.THEMES_PKG_URL}layouts/{$gBitSystem->getConfig('site_style_layout')}.css" media="all" />
@@ -25,9 +25,12 @@
{/if}
{/strip}
-{if $loadLayoutGalaCss}
+{if $loadThemesCss}
{literal}
<style type="text/css">
+ div#themeapprove {position:fixed; color:#000; z-index:1000000; bottom:10px; right:10px; width:400px; background:#fff; border:3px solid #999; padding:20px; text-align:center; opacity:0.8;}
+ div#themeapprove a {display:block; float:left; margin:10px; padding:20px 71px; background:#eee; border:1px solid #ccc; vertical-align:middle;}
+ div#themeapprove a:hover {background-color:#b83;}
ul#layoutgala {list-style:none; margin:0; padding:0;}
ul#layoutgala li {list-style:none; float:left; display:inline; margin:0 0 10px 10px; width:120px; text-align:center}
ul#layoutgala li a {height:150px; display:block;}