[Pieforms-commit] SF.net SVN: pieforms: [266] pieforms-php5/trunk/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2007-12-31 12:15:51
|
Revision: 266 http://pieforms.svn.sourceforge.net/pieforms/?rev=266&view=rev Author: oracleshinoda Date: 2007-12-31 04:15:51 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Make the support for putting the name in the element itself work again. Was previously broken when I messed around with the constructor, I've only just picked up the mistake. Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2007-12-31 12:15:25 UTC (rev 265) +++ pieforms-php5/trunk/src/pieform.php 2007-12-31 12:15:51 UTC (rev 266) @@ -237,6 +237,12 @@ // Get references to all the elements in the form, excluding fieldsets foreach ($this->data['elements'] as $name => &$element) { + // The name can be in the element itself. This is compatibility for + // the perl version + if (isset($element['name'])) { + $name = $element['name']; + } + if (isset($element['type']) && $element['type'] == 'fieldset') { // Load the fieldset plugin as we know this form has one now $this->include_plugin('element', 'fieldset'); @@ -245,13 +251,19 @@ } foreach ($element['elements'] as $subname => &$subelement) { + if (isset($subelement['name'])) { + $subname = $subelement['name']; + } $this->elementrefs[$subname] = &$subelement; + $subelement['name'] = $subname; } unset($subelement); } else { $this->elementrefs[$name] = &$element; } + + $element['name'] = $name; } unset($element); @@ -301,11 +313,6 @@ // Now we know what type the element is, we can load the plugin for it $this->include_plugin('element', $element['type']); - // The name can be in the element itself. This is compatibility for the perl version - if (isset($element['name'])) { - $name = $element['name']; - } - // All elements should have at least the title key set if (!isset($element['title'])) { $element['title'] = ''; @@ -352,7 +359,6 @@ // All elements inherit the form tabindex $element['tabindex'] = $this->data['tabindex']; } - $element['name'] = $name; } unset($element); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |