Update of /cvsroot/phpwebapp/web_app/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24745/parser
Modified Files:
class.Parser.php class.Render.php
Log Message:
Added the (framework) tag <unindented>. By default the framework indents
all the templates that are processed or included. However sometimes may
be usefull not to indent a part of a template. This can be done by
including it inside the <unindeted> tag, like this:
<unindented>
{{file_revision}}
</unindented>
Index: class.Parser.php
===================================================================
RCS file: /cvsroot/phpwebapp/web_app/parser/class.Parser.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** class.Parser.php 14 May 2005 05:45:17 -0000 1.22
--- class.Parser.php 9 Jun 2005 13:12:53 -0000 1.23
***************
*** 307,310 ****
--- 307,311 ----
case 'EXAMPLE':
case 'TEXTAREA':
+ case 'UNINDENTED':
$start_ELEMENT = 'start_'.$name;
$this->$start_ELEMENT($attribs);
***************
*** 356,359 ****
--- 357,361 ----
case 'XMP':
case 'TEXTAREA':
+ case 'UNINDENTED':
$end_ELEMENT = 'end_'.$name;
$this->$end_ELEMENT();
***************
*** 1061,1064 ****
--- 1063,1080 ----
}
+ function start_UNINDENTED($attribs)
+ {
+ static $tpl_id = "Unindented_001";
+ $tpl = new Template($tpl_id++, 'UnindentedTpl');
+ $tpl->attr_list = $this->get_attr_list($attribs);
+ $this->push_current_tpl($tpl);
+ }
+ function end_UNINDENTED()
+ {
+ //the param 'false' in order not to normalize space
+ $tpl = $this->pop_current_tpl(false);
+ $this->link_template($tpl);
+ }
+
/////////////////////////////////////////////////////////////
Index: class.Render.php
===================================================================
RCS file: /cvsroot/phpwebapp/web_app/parser/class.Render.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** class.Render.php 18 Apr 2005 09:41:27 -0000 1.20
--- class.Render.php 9 Jun 2005 13:12:53 -0000 1.21
***************
*** 189,192 ****
--- 189,195 ----
$this->render_tpl($tpl);
break;
+ case "UnindentedTpl":
+ $this->render_tpl_unindented($tpl);
+ break;
case "PreTpl":
case "XmpTpl":
|