msName=$sName; $this->oSystem=&$oSystem; $this->oFormDB=$this->oSystem->goLoadDBClass($sName); $this->oTPL=$oTPL; } function gsGetForm() { $aoData=$this->oFormDB->gaoGetFields(); foreach($aoData as $oData) { $this->oTPL->gbSetValue($oData->FieldName,$oData->FieldValue); $this->oTPL->gbSetValue($oData->StyleName,$oData->StyleSheet); } return $this->oTPL->gsParse(); } function gbSave() { } function gbUpdate($asData) { if($this->oFormDB->gbCanBeSaved($asData)) { return $this->oFormDB->gbUpdate($asData); } else return false; } } class CSimpleFormField { function CSimpleFormField($sFieldName,$sValue="") { $this->FieldName=$sFieldName; $this->StyleName="cls".$sFieldName; $this->FieldValue=$sValue; $this->StyleSheet="transpInput"; } function __setError() { $this->StyleSheet="transpInputError"; $this->FieldValue=""; } function gbCheckValue($sValue) { if($sValue!="") { $this->FieldValue=$sValue; return true; } $this->__setError(); return false; } }