openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 2ad3073949c66f623ada64d8990d118141c7b321
parent 86a90272703f5bcf7430d026b98466571b7e15fe
Author: dankert <devnull@localhost>
Date:   Fri, 15 Jan 2010 10:13:25 +0100

Einfacheres unset(...); Variablen mit %var-name% einbinden.

Diffstat:
MserviceClasses/TemplateEngine.class.php | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/serviceClasses/TemplateEngine.class.php b/serviceClasses/TemplateEngine.class.php @@ -146,6 +146,23 @@ class TemplateEngine } + + function attributeValueOpenPHP($value) + { + $erg = $this->attributeValue($value); + + return '<'.'?php echo '.$erg.' ?>'; + + // TODO: Für statische Texte muesste kein PHP-Abschnitt geoeffnet werden + /* + if (substr($value,0,5) == 'text:' || strpos($value,':')===FALSE ) + return $erg; + else + return '<'.'?php '.$erg.' ?>'; + */ + } + + function attributeValue( $value ) { @@ -295,6 +312,11 @@ class TemplateEngine // Die Variablen "$attr_*" muessen pro Ebene eindeutig sein, daher wird an den // Variablennamen die Tiefe angehangen. $line = str_replace('$attr_','$a'.$hash.'_',$line); + + foreach( $attr as $attrName=>$attrValue ) + $line = str_replace('%'.$attrName.'%',$this->attributeValueOpenPHP($attrValue),$line); + + fwrite( $outFileHandler,$line ); }