cvs: pear /HTML_OOH_Form/layoutmanager form_itmanager.php

From: Date: Sun, 14 Oct 2001 18:22:52 +0000
Subject: cvs: pear /HTML_OOH_Form/layoutmanager form_itmanager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1017@lists.php.net to get a copy of this message
uw Sun Oct 14 14:22:52 2001 EDT Added files: /pear/HTML_OOH_Form/layoutmanager form_itmanager.php Log: Added IT[X] template wrapper - untested. Index: pear/HTML_OOH_Form/layoutmanager/form_itmanager.php +++ pear/HTML_OOH_Form/layoutmanager/form_itmanager.php <?php /** * "Layoutmanager" using a template. * * Well, this is not a classical layout manager. It's rather a wrapper * to IT[X] templates without any logics off it's own. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @version $Id: form_itmanager.php,v 1.1 2001/10/14 18:22:52 uw Exp $ * @access public * @package Form */ class itmanager extends layoutmanager { function itmanager() { $this->themed(); } // end constructor function get() { return $this->tpl->get(); } // end func get function addItem(&$obj, $display_method = 'get', $method_params = '', $field = '') { $this->addContent($this->callMethod($display_method, &$obj, $method_params), $field); } // end func addItem function addContent($content, $field = '') { if ($field) { if ($this->tpl->setCurrentBlock($field)) { // block exists and might contain a variable of the same name $this->tpl->setVariable($field, $content); $this->tpl->setVariable($field, strtoupper($content)); // make sure the block will be show even if there's no variable in $this->tpl->touchBlock($field); $this->tpl->parseCurrentBlock(); } else { // use field as a variable name $this->tpl->setVariable($field, $content); } } else { // this is for compatibility only - I don't // see any practical usage for it at the moment $this->tpl->setCurrentBlock('_default'); $this->tpl->setVariable('_default', $content); $this->tpl->parseCurrentBlock(); } } // end func addContent } // end class itmanager ?>

« previous php.pear.cvs (#1017) next »