mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix experimental getTags() method did not work
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== SVN trunk =====
|
||||
26/07/2011
|
||||
- bugfix experimental getTags() method did not work
|
||||
|
||||
15/07/2011
|
||||
- bugfix individual cache_lifetime of {include} did not work correctly inside {block} tags
|
||||
|
||||
|
@@ -236,6 +236,8 @@ class Smarty extends Smarty_Internal_Data {
|
||||
public $inheritance = false;
|
||||
// generate deprecated function call notices?
|
||||
public $deprecation_notices = true;
|
||||
// internal flag for getTags()
|
||||
public $get_used_tags = false;
|
||||
// Smarty 2 BC
|
||||
public $_version = self::SMARTY_VERSION;
|
||||
// self pointer to Smarty object
|
||||
@@ -714,6 +716,17 @@ class Smarty extends Smarty_Internal_Data {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of tag/attributes of all tags used by an template
|
||||
*
|
||||
* @param object $templae template object
|
||||
* @return array of tag/attributes
|
||||
*/
|
||||
public function getTags(Smarty_Internal_Template $template)
|
||||
{
|
||||
return Smarty_Internal_Utility::getTags($template);
|
||||
}
|
||||
|
||||
/**
|
||||
* clean up properties on cloned object
|
||||
*/
|
||||
|
@@ -70,6 +70,8 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
// blocks for template inheritance
|
||||
public $block_data = array();
|
||||
public $wrapper = null;
|
||||
// optional log of tag/attributes
|
||||
public $used_tags = array();
|
||||
/**
|
||||
* Create template data object
|
||||
*
|
||||
|
@@ -23,8 +23,6 @@ class Smarty_Internal_TemplateCompilerBase {
|
||||
public $_tag_stack = array();
|
||||
// current template
|
||||
public $template = null;
|
||||
// optional log of tag/attributes
|
||||
public $used_tags = array();
|
||||
|
||||
/**
|
||||
* Initialize compiler
|
||||
@@ -114,7 +112,7 @@ class Smarty_Internal_TemplateCompilerBase {
|
||||
$this->has_output = false;
|
||||
// log tag/attributes
|
||||
if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {
|
||||
$this->used_tags[] = array($tag,$args);
|
||||
$this->template->used_tags[] = array($tag,$args);
|
||||
}
|
||||
// check nocache option flag
|
||||
if (in_array("'nocache'",$args) || in_array(array('nocache'=>'true'),$args)
|
||||
|
@@ -224,11 +224,11 @@ class Smarty_Internal_Utility {
|
||||
* @param object $templae template object
|
||||
* @return array of tag/attributes
|
||||
*/
|
||||
function getTags(Smarty_Internal_Template $template)
|
||||
public static function getTags(Smarty_Internal_Template $template)
|
||||
{
|
||||
$template->smarty->get_used_tags = true;
|
||||
$template->compileTemplateSource();
|
||||
return $template->compiler_object->used_tags;
|
||||
return $template->used_tags;
|
||||
}
|
||||
|
||||
function testInstall()
|
||||
|
Reference in New Issue
Block a user