Changeset 431 for trunk/forms.php
- Timestamp:
- Oct 11, 2012, 9:15:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forms.php
r430 r431 10 10 var $OnSubmit = ''; 11 11 12 function Form($ClassName)12 function __construct($ClassName) 13 13 { 14 14 global $FormClasses; 15 15 16 16 $this->Definition = &$FormClasses[$ClassName]; 17 } 18 19 function ShowViewForm() 20 { 21 global $Database, $FormTypes, $System; 22 23 $Table = array( 24 //'Header' => array('Položka', 'Hodnota'), 25 'Rows' => array(), 26 ); 27 foreach($this->Definition['Items'] as $Index => $Item) 28 { 29 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 30 if(array_key_exists($Item['Type'], $FormTypes)) 31 { 32 if(!array_key_exists($Item['Type'], $System->Type->TypeDefinitionList)) 33 $System->Type->RegisterType($Item['Type'], '', 34 $FormTypes[$Item['Type']]); 35 $Edit = ''.$System->Type->ExecuteTypeEvent('OneToMany', 'OnView', 36 array('Value' => $this->Values[$Index], 'Name' => $Index, 37 'Type' => $Item['Type'])).''; 38 } else $Edit = ''.$System->Type->ExecuteTypeEvent($Item['Type'], 'OnView', 39 array('Value' => $this->Values[$Index], 'Name' => $Index)).''; 40 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 41 } 42 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). 43 '</fieldset>'; 44 return($Output); 17 45 } 18 46
Note:
See TracChangeset
for help on using the changeset viewer.