In the template manager, add an option to echo in the opening tag
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 14 Apr 2008 18:09:39 +0000 (14:09 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 14 Apr 2008 18:09:39 +0000 (14:09 -0400)
* Template.php:
(BSTemplate::_parseTokens): If the tag is <%- convert it to <?php echo

CHANGES
Template.php

diff --git a/CHANGES b/CHANGES
index 690c3d6b0ad3fa294515866cc1b696aa27a6bec0..4e7e974ed28284de68f1e8c7bf64cda6b61b1440 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,3 +7,4 @@
 - New: Added an ability to quick-set API information via an array with BSApi::setArray()
 - New: Made many private members protected or public
 - Change: Added BSPrinterAbstract::__toString() that merely calls paint()
+- Change: BSTemplate is completely redone
index 054675740d88b1a9521f6a623e47d3c8daea7146..9f4e68e23436612188ead00ac96b7f0e83446204 100644 (file)
@@ -288,7 +288,8 @@ class BSTemplate
                                else if (sizeof($stack) == 1)
                                {
                                        $open = array_pop($stack);
-                                       $replace = '<?php ' . BSFunctions::substring($template, $open + 2, $i) . ' ?>';
+                                       $echo = ($template[$open + 2] == '-' ? 'echo ' : '');
+                                       $replace = '<?php ' . $echo . BSFunctions::substring($template, $open + ($echo ? 3 : 2), $i) . ' ?>';
                                        $template = substr_replace($template, $replace, $open, ($i + 2) - $open);
                                }
                                // just pop it off