--- /dev/null
+<?php
+require_once 'external_packages/phplot/phplot.php';
+
+$plot = new PHPlot(400, 300);
+
+$data = array(
+ array('', 100, 100, 200, 100),
+ array('', 150, 100, 150, 100),
+);
+$plot->SetImageBorderType('plain');
+$plot->SetDataType('text-data');
+$plot->SetDataValues($data);
+$plot->SetPlotType('pie');
+//$plot->SetShading( '5' )
+
+$plot->DrawGraph();
+
+?>
\ No newline at end of file
<?php
-
-function Check($function,$text,$description="") {
+ require_once "DB.php";
- if (!function_exists($function) )
- echo "<font color=red>NO</font></td> <td> ".$text." disabled</td><td> ".$description;
- else
- echo "<font color=green>YES</font></td> <td> ".$text." enabled<td> ";
-}
-
+ function Checkold($function,$text,$description="")
+ {
+ if (!function_exists($function) )
+ echo "<td> ".$text." disabled</td><td> " . $description;
+ else
+ echo "<td> " . $text . " enabled<td> ";
+ }
+
+ function Check( $support, $description, $error_message )
+ {
+ $result = "Checking " . $description . " </td>";
+ $ok = false;
+
+ switch( $support )
+ {
+ case 'php-gettext':
+ if( function_exists( 'gettext') )
+ $ok = true;
+ break;
+ case 'php-gd':
+ if( function_exists( 'gd_info') )
+ $ok = true;
+ break;
+ case 'pear-db':
+ if ( class_exists('DB') )
+ $ok = true;
+ break;
+ case 'smarty-cache':
+ if ( is_writable( "./templates_c" ) )
+ $ok = true;
+ break;
+ }
+ if( $ok )
+ $result .= "<td width='300'> </td> <td> <img width='30' src='images/s_ok.gif' />";
+ else
+ $result .= "<td width='300'>$error_message</td> <td width='35'> <img width='30' src='images/s_error.gif' />";
+
+ echo $result;
+ }
?>
-<html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
<head>
- <title>Testing page</title>
+ <title>Bacula-web - Test page</title>
+
+ <style type="text/css">
+ body{
+ font-family: arial, verdana, helvetica;
+ font-size: 10pt;
+ padding-left: 100px;
+ }
+ table{
+
+ margin: 20px 0px 0px 100px;
+ border: thin solid black;
+ border-collapse: collapse;
+ }
+ td{
+ margin: 0px;
+ padding: 1em;
+ border-top: thin solid black;
+ }
+ img{
+ margin-top: 1em;
+ }
+
+ </style>
</head>
<body>
-Checking system for dependencies...<br><br><br>
-<table width=100% border=0>
+<table>
<tr>
- <td width=20%>
- Checking gettext:
- <? Check("gettext","Language support", "If you want view Bacula-web in your language, please compile PHP with Gettext");?>
+ <td width="300">
+ <?php
+ Check( "php-gettext", "PHP Gettext support", "If you want Bacula-web in your language, please compile PHP with Gettext support" );
+ ?>
</td>
</tr>
<tr>
- <td width=20%>
- Checking Pear(DB):
- <?
- if (@include_once("DB.php") )
- echo "<font color=green>YES</font></td> <td> Pear DB enabled</td><td> ";
- else
- echo "<font color=red>NO</font></td> <td> Pear DB NOT FOUND</td><td>This is required. Please download from <a href=\"http://pear.php.net/package/DB/download\">http://pear.php.net/package/DB/download</a> .";
+ <td>
+ <?php
+ Check("pear-db", "PEAR DB support", "PEAR DB support not found, please read the Bacula-web installation document");
?>
</td>
</tr>
<tr>
<td>
- Checking GD:
- <?Check("gd_info","GD support", "This is required. Please, compile php with GD support");?>
+ <?php
+ Check( "php-gd", "PHP GD support", "This is required by phplot, please compile php with GD support" );
+ ?>
+ </td>
+</tr>
+<tr>
+ <td>
+ <?php
+ Check( "smarty-cache", "Smarty cache folder write permission", "Smarty template engine need write permissions to templates_c folder" );
+ ?>
</td>
</tr>
-</table>
-<br><br>
-Please, click the link below to test your graph system capabilities (Bacula-web only use PNG): <br>
+<tr>
+ <td colspan="3">
+ <center>
+ Testing your graph system capabilities (Bacula-web only use PNG) <br />
+ <img src="simplegraph.php" />
+ </center>
+ </td>
+</tr>
+</table>
-<a href="external_packages/phplot/examples/test_setup.php" target="_blank">Test</a>
</body>
+
</html>
\ No newline at end of file