fusionpbx/resources/templates/engine/smarty/sysplugins/smarty_internal_compile_noc...

74 lines
2.1 KiB
PHP
Raw Normal View History

2013-11-09 21:02:56 +01:00
<?php
/**
* Smarty Internal Plugin Compile Nocache
* Compiles the {nocache} {/nocache} tags.
*
2018-11-07 08:18:14 +01:00
* @package Smarty
2013-11-09 21:02:56 +01:00
* @subpackage Compiler
2018-11-07 08:18:14 +01:00
* @author Uwe Tews
2013-11-09 21:02:56 +01:00
*/
/**
2018-11-07 08:18:14 +01:00
* Smarty Internal Plugin Compile Nocache Class
2013-11-09 21:02:56 +01:00
*
2018-11-07 08:18:14 +01:00
* @package Smarty
2013-11-09 21:02:56 +01:00
* @subpackage Compiler
*/
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
{
/**
2018-11-07 08:18:14 +01:00
* Array of names of valid option flags
2013-11-09 21:02:56 +01:00
*
2018-11-07 08:18:14 +01:00
* @var array
*/
public $option_flags = array();
/**
* Compiles code for the {nocache} tag
2013-11-09 21:02:56 +01:00
* This tag does not generate compiled output. It only sets a compiler flag.
*
2018-11-07 08:18:14 +01:00
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
2013-11-09 21:02:56 +01:00
* @return bool
*/
2018-11-07 08:18:14 +01:00
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
2013-11-09 21:02:56 +01:00
{
$_attr = $this->getAttributes($compiler, $args);
2018-11-07 08:18:14 +01:00
$this->openTag($compiler, 'nocache', array($compiler->nocache));
2013-11-09 21:02:56 +01:00
// enter nocache mode
$compiler->nocache = true;
// this tag does not return compiled code
$compiler->has_code = false;
return true;
}
}
/**
* Smarty Internal Plugin Compile Nocacheclose Class
*
2018-11-07 08:18:14 +01:00
* @package Smarty
2013-11-09 21:02:56 +01:00
* @subpackage Compiler
*/
class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
{
/**
* Compiles code for the {/nocache} tag
* This tag does not generate compiled output. It only sets a compiler flag.
*
2018-11-07 08:18:14 +01:00
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
2013-11-09 21:02:56 +01:00
* @return bool
*/
2018-11-07 08:18:14 +01:00
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
2013-11-09 21:02:56 +01:00
{
$_attr = $this->getAttributes($compiler, $args);
2018-11-07 08:18:14 +01:00
// leave nocache mode
list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));
2013-11-09 21:02:56 +01:00
// this tag does not return compiled code
$compiler->has_code = false;
return true;
}
}