cvs: pear /HTML_Template_Flexy/Flexy Element.php
| From: | Alan Knowles | Date: | Wed, 18 May 2005 06:05:14 +0000 |
| Subject: | cvs: pear /HTML_Template_Flexy/Flexy Element.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-31902@lists.php.net to get a copy of this message | ||
alan_k Wed May 18 02:05:14 2005 EDT
Modified files:
/pear/HTML_Template_Flexy/Flexy Element.php
Log:
support for non-valued select options, not sure if this is actually needed.. or just an old BC
hack
http://cvs.php.net/diff.php/pear/HTML_Template_Flexy/Flexy/Element.php?r1=1.35&r2=1.36&ty=u
Index: pear/HTML_Template_Flexy/Flexy/Element.php
diff -u pear/HTML_Template_Flexy/Flexy/Element.php:1.35
pear/HTML_Template_Flexy/Flexy/Element.php:1.36
--- pear/HTML_Template_Flexy/Flexy/Element.php:1.35 Wed Apr 13 04:30:27 2005
+++ pear/HTML_Template_Flexy/Flexy/Element.php Wed May 18 02:05:12 2005
@@ -17,7 +17,7 @@
// | Based on HTML_Common by: Adam Daniel <adaniel1@eesus.jnj.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Element.php,v 1.35 2005/04/13 08:30:27 alan_k Exp $
+// $Id: Element.php,v 1.36 2005/05/18 06:05:12 alan_k Exp $
/**
* Lightweight HTML Element builder and render
@@ -334,6 +334,17 @@
isset($this->attributes['flexy:xhtml']) ?
'selected' : true;;
continue;
}
+ // no value attribute try and use the contents.
+ if (!isset($child->attributes['value'])
+ && is_string($child->children[0])
+ && in_array((string) $child->children[0], $value))
+ {
+
+ $this->children[$i]->attributes['selected'] =
+ isset($this->attributes['flexy:xhtml']) ?
'selected' : true;
+ continue;
+ }
+
if (isset($child->attributes['value']) &&
isset($this->children[$i]->attributes['selected']))
{