diff --git a/NEWS b/NEWS index 19a0278f..a710961c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - added optional HTML header to output (Monte) - significantly improved config_load performance. (Andrei) - added format attribute to math function. (Monte) - added html_select_time custom function. (Andrei) diff --git a/Smarty.class.php b/Smarty.class.php index eed61a8d..a5782af5 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -106,6 +106,10 @@ class Smarty 'count_sentences' => 'smarty_mod_count_sentences', 'count_paragraphs' => 'smarty_mod_count_paragraphs' ); + + + var $version = "3.0.1pl1"; // Smarty version number + var $show_info_header = true; // display info header at top of page output // internal vars var $_error_msg = false; // error messages. true/false @@ -354,12 +358,20 @@ class Smarty extract($this->_tpl_vars); + if($this->show_info_header) + $info_header = ''."\n\n"; + else + $info_header = ""; + // if we just need to display the results, don't perform output // buffering - for speed - if ($display && !$this->caching) + if ($display && !$this->caching) { + echo $info_header; include($_compile_file); + } else { ob_start(); + echo $info_header; include($_compile_file); $results = ob_get_contents(); ob_end_clean(); @@ -369,7 +381,7 @@ class Smarty $this->_write_file($cache_file, $results, true); $results = $this->_process_cached_inserts($results); } - + if ($display) { if(isset($results)) { echo $results; } return; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index eed61a8d..a5782af5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -106,6 +106,10 @@ class Smarty 'count_sentences' => 'smarty_mod_count_sentences', 'count_paragraphs' => 'smarty_mod_count_paragraphs' ); + + + var $version = "3.0.1pl1"; // Smarty version number + var $show_info_header = true; // display info header at top of page output // internal vars var $_error_msg = false; // error messages. true/false @@ -354,12 +358,20 @@ class Smarty extract($this->_tpl_vars); + if($this->show_info_header) + $info_header = ''."\n\n"; + else + $info_header = ""; + // if we just need to display the results, don't perform output // buffering - for speed - if ($display && !$this->caching) + if ($display && !$this->caching) { + echo $info_header; include($_compile_file); + } else { ob_start(); + echo $info_header; include($_compile_file); $results = ob_get_contents(); ob_end_clean(); @@ -369,7 +381,7 @@ class Smarty $this->_write_file($cache_file, $results, true); $results = $this->_process_cached_inserts($results); } - + if ($display) { if(isset($results)) { echo $results; } return;