Redbean + Smarty update
This commit is contained in:
parent
c1b8226466
commit
eb0835ff74
122 changed files with 12653 additions and 11637 deletions
|
@ -1,45 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Print Expression
|
||||
*
|
||||
* Compiles any tag which will output an expression or variable
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
* Smarty Internal Plugin Compile Print Expression
|
||||
* Compiles any tag which will output an expression or variable
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
* @author Uwe Tews
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty Internal Plugin Compile Print Expression Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
*/
|
||||
* Smarty Internal Plugin Compile Print Expression Class
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage Compiler
|
||||
*/
|
||||
class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase
|
||||
{
|
||||
/**
|
||||
* Attribute definition: Overwrites base class.
|
||||
*
|
||||
* @var array
|
||||
* @see Smarty_Internal_CompileBase
|
||||
*/
|
||||
* Attribute definition: Overwrites base class.
|
||||
*
|
||||
* @var array
|
||||
* @see Smarty_Internal_CompileBase
|
||||
*/
|
||||
public $optional_attributes = array('assign');
|
||||
/**
|
||||
* Attribute definition: Overwrites base class.
|
||||
*
|
||||
* @var array
|
||||
* @see Smarty_Internal_CompileBase
|
||||
*/
|
||||
* Attribute definition: Overwrites base class.
|
||||
*
|
||||
* @var array
|
||||
* @see Smarty_Internal_CompileBase
|
||||
*/
|
||||
public $option_flags = array('nocache', 'nofilter');
|
||||
|
||||
/**
|
||||
* Compiles code for gererting output from any expression
|
||||
*
|
||||
* @param array $args array with attributes from parser
|
||||
* @param object $compiler compiler object
|
||||
* @param array $parameter array with compilation parameter
|
||||
* @return string compiled code
|
||||
*/
|
||||
* Compiles code for generating output from any expression
|
||||
*
|
||||
* @param array $args array with attributes from parser
|
||||
* @param object $compiler compiler object
|
||||
* @param array $parameter array with compilation parameter
|
||||
*
|
||||
* @throws SmartyException
|
||||
* @return string compiled code
|
||||
*/
|
||||
public function compile($args, $compiler, $parameter)
|
||||
{
|
||||
// check and get attributes
|
||||
|
@ -48,12 +49,6 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||
if ($_attr['nocache'] === true) {
|
||||
$compiler->tag_nocache = true;
|
||||
}
|
||||
// filter handling
|
||||
if ($_attr['nofilter'] === true) {
|
||||
$_filter = 'false';
|
||||
} else {
|
||||
$_filter = 'true';
|
||||
}
|
||||
if (isset($_attr['assign'])) {
|
||||
// assign output to variable
|
||||
$output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";
|
||||
|
@ -71,13 +66,13 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||
$modifierlist = array();
|
||||
foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
|
||||
preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
|
||||
for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {
|
||||
for ($i = 0, $count = count($mod_array[0]); $i < $count; $i ++) {
|
||||
if ($mod_array[0][$i] != ':') {
|
||||
$modifierlist[$key][] = $mod_array[0][$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
$compiler->default_modifier_list = $modifierlist;
|
||||
$compiler->default_modifier_list = $modifierlist;
|
||||
}
|
||||
$output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, 'value' => $output));
|
||||
}
|
||||
|
@ -85,7 +80,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||
if ($compiler->template->smarty->escape_html) {
|
||||
$output = "htmlspecialchars({$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')";
|
||||
}
|
||||
// loop over registerd filters
|
||||
// loop over registered filters
|
||||
if (!empty($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE])) {
|
||||
foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key => $function) {
|
||||
if (!is_array($function)) {
|
||||
|
@ -128,11 +123,12 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||
}
|
||||
|
||||
/**
|
||||
* @param object $compiler compiler object
|
||||
* @param string $name name of variable filter
|
||||
* @param type $output embedded output
|
||||
* @return string
|
||||
*/
|
||||
* @param object $compiler compiler object
|
||||
* @param string $name name of variable filter
|
||||
* @param string $output embedded output
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function compile_output_filter($compiler, $name, $output)
|
||||
{
|
||||
$plugin_name = "smarty_variablefilter_{$name}";
|
||||
|
@ -152,5 +148,4 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
|
|||
|
||||
return "{$plugin_name}({$output},\$_smarty_tpl)";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue