cvs: php4 /pear/HTML ITX.php
| From: | Ulf Wendel | Date: | Mon, 10 Dec 2001 13:05:58 +0000 |
| Subject: | cvs: php4 /pear/HTML ITX.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1497@lists.php.net to get a copy of this message | ||
uw Mon Dec 10 08:05:58 2001 EDT
Modified files:
/php4/pear/HTML ITX.php
Log:
Bugfix on addBlock(), recursively build the list of variables in inner,
nested blocks.
I should have never ever written ITX; I did so because it was simple to do
so. When you use addBlock & friends always keep in mind that these functions stand
against the nature of IT. IT analyses the nesting of blocks to give you a
simple block api and make your code easy to understand. It was not made to
manipulate the nesting during runtime. Use e.g. phplib templates
(which are ++FastTemplate) for this.
Index: php4/pear/HTML/ITX.php
diff -u php4/pear/HTML/ITX.php:1.10 php4/pear/HTML/ITX.php:1.11
--- php4/pear/HTML/ITX.php:1.10 Thu Dec 6 11:01:52 2001
+++ php4/pear/HTML/ITX.php Mon Dec 10 08:05:58 2001
@@ -16,10 +16,10 @@
// | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> |
// +----------------------------------------------------------------------+
//
-// $Id: ITX.php,v 1.10 2001/12/06 16:01:52 uw Exp $
+// $Id: ITX.php,v 1.11 2001/12/10 13:05:58 uw Exp $
//
-require_once('IT.php');
+require_once('HTML/IT.php');
/**
* Integrated Template Extension - ITX
@@ -35,7 +35,7 @@
*
* @author Ulf Wendel <uw@netuse.de>
* @access public
-* @version $Id: ITX.php,v 1.10 2001/12/06 16:01:52 uw Exp $
+* @version $Id: ITX.php,v 1.11 2001/12/10 13:05:58 uw Exp $
* @package IT[X]
*/
class IntegratedTemplateExtension extends IntegratedTemplate {
@@ -276,6 +276,7 @@
$this->deleteFromBlockvariablelist($parents[0], $placeholder);
$this->updateBlockvariablelist($blockname);
+ /*
// check if any inner blocks were found
if(is_array($this->blockinner[$blockname]) and count($this->blockinner[$blockname])
> 0) {
// loop through inner blocks, registering the variable placeholders in each
@@ -283,6 +284,7 @@
$this->updateBlockvariablelist($childBlock);
}
}
+ */
return true;
} // end func addBlock
@@ -676,6 +678,15 @@
} else {
$this->blockvariables[$block] = array();
}
+
+ // check if any inner blocks were found
+ if (is_array($this->blockinner[$block]) and count($this->blockinner[$block]) > 0)
{
+ // loop through inner blocks, registering the variable placeholders in each
+ foreach($this->blockinner[$block] as $childBlock) {
+ $this->updateBlockvariablelist($childBlock);
+ }
+ }
+
} // end func updateBlockvariablelist
/**