]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Test page in default layout
authorDavide Franco <bacula-dev@dflc.ch>
Tue, 30 Nov 2010 16:26:25 +0000 (17:26 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:42 +0000 (14:39 +0200)
 - The test page is part of the default layout now

gui/bacula-web/templates/header.tpl
gui/bacula-web/templates/test.tpl [new file with mode: 0644]
gui/bacula-web/test.php

index ecc1fd6fae4ecf6ebf9ef1990e59c596ee7142b7..55f0d5421184a4729c4e203299b0013d1e154500 100644 (file)
@@ -17,7 +17,7 @@
        {if $dbs > 1}
        <li>
                <form method=post action=index.php>
-                       {t}Catalog{/t}&nbsp; <select name=sel_database OnChange=submit()> {html_options values={$dbs} name=$selected_db=$dbs_now} </select>
+                       Catalog&nbsp; <select name=sel_database OnChange=submit()> {html_options values={$dbs} name=$selected_db=$dbs_now} </select>
                </form>
        </li>
        {/if}
diff --git a/gui/bacula-web/templates/test.tpl b/gui/bacula-web/templates/test.tpl
new file mode 100644 (file)
index 0000000..fa1a19e
--- /dev/null
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
+  "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>bacula-web</title>
+<link rel="stylesheet" type="text/css" href="style/default.css">
+</head>
+<body>
+{include file=header.tpl}
+  <div id="nav">
+    <a href="index.php" title="Back to the dashboard">Dashboard</a> > Test page
+  </div>
+  <div id="main_center">
+       <div class="box">
+         <p class="title">Testing required components</p>
+         
+         <table>
+           <tr>
+             <td width="300">
+                   {php}Check( "php-gettext", "PHP Gettext support", "If you want Bacula-web in your language, please compile PHP with Gettext support" );{/php}
+                 </td>
+               </tr>
+               <tr>
+                 <td>
+                   {php}Check("pear-db", "PEAR DB support", "PEAR DB support not found, please read the Bacula-web installation document");{/php}
+                 </td>
+           </tr>
+               <tr>
+                 <td>
+                 {php}Check( "php-gd", "PHP GD support", "This is required by phplot, please compile php with GD support" );{/php}
+                 </td>
+               </tr>
+               <tr>
+                 <td>
+                       {php}Check( "smarty-cache", "Smarty cache folder write permission", "Smarty template engine need write permissions to templates_c folder" );{/php}
+       </td>
+</tr>
+
+<tr>
+       <td colspan="3">
+               <center>
+                       Testing your graph system capabilities (Bacula-web only use PNG) <br />
+                       <img src="simplegraph.php" /> 
+               </center>
+       </td>
+</tr>
+</table>
+
+         
+       </div>
+  </div>
+</body>
+</html>
\ No newline at end of file
index c24df4c4b4241daaef63395b906beaead3ff6149..840c109e38d9cb2120613ca0bb530ba06557d1ee 100644 (file)
@@ -1,17 +1,24 @@
 <?php
-       require_once "DB.php";
-       
-       function Checkold($function,$text,$description="") 
-       {
-               if  (!function_exists($function) )
-                       echo "<td> ".$text." disabled</td><td>&nbsp;" . $description;
-               else
-                       echo "<td> " . $text . " enabled<td>&nbsp;";
-       }
-       
+  require_once ("paths.php");
+  require_once ($smarty_path."Smarty.class.php");
+  require_once ("classes.inc.php");
+
+  $smarty = new Smarty(); 
+  
+  //require_once ("lang.php");
+
+  // Smarty configuration
+  $smarty->compile_check = true;
+  $smarty->debugging = false;
+  $smarty->force_compile = true;
+
+  $smarty->template_dir = "./templates";
+  $smarty->compile_dir = "./templates_c";
+  $smarty->config_dir     = "./configs";  
+  
        function Check( $support, $description, $error_message )
        {
-               $result  = "Checking " . $description . " </td>";
+               $result  = $description . " </td>";
                $ok      = false;
                
                switch( $support )
                
                echo $result;
        }
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
-  "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
-<head>
-       <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>
-
-<table>
-<tr>
-       <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>
-               <?php 
-                       Check("pear-db", "PEAR DB support", "PEAR DB support not found, please read the Bacula-web installation document");
-               ?>
-       </td>
-</tr>
-<tr>
-       <td>
-               <?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>
-
-<tr>
-       <td colspan="3">
-               <center>
-                       Testing your graph system capabilities (Bacula-web only use PNG) <br />
-                       <img src="simplegraph.php" /> 
-               </center>
-       </td>
-</tr>
-</table>
-
-</body>
-
-</html>
+       $smarty->display('test.tpl');
+?>
\ No newline at end of file