Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/nparser/ntags.php
Show First 20 Lines • Show All 409 Lines • ▼ Show 20 Line(s) | |||||
return $o; | return $o; | ||||
} | } | ||||
$param_name = $tag['NP']['name']; | $param_name = $tag['NP']['name']; | ||||
$capture_params = $tag['NP']; | $capture_params = $tag['NP']; | ||||
$capture_params['name'] = '__capture_' . $param_name; | $capture_params['name'] = '__capture_' . $param_name; | ||||
$capture_to_pass = $this->Parser->CompileParamsArray($capture_params); | $capture_to_pass = $this->Parser->CompileParamsArray($capture_params); | ||||
$code[] = "if (isset(\$_parser->Captures['{$param_name}'])) {"; | $code[] = "if (isset(\$_parser->Captures[\"{$param_name}\"])) {"; | ||||
$code[] = "\t\${$param_name} = \$_parser->ParseBlock($capture_to_pass);"; | $code[] = "\t\${$param_name} = \$_parser->ParseBlock($capture_to_pass);"; | ||||
$code[] = "\t\$params['{$param_name}'] = \${$param_name};"; | $code[] = "\t\$params[\"{$param_name}\"] = \${$param_name};"; | ||||
$code[] = "\t\$tmp_{$param_name} = \${$param_name};"; | $code[] = "\t\$_param_value = \${$param_name};"; | ||||
$code[] = "}"; | $code[] = "}"; | ||||
$code[] = "else {"; | $code[] = "else {"; | ||||
$to_pass = $this->Parser->CompileParamsArray($tag['NP']); | $to_pass = $this->Parser->CompileParamsArray($tag['NP']); | ||||
$code[] = "\t" . '$_p_ =& $_parser->GetProcessor(\'m\');'; | $code[] = "\t" . '$_p_ =& $_parser->GetProcessor(\'m\');'; | ||||
$code[] = "\t" . '$_tag_params = ' . $to_pass . ';'; | $code[] = "\t" . '$_tag_params = ' . $to_pass . ';'; | ||||
$code[] = "\t\$tmp_{$param_name} = \$_p_->PostProcess(\${$param_name}, \$_p_->PreparePostProcess(\$_tag_params));"; | $code[] = "\t\$_param_value = \$_p_->PostProcess(\${$param_name}, \$_p_->PreparePostProcess(\$_tag_params));"; | ||||
$code[] = "}"; | $code[] = "}"; | ||||
if ( array_key_exists('result_to_var', $tag['NP']) && $tag['NP']['result_to_var'] ) { | if ( array_key_exists('result_to_var', $tag['NP']) && $tag['NP']['result_to_var'] ) { | ||||
$result_to_var = $tag['NP']['result_to_var']; | $result_to_var = $tag['NP']['result_to_var']; | ||||
$code[] = "\${$result_to_var} = \$_parser->GetParam('{$result_to_var}');"; | $code[] = "\${$result_to_var} = \$_parser->GetParam('{$result_to_var}');"; | ||||
if ( array_key_exists('plus', $tag['NP']) ) { | if ( array_key_exists('plus', $tag['NP']) ) { | ||||
$code[] = "\${$result_to_var} += {$tag['NP']['plus']};"; | $code[] = "\${$result_to_var} += {$tag['NP']['plus']};"; | ||||
} | } | ||||
$code[] = "\$params['{$result_to_var}'] = \${$result_to_var};"; | $code[] = "\$params['{$result_to_var}'] = \${$result_to_var};"; | ||||
} | } | ||||
elseif ( array_key_exists('plus', $tag['NP']) ) { | elseif ( array_key_exists('plus', $tag['NP']) ) { | ||||
$code[] = "\$tmp_{$param_name} += {$tag['NP']['plus']};"; | $code[] = "\$_param_value += {$tag['NP']['plus']};"; | ||||
} | } | ||||
$code[] = "echo (\$tmp_{$param_name});"; | $code[] = "echo (\$_param_value);"; | ||||
$this->AppendCode($o, $code); | $this->AppendCode($o, $code); | ||||
return $o; | return $o; | ||||
} | } | ||||
} | } | ||||
class _Tag_Include extends _BlockTag { | class _Tag_Include extends _BlockTag { | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |