]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Improved config.inc.php
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 21 Mar 2011 17:56:45 +0000 (18:56 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:08 +0000 (14:49 +0200)
 - Using constant instead of variable for include paths
 - Automatic detection of bacula-web installation path
 - Adapted include in index.php and bweb.inc.php

gui/bacula-web/bweb.inc.php
gui/bacula-web/config.inc.php
gui/bacula-web/index.php

index 4490134421f1cf2897c7db6bb5d009476e206e04..d57090bedbe6fea1c0f5e2461c143127b4c2bb47 100644 (file)
@@ -85,7 +85,7 @@ class Bweb extends DB {
                global $smarty_gettext_path;
                
                if ( function_exists("gettext") ) {
-                       require_once( $smarty_gettext_path."smarty_gettext.php" );     
+                       require_once( BW_SMARTY_GETTEXT . "smarty_gettext.php" );     
                        $this->tpl->register_block('t','smarty_translate');
         
                        $language = $this->get_config_param("lang");
index 6a28a47f736c1102491152cfa2665626e0db307c..e67d08ac6a99942b88ed2f171de5f5e6c85d9309 100644 (file)
@@ -1,21 +1,18 @@
 <?php
- // PhPlot (version 5.3.1) 
- // http://www.phplot.com
- $phplot_path = "external_packages/phplot/";
-
- // Smarty (version 2.6.26)
- // http://smarty.php.net
- $smarty_path = "external_packages/smarty/libs/";
-
- // Smarty_gettext (version 0.9)
- // http://www.boom.org.il/smarty/gettext/
- $smarty_gettext_path = "external_packages/smarty_gettext-0.9/"; 
+ define( 'BW_ROOT', getcwd() );                                                                                                                
+ define( 'BW_PHPLOT', BW_ROOT . '/external_packages/phplot/'  );                                       
+ define( 'BW_SMARTY', BW_ROOT . '/external_packages/smarty/libs/' );                           
+ define( 'BW_SMARTY_GETTEXT', BW_ROOT . '/external_packages/smarty_gettext-0.9/' );
  
- require_once( $smarty_path . "Smarty.class.php");
- require_once( $phplot_path . "phplot.php");
+ require_once( BW_SMARTY . "Smarty.class.php");                        
+ require_once( BW_PHPLOT . "phplot.php");                              
  
+ // PEAR-DB classe
  require_once "DB.php";   
+ // Internal libs
  require_once "bgraph.inc.php";
+ require_once "bweb.inc.php";
  
  // Global constants
  define('CONFIG_DIR', "configs");
index 070347ac38a53ce9859079a242e7f36ef5a82790..5e5ab16f6432a28e5097f6a7f1461c5a542bf3e0 100644 (file)
@@ -15,7 +15,7 @@
 +-------------------------------------------------------------------------+ 
 */
 session_start();
-include_once( 'bweb.inc.php' );
+include_once( 'config.inc.php' );
 
 $dbSql = new Bweb();