server/onyx/modules/templates/smarty/sysplugins/smarty_internal_compile_nocache.php

71 lines
1.8 KiB
PHP
Raw Normal View History

2013-10-09 13:40:23 +00:00
<?php
/**
* Smarty Internal Plugin Compile Nocache
* Compiles the {nocache} {/nocache} tags.
*
2015-01-14 10:28:47 +00:00
* @package Smarty
2013-10-09 13:40:23 +00:00
* @subpackage Compiler
2015-01-14 10:28:47 +00:00
* @author Uwe Tews
2013-10-09 13:40:23 +00:00
*/
/**
2015-01-14 10:28:47 +00:00
* Smarty Internal Plugin Compile Nocache Class
2013-10-09 13:40:23 +00:00
*
2015-01-14 10:28:47 +00:00
* @package Smarty
2013-10-09 13:40:23 +00:00
* @subpackage Compiler
*/
2013-10-09 17:08:38 +00:00
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
{
2013-10-09 13:40:23 +00:00
/**
* Compiles code for the {nocache} tag
* This tag does not generate compiled output. It only sets a compiler flag.
*
2013-10-09 17:08:38 +00:00
* @param array $args array with attributes from parser
* @param object $compiler compiler object
2015-01-14 10:28:47 +00:00
*
2013-10-09 13:40:23 +00:00
* @return bool
*/
public function compile($args, $compiler)
{
$_attr = $this->getAttributes($compiler, $args);
if ($_attr['nocache'] === true) {
$compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
}
// enter nocache mode
$compiler->nocache = true;
// this tag does not return compiled code
$compiler->has_code = false;
2013-10-09 17:08:38 +00:00
2013-10-09 13:40:23 +00:00
return true;
}
}
/**
* Smarty Internal Plugin Compile Nocacheclose Class
*
2015-01-14 10:28:47 +00:00
* @package Smarty
2013-10-09 13:40:23 +00:00
* @subpackage Compiler
*/
2013-10-09 17:08:38 +00:00
class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
{
2013-10-09 13:40:23 +00:00
/**
* Compiles code for the {/nocache} tag
* This tag does not generate compiled output. It only sets a compiler flag.
*
2013-10-09 17:08:38 +00:00
* @param array $args array with attributes from parser
* @param object $compiler compiler object
2015-01-14 10:28:47 +00:00
*
2013-10-09 13:40:23 +00:00
* @return bool
*/
public function compile($args, $compiler)
{
$_attr = $this->getAttributes($compiler, $args);
2015-01-14 10:28:47 +00:00
// leave nocache mode
$compiler->nocache = false;
2013-10-09 13:40:23 +00:00
// this tag does not return compiled code
$compiler->has_code = false;
2013-10-09 17:08:38 +00:00
2013-10-09 13:40:23 +00:00
return true;
}
}