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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
<?php
/**
* @version $Header$
* @package install
* @subpackage functions
*/
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
/**
* assign next step in installation process
*/
$gBitSmarty->assign( 'next_step',$step );
/**
* simple_set_value
*/
function simple_set_value( $package, $feature ) {
global $_REQUEST, $gBitSystem, $gBitSmarty;
if( isset( $_REQUEST[$feature] ) ) {
$gBitSystem->storeConfig( $feature, $_REQUEST[$feature], $package );
$gBitSmarty->assign( $feature, $_REQUEST[$feature] );
}
}
// pass all package data to template
$gBitSmarty->assignByRef( 'schema', $gBitInstaller->mPackages );
// settings that aren't just toggles
$formInstallValues = array(
'bit_index' => 'kernel',
'kernel_server_name' => 'kernel',
'site_title' => 'kernel',
'site_slogan' => 'kernel',
'bitlanguage' => 'languages',
);
$processors = array();
if( extension_loaded( 'gd' ) ) {
$processors['gd'] = '<strong>GD Library</strong> [php-gd]';
}
if( extension_loaded( 'imagick' ) ) {
$processors['imagick'] = '<strong>Image Magick</strong> [php-imagick] - recommended';
}
if( extension_loaded( 'magickwand' ) ) {
$processors['magickwand'] = '<strong>MagickWand</strong> [php-magickwand] - highly recommended';
}
if( count( $processors ) > 0 ) {
$gBitSmarty->assign( 'processors', $processors );
$formInstallValues['image_processor'] = 'liberty';
}
// list of available site styles
$subDirs = array( 'style_info', 'alternate' );
$stylesList = $gBitThemes->getStylesList( NULL, NULL, $subDirs );
$gBitSmarty->assignByRef( "stylesList", $stylesList );
// get list of available languages
$languages = array();
$languages = $gBitLanguage->listLanguages();
$gBitSmarty->assignByRef("languages",$languages );
// process form
if( isset( $_REQUEST['bit_settings'] ) ) {
foreach( $formInstallValues as $item => $package) {
simple_set_value( $package, $item );
}
if( empty( $_REQUEST['bitlanguage'] ) ) {
$_REQUEST['bitlanguage'] = 'en';
}
if( !empty( $_REQUEST["site_style"] ) ) {
$gBitSystem->storeConfig( 'style', $_REQUEST["site_style"], THEMES_PKG_NAME );
};
if( !array_key_exists( $_REQUEST['bitlanguage'], $languages ) ) {
$languages[$_REQUEST['bitlanguage']] = '';
}
$gBitLanguage->setLanguage( $_REQUEST['bitlanguage'] );
$gBitSmarty->assign( "siteLanguage",$languages[$_REQUEST['bitlanguage']] );
// advance a step in the installer
$app = '_done';
$gBitSmarty->assign( 'next_step',$step + 1 );
} elseif( isset( $_REQUEST['skip'] ) ) {
$goto = $step + 1;
header( "Location: ".INSTALL_PKG_URL."install.php?step=$goto" );
}
// get list of foreign packages that are ready to be installed
// @TODO this isn't working yet, since the info stuff isn't read from schema_inc.php on this page
$foreign_packages = array();
foreach( $gBitSystem->mPackages as $package ) {
if( isset( $package['info']['install'] ) ) {
$foreign_packages[] = $package;
}
}
if ( defined( 'ROLE_MODEL' ) ) {
$gBitSmarty->assign( "role_model", TRUE );
}
$gBitSmarty->assign( "foreign_packages", $foreign_packages );
?>
|