From 80971e60e7aa09224d0d15c7f5acf880bd911e80 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Thu, 17 Mar 2011 19:29:29 +0100 Subject: [PATCH] bacula-web: Modified internal php code for smarty classe instance name --- gui/bacula-web/backupjob-report.php | 32 +++++++++-------------------- gui/bacula-web/jobs.php | 27 +++++++----------------- gui/bacula-web/pools.php | 20 ++++-------------- gui/bacula-web/report.php | 17 +++------------ 4 files changed, 24 insertions(+), 72 deletions(-) diff --git a/gui/bacula-web/backupjob-report.php b/gui/bacula-web/backupjob-report.php index 154dfe1545..2857e211a9 100644 --- a/gui/bacula-web/backupjob-report.php +++ b/gui/bacula-web/backupjob-report.php @@ -1,22 +1,10 @@ compile_check = true; - $smarty->debugging = false; - $smarty->force_compile = true; - - $smarty->template_dir = "./templates"; - $smarty->compile_dir = "./templates_c"; - $smarty->config_dir = "./configs"; - $backupjob_name = ""; $days = array(); @@ -52,7 +40,7 @@ $graph->SetGraphSize( 400, 230 ); $graph->Render(); - $smarty->assign('graph_stored_bytes', $graph->Get_Image_file() ); + $dbSql->tpl->assign('graph_stored_bytes', $graph->Get_Image_file() ); // Getting last 7 days stored files graph $graph = new BGraph("graph3.png" ); @@ -71,7 +59,7 @@ $graph->SetGraphSize( 400, 230 ); $graph->Render(); - $smarty->assign('graph_stored_files', $graph->Get_Image_file() ); + $dbSql->tpl->assign('graph_stored_files', $graph->Get_Image_file() ); // Last 10 jobs $query = "SELECT JobId, Level, JobFiles, JobBytes, JobStatus, EndTime, Name "; @@ -94,14 +82,14 @@ }else die( "Unable to get last jobs from catalog " . $result->getMessage() ); - $smarty->assign('jobs', $jobs ); + $dbSql->tpl->assign('jobs', $jobs ); - $smarty->assign('backupjob_name', $backupjob_name ); - $smarty->assign('backupjob_period', $backupjob_period ); - $smarty->assign('backupjob_bytes', $backupjob_bytes ); - $smarty->assign('backupjob_files', $backupjob_files ); + $dbSql->tpl->assign('backupjob_name', $backupjob_name ); + $dbSql->tpl->assign('backupjob_period', $backupjob_period ); + $dbSql->tpl->assign('backupjob_bytes', $backupjob_bytes ); + $dbSql->tpl->assign('backupjob_files', $backupjob_files ); // Process and display the template - $smarty->display('backupjob-report.tpl'); + $dbSql->tpl->display('backupjob-report.tpl'); ?> diff --git a/gui/bacula-web/jobs.php b/gui/bacula-web/jobs.php index 5fb6fafbdb..daea6dbad3 100644 --- a/gui/bacula-web/jobs.php +++ b/gui/bacula-web/jobs.php @@ -1,33 +1,20 @@ compile_check = true; - $smarty->debugging = false; - $smarty->force_compile = true; - - $smarty->template_dir = "./templates"; - $smarty->compile_dir = "./templates_c"; - $smarty->config_dir = "./configs"; - // Jobs list $query = ""; $last_jobs = array(); // Job Status list $job_status = array( 'Any', 'Waiting', 'Running', 'Completed', 'Failed', 'Canceled' ); - $smarty->assign( 'job_status', $job_status ); + $dbSql->tpl->assign( 'job_status', $job_status ); // Jobs per page $jobs_per_page = array( 25,50,75,100,150 ); - $smarty->assign( 'jobs_per_page', $jobs_per_page ); + $dbSql->tpl->assign( 'jobs_per_page', $jobs_per_page ); // Global variables $job_level = array( 'D' => 'Diff', 'I' => 'Incr', 'F' => 'Full' ); @@ -126,7 +113,7 @@ array_push( $last_jobs, $job); } } - $smarty->assign( 'last_jobs', $last_jobs ); + $dbSql->tpl->assign( 'last_jobs', $last_jobs ); // Count jobs if( isset( $_POST['status'] ) ) @@ -134,8 +121,8 @@ else $total_jobs = $dbSql->CountJobs( ALL ); - $smarty->assign( 'total_jobs', $total_jobs ); + $dbSql->tpl->assign( 'total_jobs', $total_jobs ); // Process and display the template - $smarty->display('jobs.tpl'); + $dbSql->tpl->display('jobs.tpl'); ?> diff --git a/gui/bacula-web/pools.php b/gui/bacula-web/pools.php index 0a2c682c98..3391920d70 100644 --- a/gui/bacula-web/pools.php +++ b/gui/bacula-web/pools.php @@ -1,24 +1,12 @@ compile_check = true; - $smarty->debugging = false; - $smarty->force_compile = true; - - $smarty->template_dir = "./templates"; - $smarty->compile_dir = "./templates_c"; - $smarty->config_dir = "./configs"; - // Get volumes list (pools.tpl) - $smarty->assign('pools',$dbSql->GetVolumeList() ); + $dbSql->tpl->assign('pools',$dbSql->GetVolumeList() ); - $smarty->display('pools.tpl'); + $dbSql->tpl->display('pools.tpl'); ?> diff --git a/gui/bacula-web/report.php b/gui/bacula-web/report.php index 7312d2cfdf..b43402e58c 100644 --- a/gui/bacula-web/report.php +++ b/gui/bacula-web/report.php @@ -15,19 +15,8 @@ +-------------------------------------------------------------------------+ */ session_start(); -require ("paths.php"); -require($smarty_path."Smarty.class.php"); -include "bweb.inc.php"; - -$smarty = new Smarty; - -//$smarty->compile_check = true; -//$smarty->debugging = true; - -$smarty->template_dir = "./templates"; -$smarty->compile_dir = "./templates_c"; -$smarty->config_dir = "./configs"; -$smarty->config_load("bacula.conf"); +require_once('paths.php'); +include_once( 'bweb.inc.php' ); $dbSql = new Bweb(); @@ -74,5 +63,5 @@ $smarty->assign('time2',( (time())-2678400) ); -$smarty->display('report.tpl'); +$dbSql->tpl->display('report.tpl'); ?> -- 2.39.5