Redbean + Smarty update
This commit is contained in:
parent
c1b8226466
commit
eb0835ff74
122 changed files with 12653 additions and 11637 deletions
|
@ -1,18 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Section
|
||||
*
|
||||
* Compiles the {section} {sectionelse} {/section} tags
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Uwe Tews
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Section Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
*/
|
||||
class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase
|
||||
|
@ -44,6 +43,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase
|
|||
*
|
||||
* @param array $args array with attributes from parser
|
||||
* @param object $compiler compiler object
|
||||
*
|
||||
* @return string compiled code
|
||||
*/
|
||||
public function compile($args, $compiler)
|
||||
|
@ -69,10 +69,11 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase
|
|||
break;
|
||||
|
||||
case 'show':
|
||||
if (is_bool($attr_value))
|
||||
if (is_bool($attr_value)) {
|
||||
$show_attr_value = $attr_value ? 'true' : 'false';
|
||||
else
|
||||
} else {
|
||||
$show_attr_value = "(bool) $attr_value";
|
||||
}
|
||||
$output .= "{$section_props}['show'] = $show_attr_value;\n";
|
||||
break;
|
||||
|
||||
|
@ -91,23 +92,27 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase
|
|||
}
|
||||
}
|
||||
|
||||
if (!isset($_attr['show']))
|
||||
if (!isset($_attr['show'])) {
|
||||
$output .= "{$section_props}['show'] = true;\n";
|
||||
}
|
||||
|
||||
if (!isset($_attr['loop']))
|
||||
if (!isset($_attr['loop'])) {
|
||||
$output .= "{$section_props}['loop'] = 1;\n";
|
||||
}
|
||||
|
||||
if (!isset($_attr['max']))
|
||||
if (!isset($_attr['max'])) {
|
||||
$output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
|
||||
else
|
||||
} else {
|
||||
$output .= "if ({$section_props}['max'] < 0)\n" . " {$section_props}['max'] = {$section_props}['loop'];\n";
|
||||
}
|
||||
|
||||
if (!isset($_attr['step']))
|
||||
if (!isset($_attr['step'])) {
|
||||
$output .= "{$section_props}['step'] = 1;\n";
|
||||
}
|
||||
|
||||
if (!isset($_attr['start']))
|
||||
if (!isset($_attr['start'])) {
|
||||
$output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
|
||||
else {
|
||||
} else {
|
||||
$output .= "if ({$section_props}['start'] < 0)\n" . " {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" . "else\n" . " {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
|
||||
}
|
||||
|
||||
|
@ -134,13 +139,12 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Sectionelse Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
*/
|
||||
class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase
|
||||
|
@ -150,6 +154,7 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase
|
|||
*
|
||||
* @param array $args array with attributes from parser
|
||||
* @param object $compiler compiler object
|
||||
*
|
||||
* @return string compiled code
|
||||
*/
|
||||
public function compile($args, $compiler)
|
||||
|
@ -162,13 +167,12 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase
|
|||
|
||||
return "<?php endfor; else: ?>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Sectionclose Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
*/
|
||||
class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase
|
||||
|
@ -178,6 +182,7 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase
|
|||
*
|
||||
* @param array $args array with attributes from parser
|
||||
* @param object $compiler compiler object
|
||||
*
|
||||
* @return string compiled code
|
||||
*/
|
||||
public function compile($args, $compiler)
|
||||
|
@ -198,5 +203,4 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase
|
|||
return "<?php endfor; endif; ?>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue