Index: trunk/core/kernel/parser/tags.php =================================================================== diff -u -N -r5547 -r6093 --- trunk/core/kernel/parser/tags.php (.../tags.php) (revision 5547) +++ trunk/core/kernel/parser/tags.php (.../tags.php) (revision 6093) @@ -260,6 +260,10 @@ // $tag->Prefix - l_TagProcessor $tmp = $this->Application->processPrefix($this->Processor); + if (isset($this->NamedParams['_ignore_missing_'])) { + if (!$this->Application->prefixRegistred($tmp['prefix'])) return ''; + } + $processor =& $this->Application->recallObject($tmp['prefix'].'_TagProcessor'); // $this->Processor $tmp=explode('_',$tmp['prefix'],2); @@ -313,7 +317,8 @@ switch ( $this->Tag ) { case 'DefaultParam': foreach ($this->NP as $key => $val) { - $code[] = '$'.$key.' = $'.$key.' ? $'.$key.' : \''.$val.'\';'; + $code[] = 'if (!isset($'.$key.')) $application->Parser->SetParam(\''.$key.'\', \''.$val.'\');'; + $code[] = '$'.$key.' = isset($'.$key.') ? $'.$key.' : \''.$val.'\';'; } return $code; case 'param': @@ -332,7 +337,9 @@ } else { $function = $check; - $prefix = $this->Parser->GetParam('PrefixSpecial'); + $prefix = '$PrefixSpecial'; + +// $prefix = $this->Parser->GetParam('PrefixSpecial'); } } else { @@ -373,10 +380,20 @@ } else { $processor_to_check = $tmp_processor; - } */ + } */ - $code[] = '$tmp = $application->processPrefix("'.$this->getPrefixSpecial().'");'."\n"; + if (isset($this->NamedParams['_auto_prefix_'])) { + $prefix = '$PrefixSpecial'; + } + else { + $prefix = $this->getPrefixSpecial(); + if (isset($this->NamedParams['_ignore_missing_'])) { + if (!$this->Application->prefixRegistred($prefix)) return array(); + } + } + $code[] = '$tmp = $application->processPrefix("'.$prefix.'");'."\n"; + /*if (!isset($this->Application->CompilationCache[$this->getPrefixSpecial()])) { $code[] = '$tmp = $application->processPrefix("'.$this->getPrefixSpecial().'");'."\n"; $code[] = '$__tp = $tmp[\'prefix\'].\'_TagProcessor\';'."\n"; @@ -404,6 +421,11 @@ /*$code = ' $processor =& $application->recallObject(\''.$this->Processor.'_TagProcessor\'); $o .= $processor->ProcessParsedTag(\''.$this->Tag.'\', unserialize(\''.serialize($this->NP).'\'));';*/ + if (isset($pass_params['result_to_var'])) { + $code[] = '$'.$pass_params['result_to_var'].' = $application->Parser->GetParam(\''.$pass_params['result_to_var'].'\');'; + $echo = false; + } + if ($echo) $code[] = ' echo $o;'."\n"; return $code;