[Pieforms-commit] SF.net SVN: pieforms: [219] pieforms-php5/trunk/src
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2007-09-17 12:23:54
|
Revision: 219 http://pieforms.svn.sourceforge.net/pieforms/?rev=219&view=rev Author: oracleshinoda Date: 2007-09-17 05:23:56 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Added support for 'showdescriptiononerror' flag - does what it says on the tin. Modified Paths: -------------- pieforms-php5/trunk/src/pieform/renderers/div.php pieforms-php5/trunk/src/pieform/renderers/table.php pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform/renderers/div.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/div.php 2007-08-19 22:11:09 UTC (rev 218) +++ pieforms-php5/trunk/src/pieform/renderers/div.php 2007-09-17 12:23:56 UTC (rev 219) @@ -74,7 +74,7 @@ // Description - optional description of the element, or other note that should be visible // on the form itself (without the user having to hover over contextual help - if (!empty($rawelement['description'])) { + if ((!$form->has_errors() || $form->get_property('showdescriptiononerror')) && !empty($rawelement['description'])) { $result .= '<div class="description"> ' . Pieform::hsc($rawelement['description']) . "</div>"; } Modified: pieforms-php5/trunk/src/pieform/renderers/table.php =================================================================== --- pieforms-php5/trunk/src/pieform/renderers/table.php 2007-08-19 22:11:09 UTC (rev 218) +++ pieforms-php5/trunk/src/pieform/renderers/table.php 2007-09-17 12:23:56 UTC (rev 219) @@ -99,7 +99,7 @@ // Description - optional description of the element, or other note that should be visible // on the form itself (without the user having to hover over contextual help - if (!empty($rawelement['description'])) { + if ((!$form->has_errors() || $form->get_property('showdescriptiononerror')) && !empty($rawelement['description'])) { $result .= "\t<tr>\n\t\t<td colspan=\"2\" class=\"description\">"; $result .= $rawelement['description']; $result .= "</td>\n\t</tr>\n"; Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2007-08-19 22:11:09 UTC (rev 218) +++ pieforms-php5/trunk/src/pieform.php 2007-09-17 12:23:56 UTC (rev 219) @@ -292,6 +292,10 @@ // Whether to add * markers after each required field 'requiredmarker' => false, + + // Whether to show the description as well as the error message + // when displaying errors + 'showdescriptiononerror' => true, ); $data = array_merge($formdefaults, $formconfig, $data); $this->data = $data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |