2 require_once ("paths.php");
3 require_once ($smarty_path."Smarty.class.php");
4 require_once ("bweb.inc.php");
6 $smarty = new Smarty();
8 //require_once ("lang.php");
10 // Smarty configuration
11 $smarty->compile_check = true;
12 $smarty->debugging = false;
13 $smarty->force_compile = true;
15 $smarty->template_dir = "./templates";
16 $smarty->compile_dir = "./templates_c";
17 $smarty->config_dir = "./configs";
20 $check_result = array( true => 's_ok.png', false => 's_error.gif' );
23 $check_list = array( array( 'check_cmd' => 'php-gettext',
24 'check_label' => 'PHP - Gettext support',
25 'check_descr' => 'If you want Bacula-web in your language, please compile PHP with Gettext support' ),
26 array( 'check_cmd' => 'pear-db',
27 'check_label' => 'PEAR DB module',
28 'check_descr' => 'PEAR DB support not found, please read the Bacula-web installation document'),
29 array( 'check_cmd' => 'php-gd',
30 'check_label' => 'PHP - GD support',
31 'check_descr' => 'This is required by phplot, please compile php with GD support'),
32 array( 'check_cmd' => 'smarty-cache',
33 'check_label' => 'Smarty cache folder write permission',
34 'check_descr' => 'Smarty template engine need write permissions to templates_c folder')
38 foreach( $check_list as &$check ) {
39 switch( $check['check_cmd'] )
42 $check['check_result'] = $check_result[ function_exists( 'gettext') ];
45 $check['check_result'] = $check_result[ function_exists( 'gd_info') ];
48 $check['check_result'] = $check_result[ class_exists('DB') ];
51 $check['check_result'] = $check_result[ is_writable( "./templates_c" ) ];
55 // Generate test graph
56 $data = array( array('test', 100, 100, 200, 100), array('test1', 150, 100, 150, 100 ) );
57 $graph = new BGraph( "graph3.png" );
58 $graph->SetColors( array('green', 'red' ) );
60 $graph->SetData( $data, 'pie', 'text-data-single' );
61 $graph->SetGraphSize( 400, 230 );
66 $smarty->assign( 'checks', $check_list );
67 $smarty->assign('graph_test', $graph->Get_Image_file() );
68 $smarty->display('test.tpl');