Index: trunk/core/kernel/processors/tag_processor.php =================================================================== diff -u -N -r4996 -r6093 --- trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 4996) +++ trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 6093) @@ -1,7 +1,7 @@ ProcessParsedTag($tag->Tag, $tag->NP, $tag->getPrefixSpecial()); - + /*$Method=$tag->Tag; if(method_exists($this, $Method)) { //echo htmlspecialchars($tag->GetFullTag()).'
'; return $this->$Method($tag->NP); } - else + else { if ($this->Application->hasObject('TagsAggregator')) { $aggregator =& $this->Application->recallObject('TagsAggregator'); $tag_mapping = $aggregator->GetArrayValue($tag->Prefix, $Method); if ($tag_mapping) { - + $mapped_tag =& new Tag('', $this->Application->Parser); $mapped_tag->CopyFrom($tag); $mapped_tag->Processor = $tag_mapping[0]; $mapped_tag->Tag = $tag_mapping[1]; $mapped_tag->NP['PrefixSpecial'] = $tag->getPrefixSpecial(); $mapped_tag->RebuildTagData(); return $mapped_tag->DoProcessTag(); - } + } } trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag->RebuildTagData().'',E_USER_WARNING); return false; }*/ } - + function ProcessParsedTag($tag, $params, $prefix) { $Method = $tag; @@ -49,13 +49,29 @@ $this->Application->Debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix); } - //echo htmlspecialchars($tag->GetFullTag()).'
'; + // pass_params for non ParseBlock tags :) + if (isset($params['pass_params']) && $params['pass_params']) { + $params = array_merge_recursive2($this->Application->Parser->Params, $params); + unset($params['pass_params']); + } + + $backup_prefix = $this->Prefix; + $backup_special = $this->Special; + $ret = $this->$Method($params); + + $this->Prefix = $backup_prefix; + $this->Special = $backup_special; + if (isset($params['js_escape']) && $params['js_escape']) { $ret = str_replace('\'', ''', $ret); $ret = addslashes($ret); $ret = str_replace(Array("\r", "\n"), Array('\r', '\n'), $ret); } + if (isset($params['result_to_var'])) { + $this->Application->Parser->SetParam($params['result_to_var'], $ret); + $ret = ''; + } return $ret; } else @@ -71,16 +87,21 @@ $processor->Prefix = $tmp['prefix']; $processor->Special = getArrayValue($tag_mapping, 2) ? $tag_mapping[2] : $tmp['special']; $params['PrefixSpecial'] = $prefix; - return $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix); + $ret = $processor->ProcessParsedTag($tag_mapping[1], $params, $prefix); + if (isset($params['result_to_var'])) { + $this->Application->Parser->SetParam($params['result_to_var'], $ret); + $ret = ''; + } + return $ret; } trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING); } trigger_error('Tag Undefined:
'.$prefix.':'.$tag.'',E_USER_WARNING); return false; } } - - + + /** * Not tag, method for parameter * selection from list in this TagProcessor @@ -94,7 +115,7 @@ { if (!is_array($params)) return; if (!is_array($possible_names)) - + $possible_names = explode(',', $possible_names); foreach ($possible_names as $name) { @@ -109,13 +130,13 @@ var $Application; var $Prefixes = Array(); var $S; - + function ProcessorsPool() { $this->Application =& KernelApplication::Instance(); $this->S =& $this->Application->Session; } - + function RegisterPrefix($prefix, $path, $class) { // echo " RegisterPrefix $prefix, $path, $class
"; @@ -125,23 +146,23 @@ ); $this->Prefixes[$prefix] = $prefix_item; } - + function CreateProcessor($prefix, &$tag) { // echo " prefix : $prefix
"; if (!isset($this->Prefixes[$prefix])) - die ("Filepath and ClassName for prefix $prefix not defined while processing ".htmlspecialchars($tag->GetFullTag())."!"); + $this->Application->ApplicationDie ("Filepath and ClassName for prefix $prefix not defined while processing ".htmlspecialchars($tag->GetFullTag())."!"); include_once($this->Prefixes[$prefix]['path']); $ClassName = $this->Prefixes[$prefix]['class']; $a_processor =& new $ClassName($prefix); $this->SetProcessor($prefix, $a_processor); } - + function SetProcessor($prefix, &$a_processor) { $this->Processors[$prefix] =& $a_processor; } - + function &GetProcessor($prefix, &$tag) { if (!isset($this->Processors[$prefix]))