Index: trunk/core/kernel/processors/tag_processor.php =================================================================== diff -u -N -r8686 -r8860 --- trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 8686) +++ trunk/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 8860) @@ -40,11 +40,30 @@ }*/ } - function ProcessParsedTag($tag, $params, $prefix) + function CheckTag($tag, $prefix) { $Method = $tag; if(method_exists($this, $Method)) { + return true; + } + else { + if ($this->Application->hasObject('TagsAggregator')) { + $aggregator =& $this->Application->recallObject('TagsAggregator'); + $tmp = $this->Application->processPrefix($prefix); + $tag_mapping = $aggregator->GetArrayValue($tmp['prefix'], $Method); + if ($tag_mapping) { + return true; + } + } + } + } + + function ProcessParsedTag($tag, $params, $prefix, $file='unknown', $line=0) + { + $Method = $tag; + if(method_exists($this, $Method)) + { if ($this->Application->isDebugMode() && constOn('DBG_SHOW_TAGS')) { $this->Application->Debugger->appendHTML('Processing PreParsed Tag '.$Method.' in '.$this->Prefix); } @@ -118,14 +137,50 @@ if ($this->Application->isDebugMode()) { $this->Application->Debugger->appendTrace(); } - trigger_error('Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', E_USER_WARNING); + $this->Application->handleError(E_USER_ERROR, 'Tag '.$Method.' Undefined in '.get_class($this).'[Agregated Tag]:
'.$tag.'', $file, $line); } - trigger_error('Tag Undefined:
'.$prefix.':'.$tag.'',E_USER_WARNING); + $this->Application->handleError(E_USER_ERROR, 'Tag Undefined:
'.$prefix.':'.$tag.'', $file, $line); return false; } } + function PreparePostProcess(&$params) + { + $flags = Array('js_escape', 'result_to_var', 'pass_params', 'html_escape', 'strip_nl'); + $flag_values = Array(); + foreach ($flags as $flag_name) { + $flag_values[$flag_name] = false; + if (isset($params[$flag_name])) { + $flag_values[$flag_name] = $params[$flag_name]; + unset($params[$flag_name]); + } + } + return $flag_values; + } + + function PostProcess($ret, $flag_values) + { + if ($flag_values['js_escape']) { + $ret = addslashes($ret); + $ret = str_replace(Array("\r", "\n"), Array('\r', '\n'), $ret); + $ret = str_replace('', "", $ret); + } + if ($flag_values['html_escape']) { + $ret = htmlspecialchars($ret); + } + if ($flag_values['strip_nl']) { + // 1 - strip \r,\n; 2 - strip tabs too + $ret = preg_replace($flag_values['strip_nl'] == 2 ? "/[\r\n\t]/" : "/[\r\n]/", '', $ret); + } + if ($flag_values['result_to_var']) { + $this->Application->Parser->SetParam($flag_values['result_to_var'], $ret); + $ret = ''; + } + return $ret; + } + + /** * Not tag, method for parameter * selection from list in this TagProcessor