cvs: pear /HTML_OOH_Form form.php form_xmlfactory.php /HTML_OOH_Form/container form_container.php form_container_enum.php /HTML_OOH_Form/elements
form_element.php form_element_date.php form_element_reset.php form_element_selectobject.php /HTML_OOH_Form/examples/form example_form.php
/HTML_OOH_Form/layoutmanager form_flowlayout.php form_gridlayout.php form_grouplayout.php form_itmanager.php form_layoutmanager.php

From: Date: Mon, 03 Jun 2002 15:16:33 +0000
Subject: cvs: pear /HTML_OOH_Form form.php form_xmlfactory.php /HTML_OOH_Form/container form_container.php form_container_enum.php /HTML_OOH_Form/elements
form_element.php form_element_date.php form_element_reset.php form_element_selectobject.php /HTML_OOH_Form/examples/form example_form.php
/HTML_OOH_Form/layoutmanager form_flowlayout.php form_gridlayout.php form_grouplayout.php form_itmanager.php form_layoutmanager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4391@lists.php.net to get a copy of this message
uw Mon Jun 3 11:16:33 2002 EDT Modified files: /pear/HTML_OOH_Form form.php form_xmlfactory.php /pear/HTML_OOH_Form/container form_container.php form_container_enum.php /pear/HTML_OOH_Form/elements form_element.php form_element_date.php form_element_reset.php form_element_selectobject.php /pear/HTML_OOH_Form/examples/form example_form.php /pear/HTML_OOH_Form/layoutmanager form_flowlayout.php form_gridlayout.php form_grouplayout.php form_itmanager.php form_layoutmanager.php Log: Minor bugfixes and include-path changes. No, no major step forward.

