Author: ael
Date: 2005-05-23 21:50:43 +0400 (Mon, 23 May 2005)
New Revision: 390
Modified:
src/classes/Form/Form.class.php
src/classes/Form/Primitive.class.php
Log:
PrimitiveBoolean have null by default (you need to import it to obtain true or false)
Modified: src/classes/Form/Form.class.php
===================================================================
--- src/classes/Form/Form.class.php 2005-05-23 14:28:41 UTC (rev 389)
+++ src/classes/Form/Form.class.php 2005-05-23 17:50:43 UTC (rev 390)
@@ -276,6 +276,7 @@
)
|| ($prm instanceof PrimitiveDate && !$prm->isEmpty($scope))
|| $prm instanceof PrimitiveRange
+ || $prm instanceof PrimitiveBoolean
)
{
if ($prm->import($scope)) {
Modified: src/classes/Form/Primitive.class.php
===================================================================
--- src/classes/Form/Primitive.class.php 2005-05-23 14:28:41 UTC (rev 389)
+++ src/classes/Form/Primitive.class.php 2005-05-23 17:50:43 UTC (rev 390)
@@ -165,15 +165,13 @@
class PrimitiveBoolean extends BasePrimitive
{
- public function __construct($name)
- {
- $this->value = false;
- parent::__construct($name);
- }
public function import(&$scope) // to be compatible with BasePrimitive
{
- $this->value = true;
+ if (isset($scope[$this->name]))
+ $this->value = true;
+ else
+ $this->value = false;
return true;
}
Received on Mon May 23 2005 - 21:50:44 MSD
This archive was generated by hypermail 2.2.0 : Sat Oct 27 2007 - 19:25:24 MSD