Changeset 5
- Timestamp:
- Sep 15, 2008, 10:44:29 PM (16 years ago)
- Files:
-
- 9 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
base.php
r4 r5 4 4 include('lists.php'); 5 5 include('common.php'); 6 7 // Include type definitions 8 include('types/Enumeration.php'); 9 include('types/Boolean.php'); 10 include('types/Integer.php'); 11 include('types/String.php'); 12 include('types/PointerOneToMany.php'); 13 include('types/PointerOneToOne.php'); 14 include('types/Date.php'); 15 include('types/Password.php'); 6 16 7 17 function ShowList($List, $Column = '', $ParentId = 0) … … 54 64 $Type = $Types[$ItemType[0]]; 55 65 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1]; 56 if(is_callable($Type[' ViewHtml'])) $Value = $Type['ViewHtml']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']);57 else $Value = $Type[' ViewHtml'];66 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']); 67 else $Value = $Type['CallbackView']; 58 68 $Value = str_replace('%value%', $DbRow[$Index], $Value); 59 69 $Output .= '<td>'.$Value.'</td>'; … … 84 94 $Type = $Types[$ItemType[0]]; 85 95 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1]; 86 if(is_callable($Type[' EditHtml'])) $Value = $Type['EditHtml']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']);87 else $Value = $Type[' EditHtml'];96 if(is_callable($Type['CallbackEdit'])) $Value = $Type['CallbackEdit']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']); 97 else $Value = $Type['CallbackEdit']; 88 98 $Value = str_replace('%value%', $DbRow[$Index], $Value); 89 99 $Value = str_replace('%name%', $Index, $Value); … … 131 141 $Type = $Types[$ItemType[0]]; 132 142 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1]; 133 if(is_callable($Type[' EditHtml'])) $Value = $Type['EditHtml']($Type, $Type['InitValue'], $List['TableName'], 0);134 else $Value = $Type[' EditHtml'];143 if(is_callable($Type['CallbackEdit'])) $Value = $Type['CallbackEdit']($Type, $Type['InitValue'], $List['TableName'], 0); 144 else $Value = $Type['CallbackEdit']; 135 145 $Value = str_replace('%value%', $Type['InitValue'], $Value); 136 146 $Value = str_replace('%name%', $Index, $Value); … … 180 190 $Type = $Types[$ItemType[0]]; 181 191 if(count($ItemType) > 1) $Type['Parameter'] = $ItemType[1]; 182 if(is_callable($Type[' ViewHtml'])) $Value = $Type['ViewHtml']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']);183 else $Value = $Type[' ViewHtml'];192 if(is_callable($Type['CallbackView'])) $Value = $Type['CallbackView']($Type, $DbRow[$Index], $List['TableName'], $DbRow['Id']); 193 else $Value = $Type['CallbackView']; 184 194 $Value = str_replace('%value%', $DbRow[$Index], $Value); 185 195 $Output .= '<tr><td>'.$Item['TextBefore'].':</td><td title="'.$Item['Help'].'">'.$Value.'</td></tr>'; … … 297 307 } 298 308 309 function LoadTypeDefinition() 310 { 311 global $Database, $Types; 312 313 $Types = array(); 314 $DbResult = $Database->select('SystemType', '*'); 315 while($DbRow = $DbResult->fetch_assoc()) 316 { 317 $DbRow['Parameters'] = explode('|', $DbRow['Parameters']); 318 $Types[$DbRow['Name']] = $DbRow; 319 } 320 321 // Merge parent type definition 322 foreach($Types as $Index => $Type) 323 { 324 if($Type['ParentType'] != '') 325 { 326 foreach($Type as $Index2 => $Item) 327 if($Item == '') 328 { 329 $Types[$Index][$Index2] = $Types[$Type['ParentType']][$Index2]; 330 } 331 } 332 } 333 //print_r($Types); 334 } 335 299 336 ?> -
index.php
r4 r5 16 16 </head><body><table class="base"><tr><td class="menu">'; 17 17 18 LoadTypeDefinition(); 18 19 LoadListDefinition(); 19 20 $Output .= $Output;
Note:
See TracChangeset
for help on using the changeset viewer.