summaryrefslogtreecommitdiff
path: root/admin/admin_themes_manager.php
blob: 0f537e12dc08ba787dfde949b109b0310e0e4d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php 
require_once( '../../bit_setup_inc.php' );
require_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' );

$gBitSystem->verifyPermission( 'p_admin' );

// Handle Update
$processForm = set_tab();

if( $processForm ) {
	$pref_simple_values = array(
		"site_slide_style",
		"site_biticon_display_style",
	);

	foreach ($pref_simple_values as $svitem) {
		simple_set_value ($svitem, THEMES_PKG_NAME);
	}

	$pref_toggles = array(
		"site_disable_jstabs",
		"site_disable_fat",
	);

	foreach ($pref_toggles as $toggle) {
		simple_set_toggle ($toggle, THEMES_PKG_NAME);
	}

	if( isset( $_REQUEST['fRemoveTheme'] ) ) {
		$gBitThemes->expunge_dir( THEMES_PKG_PATH.'styles/'.$_REQUEST['fRemoveTheme'] );
	}
}

// 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 );
}

// 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"];
}

// Get list of available styles
$styles = $gBitThemes->getStyles( NULL, TRUE );
$gBitSmarty->assign_by_ref( "styles", $styles );

$subDirs = array( 'style_info', 'alternate' );
$stylesList = $gBitThemes->getStylesList( NULL, NULL, $subDirs );
$gBitSmarty->assign_by_ref( "stylesList", $stylesList );

$styleLayouts = $gBitThemes->getStyleLayouts();
$gBitSmarty->assign_by_ref( "styleLayouts", $styleLayouts );

// set the options biticon takes
$biticon_display_options = array(
	'icon' => tra( 'icon' ),
	'text' => tra( 'text' ),
	'icon_text' => tra( 'icon and text' )
);
$gBitSmarty->assign( "biticon_display_options", $biticon_display_options );

// crude method of loading css styling but we can fix this later
$gBitSmarty->assign( "loadLayoutGalaCss", TRUE );

$gBitSystem->display( 'bitpackage:themes/admin_themes_manager.tpl', 'Themes Manager' );
?>