[svn:p5ee] r8038 - p5ee/trunk/App-Widget/lib/App

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Thu Nov  9 13:12:39 2006
New Revision: 8038

Modified:
   p5ee/trunk/App-Widget/lib/App/TemplateEngine.pm

Log:
Fixed bug with expand vars

Modified: p5ee/trunk/App-Widget/lib/App/TemplateEngine.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/TemplateEngine.pm	(original)
+++ p5ee/trunk/App-Widget/lib/App/TemplateEngine.pm	Thu Nov  9 13:12:39 2006
@@ -301,7 +301,12 @@
             else {
                 $value = "";
             }
-            $template_text =~ s/\{$var\}/$value/g;
+            if ($expand) {
+                $template_text =~ s/\{\+$var\}/$value/g;
+            }
+            else {
+                $template_text =~ s/\{$var\}/$value/g;
+            }
         }
     }
 
@@ -323,7 +328,13 @@
         else {
             $value = "";
         }
-        $template_text =~ s/\[%\+$var%\]/$value/g;
+
+        if ($expand) {
+            $template_text =~ s/\[%\+$var%\]/$value/g;
+        }
+        else {
+            $template_text =~ s/\[%$var%\]/$value/g;
+        }
     }
 
     &App::sub_exit($template_text) if ($App::trace);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.