From 3b0f86094d9a359ca4e52d54075928a5996cdcb3 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Fri, 22 Oct 2010 18:22:37 +0200 Subject: [PATCH] bacula-web: Improved test page - Added smarty cache directory test - Added new simplegraph.php script - Improved php code - Improved lisibility of test page --- gui/bacula-web/simplegraph.php | 18 +++++ gui/bacula-web/test.php | 123 +++++++++++++++++++++++++-------- 2 files changed, 113 insertions(+), 28 deletions(-) create mode 100644 gui/bacula-web/simplegraph.php diff --git a/gui/bacula-web/simplegraph.php b/gui/bacula-web/simplegraph.php new file mode 100644 index 0000000000..9dcfa26491 --- /dev/null +++ b/gui/bacula-web/simplegraph.php @@ -0,0 +1,18 @@ +SetImageBorderType('plain'); +$plot->SetDataType('text-data'); +$plot->SetDataValues($data); +$plot->SetPlotType('pie'); +//$plot->SetShading( '5' ) + +$plot->DrawGraph(); + +?> \ No newline at end of file diff --git a/gui/bacula-web/test.php b/gui/bacula-web/test.php index 688f109b1e..cba418ea83 100644 --- a/gui/bacula-web/test.php +++ b/gui/bacula-web/test.php @@ -1,51 +1,118 @@ NO ".$text." disabled ".$description; - else - echo "YES ".$text." enabled "; -} - + function Checkold($function,$text,$description="") + { + if (!function_exists($function) ) + echo " ".$text." disabled " . $description; + else + echo " " . $text . " enabled "; + } + + function Check( $support, $description, $error_message ) + { + $result = "Checking " . $description . " "; + $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 .= "  "; + else + $result .= "$error_message "; + + echo $result; + } ?> - + + - Testing page + Bacula-web - Test page + + -Checking system for dependencies...


- +
- - + + + -
- Checking gettext: - + +
- Checking Pear(DB): - YES Pear DB enabled "; - else - echo "NO Pear DB NOT FOUNDThis is required. Please download from http://pear.php.net/package/DB/download ."; + +
- Checking GD: - + +
+
-

-Please, click the link below to test your graph system capabilities (Bacula-web only use PNG):
+ + +
+ Testing your graph system capabilities (Bacula-web only use PNG)
+ +
+ + + -Test + \ No newline at end of file -- 2.39.5