Index: branches/RC/core/kernel/nparser/ntags.php =================================================================== diff -u -N -r10610 -r10740 --- branches/RC/core/kernel/nparser/ntags.php (.../ntags.php) (revision 10610) +++ branches/RC/core/kernel/nparser/ntags.php (.../ntags.php) (revision 10740) @@ -98,7 +98,7 @@ class _Tag_DefineElement extends _BlockTag { /*var $ElemName; - + function Open($tag) { $o = ''; @@ -136,12 +136,12 @@ $code[] = '}'; $code[] = "return \$_output === true ? '' : \$_output;"; $code[] = '}}'; - + $code[] = "\$_parser->CachableElements['".$this->ElemName."'] = ".($this->Parser->Cachable[$this->Parser->Level] ? 'true':'false').';'; - + $o .= 'AppendCode($o, $code, false); - + return $o; // $this->Parser->Definitions .= $o."\n"; // return ''; @@ -248,7 +248,7 @@ // $code[] = "\$_parser->CacheEndInside();"; // $code[] = "}"; $o .= 'AppendCode($o, $this->Parser->BreakCache('', $pointer.'a', "\$_parser->CachableElements['".$tag['NP']['name']."']"), false); $this->AppendCode($o, "echo (\$_parser->ParseBlock($to_pass));\n", false); $this->AppendCode($o, $this->Parser->BreakCache('', $pointer.'b') . " ?".">\n", false); @@ -295,11 +295,27 @@ { $o = parent::Open($tag); + $capture_params = $tag['NP']; + $capture_params['name'] = '__capture_' . $tag['NP']['name']; + + $capture_to_pass = $this->Parser->CompileParamsArray($capture_params); $code[] = "if (isset(\$_parser->Captures['{$tag['NP']['name']}'])) {"; - $code[] = "\${$tag['NP']['name']} = \$_parser->ParseBlock(array('name' => '__capture_{$tag['NP']['name']}'));"; - $code[] = "\$params['{$tag['NP']['name']}'] = \${$tag['NP']['name']};"; + $code[] = "\${$tag['NP']['name']} = \$_parser->ParseBlock($capture_to_pass);"; $code[] = "}"; + $code[] = "else {"; + $to_pass = $this->Parser->CompileParamsArray($tag['NP']); + $code[] = '$_p_ =& $_parser->GetProcessor(\'m\');'; + $code[] = '$_tag_params = ' . $to_pass . ';'; + $code[] = "\${$tag['NP']['name']} = \$_p_->PostProcess(\${$tag['NP']['name']}, \$_p_->PreparePostProcess(\$_tag_params));"; + $code[] = "}"; + + if (array_key_exists('plus', $tag['NP'])) { + $code[] = "\${$tag['NP']['name']} += {$tag['NP']['plus']};"; + } + + $code[] = "\$params['{$tag['NP']['name']}'] = \${$tag['NP']['name']};"; $code[] = "echo (\${$tag['NP']['name']});"; + $this->AppendCode($o, $code); return $o; } @@ -413,20 +429,20 @@ } class _Tag_Cache extends _BlockTag { - + function Open($tag) { $pointer = abs(crc32($tag['file'])).'_'.$tag['line']; $o = ''; $this->AppendCode($o, "if (!\$_parser->CacheStart('{$pointer}')) {\n"); return $o; } - + function Close($tag) { $o = $this->Parser->Buffers[$this->Parser->Level]; $this->AppendCode($o, "\$_parser->CacheEnd();\n}\n"); return $o; } - + }