Index: pear/HTML_OOH_Form/form.php diff -u pear/HTML_OOH_Form/form.php:1.10 pear/HTML_OOH_Form/form.php:1.11 --- pear/HTML_OOH_Form/form.php:1.10 Tue Dec 11 14:45:37 2001 +++ pear/HTML_OOH_Form/form.php Mon Jun 3 11:16:17 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form.php,v 1.10 2001/12/11 19:45:37 sebastian Exp $ +// $Id: form.php,v 1.11 2002/06/03 15:16:17 uw Exp $ require_once('HTML_OOH_Form/form_commonobject.php'); @@ -47,11 +47,11 @@ * - tree (select box with options show as a tree) * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version $Id: form.php,v 1.10 2001/12/11 19:45:37 sebastian Exp $ +* @version $Id: form.php,v 1.11 2002/06/03 15:16:17 uw Exp $ * @access public * @package HTML_OOH_Form */ -class form2 extends form_commonobject { +class form extends form_commonobject { /** * Some default values. @@ -232,7 +232,7 @@ * @param string HTML target attribute. * @global $PHP_SELF */ - function form2($js_name = '', $method = '', $action = '', $target = '') { + function form($js_name = '', $method = '', $action = '', $target = '') { global $PHP_SELF; if ('' != $js_name) @@ -240,7 +240,7 @@ $this->setMethod($method); if ('' == $action) - $this->action = $PHP_SELF; + $this->action = $_SERVER['PHP_SELF']; else if ('' != $action) $this->action = $action; @@ -314,7 +314,7 @@ $http_x_vars = &$GLOBALS['HTTP_POST_VARS']; if (!is_array($http_x_vars) || 0 == count($http_x_vars)) { - $this->exceptions[] = new form_error("Can't find any HTTP_$this->method_VARS.", __FILE__, __LINE__); + $this->exceptions[] = new form_error("Can't find any HTTP_{$this->method}_VARS.", __FILE__, __LINE__); return true; } @@ -503,7 +503,7 @@ * @return string HTML form-Tag * @access public */ - function getStart() { + function getStart($js_name = '', $method = 'POST', $action = '', $target = '') { $html = sprintf('<form action="%s" target="%s" method="%s" ', $this->action, @@ -511,7 +511,7 @@ $this->method ); - if ($this->flag_file) { + if ($this->flag_contains_file) { $html .= 'enctype="multipart/form-data" '; $method = 'POST'; } @@ -532,7 +532,7 @@ * @brother getStart() * @access public */ - function Start() { + function Start($js_name = '', $method = 'POST', $action = '', $target = '') { $html = $this->getStart(); print $html; @@ -583,8 +583,8 @@ * @see getStart(), getFinish() * @access public */ - function get($additional_html = '') { - return $this->getStart() . $this->getFinish($additional_html); + function get($js_name = '', $method = 'POST', $action = '', $target = '', $additional_html = '') { + return $this->getStart($js_name, $method, $action, $target) . $this->getFinish($additional_html); } // end func get /** @@ -635,7 +635,7 @@ $this->element_names[$element_data['elname']] = $element_data['elname']; if ('radio' == $element_data['type'] ) - $this->radio_elements[$el->name][$element_data['elname']] = $el->value; + $this->radio_elements[$el->name][$element_data['elname']] = $el->getValue(); return true; } // end func addElement @@ -877,9 +877,9 @@ foreach ($this->getCustomValidators($vallist) as $k => $validator) { $func = $validator['name']; - if ($validator['callback'] && function_exists($func)) - ${func}(&$this); - else if (method_exists($this, $func)) + if ($validator['callback'] && function_exists($func)) { + $func($this); + } else if (method_exists($this, $func)) $this->${func}(); } @@ -909,7 +909,11 @@ } $this->validation_msg .= $message . $this->CR_HTML; - $this->validation_flags[$name] .= $message . $this->CR_HTML; + if (isset($this->validation_flags[$name])) { + $this->validation_flags[$name] .= $message . $this->CR_HTML; + } else { + $this->validation_flags[$name] = $message . $this->CR_HTML; + } return true; } // end func setValidationsError Index: pear/HTML_OOH_Form/form_xmlfactory.php diff -u pear/HTML_OOH_Form/form_xmlfactory.php:1.6 pear/HTML_OOH_Form/form_xmlfactory.php:1.7 --- pear/HTML_OOH_Form/form_xmlfactory.php:1.6 Tue Dec 11 14:45:40 2001 +++ pear/HTML_OOH_Form/form_xmlfactory.php Mon Jun 3 11:16:17 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_xmlfactory.php,v 1.6 2001/12/11 19:45:40 sebastian Exp $ +// $Id: form_xmlfactory.php,v 1.7 2002/06/03 15:16:17 uw Exp $ require_once('HTML_OOH_Form/form.php'); @@ -26,7 +26,7 @@ * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @access public * @package HTML_OOH_Form -* @version $Id: form_xmlfactory.php,v 1.6 2001/12/11 19:45:40 sebastian Exp $ +* @version $Id: form_xmlfactory.php,v 1.7 2002/06/03 15:16:17 uw Exp $ */ class form_xmlfactory extends form_commonobject { @@ -405,7 +405,7 @@ case 'phpfunction': if (isset($attrs['callback'])) - $this->attributes['validator_callback'] = ('false' == $attrs['validator_callback']) ? false : true; + $this->attributes['validator_callback'] = ('false' == $attrs['callback']) ? false : true; break; default: @@ -451,7 +451,7 @@ case 'css': if (!$this->flag_defaults) $this->attributes['style'] = (string)$this->cdata; - else + else $this->defaults['cssstyle'] = (string)$this->cdata; break; @@ -570,13 +570,24 @@ case 'text': case 'textarea': case 'textedit': - if ($data) - $this->attributes['value'] .= $data; + if ($data) { + // prevent some stupid warnings :( + if (isset($this->attributes['value'])) + $this->attributes['value'] .= $data; + else + $this->attributes['value'] = $data; + } break; case 'image': - if ($data) - $this->attributes['src'] .= $data; + if ($data) { + // prevent some stupid warnings :( + if (isset($this->attributes['src'])) + $this->attributes['src'] .= $data; + else + $this->attributes['src'] = $data; + } + break; case 'additionalhtml': @@ -599,14 +610,10 @@ case 'regexp': case 'validation': case 'year': - $this->cdata .= $data; - break; - - case 'jsfunction': + case 'jsfunction': default: - $this->cdata .= $cdata; + $this->cdata .= $data; break; - } } // end func cdata Index: pear/HTML_OOH_Form/container/form_container.php diff -u pear/HTML_OOH_Form/container/form_container.php:1.2 pear/HTML_OOH_Form/container/form_container.php:1.3 --- pear/HTML_OOH_Form/container/form_container.php:1.2 Tue Dec 11 14:45:41 2001 +++ pear/HTML_OOH_Form/container/form_container.php Mon Jun 3 11:16:18 2002 @@ -16,14 +16,14 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_container.php,v 1.2 2001/12/11 19:45:41 sebastian Exp $ +// $Id: form_container.php,v 1.3 2002/06/03 15:16:18 uw Exp $ /** * Framework of a container. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> * @package HTML_OOH_Form -* @version $Id: form_container.php,v 1.2 2001/12/11 19:45:41 sebastian Exp $ +* @version $Id: form_container.php,v 1.3 2002/06/03 15:16:18 uw Exp $ */ class form_container { @@ -142,6 +142,20 @@ var $valid_icase = false; + /** + * First option in a select or combo box with some advice to select another option. + * + * You probably know these select boxes where the first option is 'Please choose...'. + * That's what's intro for. The intro message is not a valid choise. If selected it's + * alwayscausing an error message (but only when intro_e is specified). + * + * @var strings + * @see $intro_e + */ + var $intro = ''; + + var $intro_e = ''; + /** * Perform a multiline search? * @@ -151,7 +165,7 @@ function form_container($slots) { - + reset($slots); while (list($slot, $v) = each($slots)) if ('value' == $slot) Index: pear/HTML_OOH_Form/container/form_container_enum.php diff -u pear/HTML_OOH_Form/container/form_container_enum.php:1.3 pear/HTML_OOH_Form/container/form_container_enum.php:1.4 --- pear/HTML_OOH_Form/container/form_container_enum.php:1.3 Thu Feb 7 07:19:16 2002 +++ pear/HTML_OOH_Form/container/form_container_enum.php Mon Jun 3 11:16:18 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_container_enum.php,v 1.3 2002/02/07 12:19:16 mj Exp $ +// $Id: form_container_enum.php,v 1.4 2002/06/03 15:16:18 uw Exp $ require_once('HTML_OOH_Form/container/form_container_string.php'); @@ -24,7 +24,7 @@ * Plain string input field without encoding/decoding * * @package HTML_OOH_Form -* @version $Id: form_container_enum.php,v 1.3 2002/02/07 12:19:16 mj Exp $ +* @version $Id: form_container_enum.php,v 1.4 2002/06/03 15:16:18 uw Exp $ */ class form_container_enum extends form_container_string { @@ -48,7 +48,7 @@ function validate() { return $this->validateLength() . $this->validateRegEx() . $this->validateIntro(); } // end func validate - + /** * Checks whether an intro option was selected. Index: pear/HTML_OOH_Form/elements/form_element.php diff -u pear/HTML_OOH_Form/elements/form_element.php:1.8 pear/HTML_OOH_Form/elements/form_element.php:1.9 --- pear/HTML_OOH_Form/elements/form_element.php:1.8 Tue Dec 11 14:45:41 2001 +++ pear/HTML_OOH_Form/elements/form_element.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_element.php,v 1.8 2001/12/11 19:45:41 sebastian Exp $ +// $Id: form_element.php,v 1.9 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/form_commonobject.php'); @@ -24,7 +24,7 @@ * Superclass of all form elements. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version $Id: form_element.php,v 1.8 2001/12/11 19:45:41 sebastian Exp $ +* @version $Id: form_element.php,v 1.9 2002/06/03 15:16:19 uw Exp $ * @access public * @package HTML_OOH_Form * @abstract @@ -231,6 +231,13 @@ /** + * Is this a hidden element? + * + * @var boolean + */ + var $flag_hidden = false; + + /** * Creates a new form element. * * The form object uses this constructor to setup any form element. @@ -599,7 +606,7 @@ * @see $val_events */ function react($events, $status = true) { - return $this->container($events, $status); + return $this->container->react($events, $status); } // end func react /** @@ -762,9 +769,14 @@ */ function getFrozenHiddenElement($value = '') { - return sprintf('<input type="hidden" name="%s" value="%s">', + $value = ('' != $value) ? $value : $this->container->getValue(); + $delimiter = (false === strstr($value, '"')) ? '"' : "'"; + + return sprintf('<input type="hidden" name="%s" value=%s%s%s>', $this->name, - ('' != $value) ? $value : $this->container->getValue() + $delimiter, + $value, + $delimiter ); } // end func getFrozenHiddenElement @@ -779,8 +791,11 @@ */ function getFrozenTable($border = false, $value = '') { - return sprintf('<table cellpadding="0" cellspacing="0" %s><tr><td>%s</td></tr></table>', + return sprintf('<table cellpadding="0" cellspacing="0" %s><tr><td%s%s%s>%s</td></tr></table>', ($border) ? ' border="1"' : '', + ($this->class) ? ' class="' . $this->class . '"' : '', + ($this->id) ? ' id="' . $this->id . '"' : '', + ($this->style) ? ' style="' . $this->style . '"' : '', ('' != $value) ? $value : $this->container->getValue() ); Index: pear/HTML_OOH_Form/elements/form_element_date.php diff -u pear/HTML_OOH_Form/elements/form_element_date.php:1.6 pear/HTML_OOH_Form/elements/form_element_date.php:1.7 --- pear/HTML_OOH_Form/elements/form_element_date.php:1.6 Tue Dec 11 14:45:41 2001 +++ pear/HTML_OOH_Form/elements/form_element_date.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_element_date.php,v 1.6 2001/12/11 19:45:41 sebastian Exp $ +// $Id: form_element_date.php,v 1.7 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/elements/form_element_dateobject.php'); @@ -25,7 +25,7 @@ * * Use this meta element to make sure that the user enters a valid date. * -* @version $Id: form_element_date.php,v 1.6 2001/12/11 19:45:41 sebastian Exp $ +* @version $Id: form_element_date.php,v 1.7 2002/06/03 15:16:19 uw Exp $ */ class form_element_date extends form_element_dateobject { @@ -38,11 +38,8 @@ var $optional_fields = array ( 'now' => 'string', - 'preload' => 'boolean', - 'language' => 'string', - 'intro' => 'array', 'intro_e' => 'string', @@ -106,6 +103,13 @@ var $intro = ''; /** + * Intro error message + * + * @var string + */ + var $intro_e = ''; + + /** * Preload selectors with the current date? * * @var boolean @@ -135,6 +139,7 @@ } // end func setup + /** * Returns an array with the values of the selected date. * @@ -143,27 +148,36 @@ * @return array */ function getValue() { - if ('GET' == $this->method) - $data = &$GLOBALS['HTTP_GET_VARS']; + $data = &$_GET; else - $data = &$GLOBALS['HTTP_POST_VARS']; - + $data = &$_POST; + + $predefined = $this->container->getValue(); $value = array(); + $len = strlen($this->format); for ($i = 0; $i < $len; $i++) { $sign = $this->format{$i}; if (preg_match("/[aAdDFhHgGijlmnMswYyz]/", $sign, $regs)) { - $sign = $regs[1]; - $value[$sign] = $data[$this->name . '_' . $sign]; + $sign = $regs[0]; + if (isset($data[$this->name . '_' . $sign])) + $value[$sign] = $data[$this->name . '_' . $sign]; + else if (is_array($predefined) && isset($predefined[$sign])) + $value[$sign] = $predefined[$sign]; + else + $value[$sign] = 0; } } + + $this->container->setValue($value); return $value; } // end func getValue + function get($subelement = '') { $html = array(); @@ -310,7 +324,7 @@ if ($subelement) return (isset($html[$subelement])) ? $html[$subelement] : ''; - + return join('', $html); } // end func get @@ -337,22 +351,29 @@ */ function generateSelect($name, $options) { - $html = sprintf('<select name="%s_%s" size="1"%s>%s', + $value = $this->getValue(); + $html = sprintf('<select name="%s_%s" size="1"%s %s>%s', $this->name, $name, $this->getJSonActivation($name), + $this->getCommonHTMLAttributes(), $this->CR_HTML ); - + if ($this->intro_e) { - foreach ($this->intro as $intro_value => $intro_label) - $html .= sprintf('<option value="%s">%s</option>%s', $intro_value, $intro_label, $this->CR_HTML); + + if (is_array($this->intro)) { + foreach ($this->intro as $intro_value => $intro_label) + $html .= sprintf('<option value="%s">%s</option>%s', $intro_value, $intro_label, $this->CR_HTML); + } else { + $html .= sprintf('<option value="%s">%s</option>%s', $this->intro, $this->intro, $this->CR_HTML); + } } foreach ($options as $k => $option) $html .= sprintf('<option value="%s"%s>%s</option>%s', $option, - ((isset($this->value[$name]) && $option == $this->value[$name]) || (!$selected && $this->preload && $option == $this->getPreloadValue($name))) ? " selected" : "", + ((isset($value[$name]) && $option == $value[$name]) || ($this->preload && $option == $this->getPreloadValue($name))) ? " selected" : "", $option, $this->CR_HTML ); Index: pear/HTML_OOH_Form/elements/form_element_reset.php diff -u pear/HTML_OOH_Form/elements/form_element_reset.php:1.6 pear/HTML_OOH_Form/elements/form_element_reset.php:1.7 --- pear/HTML_OOH_Form/elements/form_element_reset.php:1.6 Tue Dec 11 14:45:41 2001 +++ pear/HTML_OOH_Form/elements/form_element_reset.php Mon Jun 3 11:16:19 2002 @@ -16,14 +16,14 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_element_reset.php,v 1.6 2001/12/11 19:45:41 sebastian Exp $ +// $Id: form_element_reset.php,v 1.7 2002/06/03 15:16:19 uw Exp $ -require_once('HTML_OOH_Form/elements/form_element_reset.php'); +require_once('HTML_OOH_Form/elements/form_element_submit.php'); /** * Generates a reset button, [input type='reset']. * -* @version $Id: form_element_reset.php,v 1.6 2001/12/11 19:45:41 sebastian Exp $ +* @version $Id: form_element_reset.php,v 1.7 2002/06/03 15:16:19 uw Exp $ */ class form_element_reset extends form_element_submit { @@ -34,7 +34,7 @@ $html = sprintf('<input type="reset" name="%s" value="%s"', $this->name, - $this->container->getValue(); + $this->container->getValue() ); if ($this->width >= 0) Index: pear/HTML_OOH_Form/elements/form_element_selectobject.php diff -u pear/HTML_OOH_Form/elements/form_element_selectobject.php:1.6 pear/HTML_OOH_Form/elements/form_element_selectobject.php:1.7 --- pear/HTML_OOH_Form/elements/form_element_selectobject.php:1.6 Tue Dec 11 14:45:42 2001 +++ pear/HTML_OOH_Form/elements/form_element_selectobject.php Mon Jun 3 11:16:19 2002 @@ -16,14 +16,14 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_element_selectobject.php,v 1.6 2001/12/11 19:45:42 sebastian Exp $ +// $Id: form_element_selectobject.php,v 1.7 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/elements/form_element.php'); /** * Superclass of select and combo. * -* @version $Id: form_element_selectobject.php,v 1.6 2001/12/11 19:45:42 sebastian Exp $ +* @version $Id: form_element_selectobject.php,v 1.7 2002/06/03 15:16:19 uw Exp $ */ class form_element_selectobject extends form_element { @@ -103,7 +103,8 @@ * @return string $selected Returns ' selected' if the given value is selected */ function isSelected($value) { - +// print $this->container->getValue() . " =? "; imo_varDump($value); + if (!is_array($this->container->getValue())) return ($value == $this->container->getValue()) ? ' selected' : ''; @@ -123,8 +124,8 @@ * @throws form_error */ function setValue($value) { - - if (!$this->multiple && is_array($value)) { + + if ($this->multiple && !is_array($value)) { $this->exceptions[] = new form_error('Select boxes without multiple requite skalar data as value.', __FILE__, __LINE__); return false; } @@ -216,14 +217,14 @@ $html = ''; - foreach ($this->options as $value => $label) + foreach ($this->options as $value => $label) $html .= sprintf('<option value="%s"%s>%s</option>%s', $value, $this->isSelected($value), $label, $this->CR_HTML ); - + return $html; } // end func getOptionTags Index: pear/HTML_OOH_Form/examples/form/example_form.php diff -u pear/HTML_OOH_Form/examples/form/example_form.php:1.3 pear/HTML_OOH_Form/examples/form/example_form.php:1.4 --- pear/HTML_OOH_Form/examples/form/example_form.php:1.3 Tue Dec 11 14:45:42 2001 +++ pear/HTML_OOH_Form/examples/form/example_form.php Mon Jun 3 11:16:19 2002 @@ -16,9 +16,9 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: example_form.php,v 1.3 2001/12/11 19:45:42 sebastian Exp $ +// $Id: example_form.php,v 1.4 2002/06/03 15:16:19 uw Exp $ -require_once('HTML_OOH_Form/form.php');s +require_once('HTML_OOH_Form/form.php'); /** * Simple but long and almost complete example of the basic form class. @@ -28,7 +28,7 @@ * old PHPLib OOH forms. * * @author Ulf Wendel <ulf.wendel@phpdoc.de> -* @version $Id: example_form.php,v 1.3 2001/12/11 19:45:42 sebastian Exp $ +* @version $Id: example_form.php,v 1.4 2002/06/03 15:16:19 uw Exp $ * @package HTML_OOH_Form */ class example_form extends form { Index: pear/HTML_OOH_Form/layoutmanager/form_flowlayout.php diff -u pear/HTML_OOH_Form/layoutmanager/form_flowlayout.php:1.6 pear/HTML_OOH_Form/layoutmanager/form_flowlayout.php:1.7 --- pear/HTML_OOH_Form/layoutmanager/form_flowlayout.php:1.6 Tue Dec 11 14:45:45 2001 +++ pear/HTML_OOH_Form/layoutmanager/form_flowlayout.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_flowlayout.php,v 1.6 2001/12/11 19:45:45 sebastian Exp $ +// $Id: form_flowlayout.php,v 1.7 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/layoutmanager/form_layoutmanager.php'); @@ -34,7 +34,7 @@ * * Use insertBreak() for a row. * -* @version $Id: form_flowlayout.php,v 1.6 2001/12/11 19:45:45 sebastian Exp $ +* @version $Id: form_flowlayout.php,v 1.7 2002/06/03 15:16:19 uw Exp $ * @access public */ class flowlayout extends layoutmanager { @@ -69,7 +69,7 @@ reset($cols); while (list($col, $data) = each($cols)) { if (is_array($data)) - $data = $this->callMethod($data['method'], &$data['obj'], $data['params']); + $data = $this->callMethod($data['method'], $data['obj'], $data['params']); #$ret .= sprintf('<td align="left" valign="top" width="%d%%">%s</td>', $size, $data); $ret .= sprintf('<td align="left" valign="top">%s</td>', $data); Index: pear/HTML_OOH_Form/layoutmanager/form_gridlayout.php diff -u pear/HTML_OOH_Form/layoutmanager/form_gridlayout.php:1.6 pear/HTML_OOH_Form/layoutmanager/form_gridlayout.php:1.7 --- pear/HTML_OOH_Form/layoutmanager/form_gridlayout.php:1.6 Tue Dec 11 14:45:45 2001 +++ pear/HTML_OOH_Form/layoutmanager/form_gridlayout.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_gridlayout.php,v 1.6 2001/12/11 19:45:45 sebastian Exp $ +// $Id: form_gridlayout.php,v 1.7 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/layoutmanager/form_layoutmanager.php'); @@ -27,7 +27,7 @@ * All you do is define a grid and assign items to each cell. * * @access public -* @version $Id: form_gridlayout.php,v 1.6 2001/12/11 19:45:45 sebastian Exp $ +* @version $Id: form_gridlayout.php,v 1.7 2002/06/03 15:16:19 uw Exp $ */ class gridlayout extends layoutmanager { @@ -81,7 +81,7 @@ reset($cols); while (list($col, $data) = each($cols)) { if (is_array($data)) - $data = $this->callMethod($data['method'], &$data['obj'], $data['params']); + $data = $this->callMethod($data['method'], $data['obj'], $data['params']); #$ret .= sprintf('<td align="left" valign="top" width="%d%%">%s</td>', $size, $data); $ret .= sprintf('<td align="left" valign="top">%s</td>', $data); Index: pear/HTML_OOH_Form/layoutmanager/form_grouplayout.php diff -u pear/HTML_OOH_Form/layoutmanager/form_grouplayout.php:1.5 pear/HTML_OOH_Form/layoutmanager/form_grouplayout.php:1.6 --- pear/HTML_OOH_Form/layoutmanager/form_grouplayout.php:1.5 Tue Dec 11 14:45:45 2001 +++ pear/HTML_OOH_Form/layoutmanager/form_grouplayout.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_grouplayout.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +// $Id: form_grouplayout.php,v 1.6 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/layoutmanager/form_layoutmanager.php'); @@ -28,7 +28,7 @@ * HTML 4 .... Sadly not all major browser support this tag. * * @access public -* @version $Id: form_grouplayout.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +* @version $Id: form_grouplayout.php,v 1.6 2002/06/03 15:16:19 uw Exp $ */ class grouplayout extends layoutmanager { @@ -61,7 +61,7 @@ function addItem(&$obj, $display_method = 'get', $method_params = '') { - $this->tpl->setVariable('CONTENT', $this->callMethod($display_method, &$obj, $method_params)); + $this->tpl->setVariable('CONTENT', $this->callMethod($display_method, $obj, $method_params)); } // end func addItem Index: pear/HTML_OOH_Form/layoutmanager/form_itmanager.php diff -u pear/HTML_OOH_Form/layoutmanager/form_itmanager.php:1.5 pear/HTML_OOH_Form/layoutmanager/form_itmanager.php:1.6 --- pear/HTML_OOH_Form/layoutmanager/form_itmanager.php:1.5 Tue Dec 11 14:45:45 2001 +++ pear/HTML_OOH_Form/layoutmanager/form_itmanager.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_itmanager.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +// $Id: form_itmanager.php,v 1.6 2002/06/03 15:16:19 uw Exp $ require_once('HTML_OOH_Form/layoutmanager/form_layoutmanager.php'); @@ -26,7 +26,7 @@ * Well, this is not a classical layout manager. It's rather a wrapper * to IT[X] templates without any logics off it's own. * -* @version $Id: form_itmanager.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +* @version $Id: form_itmanager.php,v 1.6 2002/06/03 15:16:19 uw Exp $ * @package HTML_OOH_Form */ class itmanager extends layoutmanager { @@ -38,15 +38,15 @@ function addItem(&$obj, $display_method = 'get', $method_params = '', $field = '') { - $this->addContent($this->callMethod($display_method, &$obj, $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(strtolower($field))) { + if (true === $this->tpl->setCurrentBlock(strtolower($field))) { // block exists and might contain a variable of the same name $this->tpl->setVariable($field, $content); Index: pear/HTML_OOH_Form/layoutmanager/form_layoutmanager.php diff -u pear/HTML_OOH_Form/layoutmanager/form_layoutmanager.php:1.5 pear/HTML_OOH_Form/layoutmanager/form_layoutmanager.php:1.6 --- pear/HTML_OOH_Form/layoutmanager/form_layoutmanager.php:1.5 Tue Dec 11 14:45:45 2001 +++ pear/HTML_OOH_Form/layoutmanager/form_layoutmanager.php Mon Jun 3 11:16:19 2002 @@ -16,7 +16,7 @@ // | Authors: Ulf Wendel <ulf.wendel@phpdoc.de> | // +----------------------------------------------------------------------+ // -// $Id: form_layoutmanager.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +// $Id: form_layoutmanager.php,v 1.6 2002/06/03 15:16:19 uw Exp $ #require_once('HTML/IT.php'); @@ -26,7 +26,7 @@ * Needs PHP 4.0.5+ * * @access public -* @version $Id: form_layoutmanager.php,v 1.5 2001/12/11 19:45:45 sebastian Exp $ +* @version $Id: form_layoutmanager.php,v 1.6 2002/06/03 15:16:19 uw Exp $ */ class layoutmanager { @@ -86,7 +86,7 @@ * @see addContent() */ function addItem(&$obj, $display_method = 'get', $method_params = '') { - $this->addContent($this->callMethod($display_method, &$obj, $method_params)); + $this->addContent($this->callMethod($display_method, $obj, $method_params)); } // end func addItem
« previous php.pear.cvs (#4391) next »