summaryrefslogtreecommitdiff
path: root/admin/admin_themes_manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/admin_themes_manager.php')
-rw-r--r--admin/admin_themes_manager.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/admin/admin_themes_manager.php b/admin/admin_themes_manager.php
new file mode 100644
index 0000000..a6a7e62
--- /dev/null
+++ b/admin/admin_themes_manager.php
@@ -0,0 +1,62 @@
+<?php
+require_once( '../../bit_setup_inc.php' );
+include_once( THEMES_PKG_PATH.'theme_control_lib.php' );
+
+$gBitSystem->verifyPermission( 'bit_p_admin' );
+
+require_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' );
+
+// Handle Update
+$processForm = set_tab();
+
+if( $processForm ) {
+ $pref_simple_values = array(
+ "slide_style",
+ "biticon_display",
+ );
+
+ foreach ($pref_simple_values as $svitem) {
+ simple_set_value ($svitem);
+ }
+
+ $pref_toggles = array(
+ "disable_jstabs",
+ );
+
+ foreach ($pref_toggles as $toggle) {
+ simple_set_toggle ($toggle);
+ }
+
+ if( $_REQUEST["site_style"] ) {
+ // Set value(s) with alternate pref name
+ $gBitSystem->storePreference( 'style', $_REQUEST["site_style"] );
+ $gPreviewStyle = $_REQUEST["site_style"];
+ $gBitSystem->mStyle = $_REQUEST["site_style"];
+ }
+
+ if( isset( $_REQUEST['fRemoveTheme'] ) ) {
+ $tcontrollib->expunge_dir( THEMES_PKG_PATH.'styles/'.$_REQUEST['fRemoveTheme'] );
+ }
+
+ //Clear the template cache in case the theme has changed TODO: Do this ONLY when the theme changes.
+ //TODO: Fix module render order so that this will correctly render the modules on the 1st try too.
+// $smarty->clear_all_cache();
+// $smarty->clear_compiled_tpl();
+}
+
+// Get list of available styles
+$styles = &$tcontrollib->getStyles();
+$smarty->assign_by_ref( "styles", $styles );
+// Get list of available slideshow styles
+$smarty->assign_by_ref("slide_styles", $styles);
+
+// set the options biticon takes
+$biticon_display_options = array(
+ 'icon' => tra( 'icon' ),
+ 'text' => tra( 'text' ),
+ 'icon_text' => tra( 'icon and text' )
+);
+$smarty->assign( "biticon_display_options", $biticon_display_options );
+
+$gBitSystem->display( 'bitpackage:themes/admin_themes_manager.tpl');
+?>