]> git.sur5r.net Git - bacula/bacula/blob - gui/bacula-web/test.php
bacula-web: Fixed css for main layout
[bacula/bacula] / gui / bacula-web / test.php
1 <?php
2         require_once "DB.php";
3         
4         function Checkold($function,$text,$description="") 
5         {
6                 if  (!function_exists($function) )
7                         echo "<td> ".$text." disabled</td><td>&nbsp;" . $description;
8                 else
9                         echo "<td> " . $text . " enabled<td>&nbsp;";
10         }
11         
12         function Check( $support, $description, $error_message )
13         {
14                 $result  = "Checking " . $description . " </td>";
15                 $ok      = false;
16                 
17                 switch( $support )
18                 {
19                         case 'php-gettext':
20                                 if( function_exists( 'gettext') )
21                                         $ok = true;
22                         break;
23                         case 'php-gd':
24                                 if( function_exists( 'gd_info') )
25                                         $ok = true;
26                         break;
27                         case 'pear-db':
28                                 if ( class_exists('DB') )
29                                         $ok = true;
30                         break;
31                         case 'smarty-cache':
32                                 if ( is_writable( "./templates_c" ) )
33                                         $ok = true;
34                         break;
35                 } 
36                 if( $ok )
37                         $result .= "<td width='300'>&nbsp;</td> <td> <img width='30' src='style/images/s_ok.gif' />";
38                 else
39                         $result .= "<td width='300'>$error_message</td> <td width='35'> <img width='30' src='style/images/s_error.gif' />";
40                 
41                 echo $result;
42         }
43 ?>
44
45 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
46   "http://www.w3.org/TR/html4/loose.dtd">
47 <html lang="en">
48 <head>
49         <title>Bacula-web - Test page</title>
50         
51         <style type="text/css">
52                 body{
53                         font-family: arial, verdana, helvetica;
54                         font-size: 10pt;
55                         padding-left: 100px;
56                 }
57                 table{
58                         
59                         margin: 20px 0px 0px 100px;
60                         border: thin solid black;
61                         border-collapse: collapse;
62                 }
63                 td{
64                         margin: 0px;
65                         padding: 1em;
66                         border-top: thin solid black;
67                 }
68                 img{
69                         margin-top: 1em;
70                 }
71                 
72         </style>
73 </head>
74 <body>
75
76 <table>
77 <tr>
78         <td width="300">
79                 <?php 
80                         Check( "php-gettext", "PHP Gettext support", "If you want Bacula-web in your language, please compile PHP with Gettext support" );
81                 ?>
82         </td>
83 </tr>
84 <tr>
85         <td>
86                 <?php 
87                         Check("pear-db", "PEAR DB support", "PEAR DB support not found, please read the Bacula-web installation document");
88                 ?>
89         </td>
90 </tr>
91 <tr>
92         <td>
93                 <?php
94                         Check( "php-gd", "PHP GD support", "This is required by phplot, please compile php with GD support" );
95                 ?>
96         </td>
97 </tr>
98 <tr>
99         <td>
100                 <?php
101                         Check( "smarty-cache", "Smarty cache folder write permission", "Smarty template engine need write permissions to templates_c folder" );
102                 ?>
103         </td>
104 </tr>
105
106 <tr>
107         <td colspan="3">
108                 <center>
109                         Testing your graph system capabilities (Bacula-web only use PNG) <br />
110                         <img src="simplegraph.php" /> 
111                 </center>
112         </td>
113 </tr>
114 </table>
115
116 </body>
117
118 </html>