diff options
author | plegall <plg@piwigo.org> | 2015-12-10 14:02:22 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-10 14:02:22 +0100 |
commit | fa10e0945ecd45bfe78a2c8fb015a43092b4944b (patch) | |
tree | 19cf59c08877e43325efbe9a2584114011a25522 /include/smarty/libs/sysplugins/smarty_internal_compile_break.php | |
parent | 16f6a54fa719cc79ff942e4bb8139d7ca09ed997 (diff) |
bug #385 update to smarty-3.1.28-dev (from Github)
Diffstat (limited to 'include/smarty/libs/sysplugins/smarty_internal_compile_break.php')
-rw-r--r-- | include/smarty/libs/sysplugins/smarty_internal_compile_break.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_internal_compile_break.php b/include/smarty/libs/sysplugins/smarty_internal_compile_break.php index b25bef6c4..cbc73d36a 100644 --- a/include/smarty/libs/sysplugins/smarty_internal_compile_break.php +++ b/include/smarty/libs/sysplugins/smarty_internal_compile_break.php @@ -1,21 +1,21 @@ <?php /** * Smarty Internal Plugin Compile Break - * * Compiles the {break} tag * - * @package Smarty + * @package Smarty * @subpackage Compiler - * @author Uwe Tews + * @author Uwe Tews */ + /** * Smarty Internal Plugin Compile Break Class * - * @package Smarty + * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -23,6 +23,7 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { * @see Smarty_Internal_CompileBase */ public $optional_attributes = array('levels'); + /** * Attribute definition: Overwrites base class. * @@ -34,24 +35,26 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { /** * Compiles code for the {break} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object + * @param array $parameter array with compilation parameter + * * @return string compiled code + * @throws \SmartyCompilerException */ - public function compile($args, $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true); // check and get attributes $_attr = $this->getAttributes($compiler, $args); if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); + $compiler->trigger_template_error('nocache option not allowed', null, true); } if (isset($_attr['levels'])) { if (!is_numeric($_attr['levels'])) { - $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno); + $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); } $_levels = $_attr['levels']; } else { @@ -61,17 +64,14 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase { $stack_count = count($compiler->_tag_stack) - 1; while ($level_count > 0 && $stack_count >= 0) { if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { - $level_count--; + $level_count --; } - $stack_count--; + $stack_count --; } if ($level_count != 0) { - $compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno); + $compiler->trigger_template_error("cannot break {$_levels} level(s)", null, true); } - $compiler->has_code = true; - return "<?php break {$_levels}?>"; - } + return "<?php break {$_levels};?>"; + } } - -?>
\ No newline at end of file |