]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/test.php
bacula-web: Test page in default layout
[bacula/bacula] / gui / bacula-web / test.php
1 <?php
2   require_once ("paths.php");
3   require_once ($smarty_path."Smarty.class.php");
4   require_once ("classes.inc.php");
5
6   $smarty = new Smarty(); 
7   
8   //require_once ("lang.php");
9
10   // Smarty configuration
11   $smarty->compile_check = true;
12   $smarty->debugging = false;
13   $smarty->force_compile = true;
14
15   $smarty->template_dir = "./templates";
16   $smarty->compile_dir = "./templates_c";
17   $smarty->config_dir     = "./configs";  
18   
19         function Check( $support, $description, $error_message )
20         {
21                 $result  = $description . " </td>";
22                 $ok      = false;
23                 
24                 switch( $support )
25                 {
26                         case 'php-gettext':
27                                 if( function_exists( 'gettext') )
28                                         $ok = true;
29                         break;
30                         case 'php-gd':
31                                 if( function_exists( 'gd_info') )
32                                         $ok = true;
33                         break;
34                         case 'pear-db':
35                                 if ( class_exists('DB') )
36                                         $ok = true;
37                         break;
38                         case 'smarty-cache':
39                                 if ( is_writable( "./templates_c" ) )
40                                         $ok = true;
41                         break;
42                 } 
43                 if( $ok )
44                         $result .= "<td width='300'>&nbsp;</td> <td> <img width='30' src='style/images/s_ok.gif' />";
45                 else
46                         $result .= "<td width='300'>$error_message</td> <td width='35'> <img width='30' src='style/images/s_error.gif' />";
47                 
48                 echo $result;
49         }
50         $smarty->display('test.tpl');
51 ?>