- Timestamp:
- Sep 29, 2008, 2:35:42 PM (16 years ago)
- Location:
- types
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
types/Boolean.php
r5 r8 1 1 <?php 2 2 3 function TypeBooleanViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeBooleanViewHtml($Type, $Item) 4 4 { 5 return('<input type="checkbox" name=" %name%" value="%value%" disabled="1">');5 return('<input type="checkbox" name="'.$Item['Name'].'" value="'.$Item['Value'].'" disabled="1">'); 6 6 } 7 7 8 function TypeBooleanEditHtml($Type, $ Parameter, $Table, $Id)8 function TypeBooleanEditHtml($Type, $Item) 9 9 { 10 return('<input type="checkbox" name=" %name%" value="%value%">');10 return('<input type="checkbox" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'); 11 11 } 12 12 -
types/Date.php
r5 r8 3 3 $MonthList = array('0', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); 4 4 5 function TypeDateViewHtml($Type, $ Parameter, $Table, $Id)5 function TypeDateViewHtml($Type, $Item) 6 6 { 7 7 global $MonthList; 8 8 9 $Parts = explode('-', $ Parameter);9 $Parts = explode('-', $Item['Value']); 10 10 11 11 $Output = ($Parts[2] * 1).'.'.$MonthList[$Parts[1] * 1].'.'.$Parts[0]; … … 13 13 } 14 14 15 function TypeDateEditHtml($Type, $ Parameter, $Table, $Id)15 function TypeDateEditHtml($Type, $Item) 16 16 { 17 17 global $MonthList; 18 18 19 $Parts = explode('-', $ Parameter);19 $Parts = explode('-', $Item['Value']); 20 20 21 21 // Day 22 $Output = '<select name=" %name%-day">';22 $Output = '<select name="'.$Item['Name'].'-day">'; 23 23 for($I = 1; $I <= 31; $I++) 24 24 { … … 28 28 $Output .= '</select>'; 29 29 // Month 30 $Output .= '<select name=" %name%-month">';30 $Output .= '<select name="'.$Item['Name'].'-month">'; 31 31 for($I = 1; $I <= 12; $I++) 32 32 { … … 36 36 $Output .= '</select>'; 37 37 // Year 38 $Output .= '<select name=" %name%-month">';38 $Output .= '<select name="'.$Item['Name'].'-month">'; 39 39 for($I = 1900; $I < 2100; $I++) 40 40 { -
types/Enumeration.php
r5 r8 1 1 <?php 2 2 3 function TypeEnumerationViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeEnumerationViewHtml($Type, $Item) 4 4 { 5 $Output = $Type['Parameters'][$ Parameter];5 $Output = $Type['Parameters'][$Item['Value']]; 6 6 return($Output); 7 7 } 8 8 9 function TypeEnumerationEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeEnumerationEditHtml($Type, $Item) 10 10 { 11 $Output = '<select name=" %name%">';11 $Output = '<select name="'.$Item['Name'].'">'; 12 12 foreach($Type['Parameters'] as $Index => $StateName) 13 13 { -
types/Float.php
r6 r8 1 1 <?php 2 2 3 function TypeFloatViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeFloatViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeFloatEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeFloatEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Hyperlink.php
r6 r8 1 1 <?php 2 2 3 function TypeHyperlinkViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeHyperlinkViewHtml($Type, $Item) 4 4 { 5 $Output = '<a href=" %value%">%value%</a>';5 $Output = '<a href="'.$Item['Name'].'">'.$Item['Value'].'</a>'; 6 6 return($Output); 7 7 } … … 9 9 function TypeHyperlinkEditHtml($Type, $Parameter, $Table, $Id) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Integer.php
r5 r8 1 1 <?php 2 2 3 function TypeIntegerViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeIntegerViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeIntegerEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeIntegerEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 } -
types/Password.php
r5 r8 3 3 function TypePasswordViewHtml($Type, $Parameter, $Table, $Id) 4 4 { 5 $Output = '%value%'; 5 $Output = ''; 6 for($I = 0; $I < strlen($Item['Value']); $I++) 7 $Output .= '*'; 6 8 return($Output); 7 9 } … … 9 11 function TypePasswordEditHtml($Type, $Parameter, $Table, $Id) 10 12 { 11 $Output = '<input type="password" name=" %name%" value="%value%">';13 $Output = '<input type="password" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 14 return($Output); 13 15 } -
types/PointerOneToMany.php
r5 r8 1 1 <?php 2 2 3 function TypePointerOneToManyViewHtml($Type, $ Parameter, $Table, $Id)3 function TypePointerOneToManyViewHtml($Type, $Item) 4 4 { 5 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$ Table.'&ParentColumn='.$Id.'">Seznam</a>';5 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 6 6 return($Output); 7 7 } 8 8 9 function TypePointerOneToManyEditHtml($Type, $ Parameter, $Table, $Id)9 function TypePointerOneToManyEditHtml($Type, $Item) 10 10 { 11 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$ Table.'&ParentColumn='.$Id.'">Seznam</a>';11 $Output = '<a href="?Action=ShowList&TableId='.$Type['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 12 12 return($Output); 13 13 } -
types/PointerOneToOne.php
r6 r8 1 1 <?php 2 2 3 function TypePointerOneToOneViewHtml($Type, $ Parameter, $Table, $Id)3 function TypePointerOneToOneViewHtml($Type, $Item) 4 4 { 5 5 global $Database, $Lists; 6 6 7 //print_r($Type); 7 8 $Output = ''; 8 9 $Columns = ''; 9 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 10 $ItemType = explode(':', $Item['Type']); 11 $TargetTable = $ItemType[1]; 12 13 foreach($Lists[$TargetTable]['Items'] as $ListItem) 10 14 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 11 15 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 12 $DbResult = $Database->select($T ype['Parameter'], $Columns, 'Id='.$Parameter);16 $DbResult = $Database->select($TargetTable, $Columns, 'Id='.$Item['Value']); 13 17 //echo($Database->LastQuery); 14 18 if($DbResult->num_rows > 0) 15 19 { 16 20 $DbRow = $DbResult->fetch_array(); 17 $Output = '<a href="?Action=ViewItem&Table='.$T ype['Parameter'].'&Item='.$DbRow['Id'].'">'.$DbRow['Name'].'</a>';21 $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$DbRow['Id'].'">'.$DbRow['Name'].'</a>'; 18 22 } 19 23 return($Output); 20 24 } 21 25 22 function TypePointerOneToOneEditHtml($Type, $ Parameter, $Table, $Id)26 function TypePointerOneToOneEditHtml($Type, $Item) 23 27 { 24 28 global $Database, $Lists; 25 29 26 $Output = '<select name=" %name%">';30 $Output = '<select name="'.$Item['Name'].'">'; 27 31 $Columns = ''; 28 foreach($Lists[$Type['Parameter']]['Items'] as $ListItem) 32 $ItemType = explode(':', $Item['Type']); 33 $TargetTable = $ItemType[1]; 34 foreach($Lists[$TargetTable]['Items'] as $ListItem) 29 35 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",'; 30 36 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, Id'; 31 $DbResult = $Database->select($T ype['Parameter'], $Columns);37 $DbResult = $Database->select($TargetTable, $Columns); 32 38 //echo($Database->LastQuery); 33 39 while($DbRow = $DbResult->fetch_array()) -
types/String.php
r5 r8 1 1 <?php 2 2 3 function TypeStringViewHtml($Type, $ Parameter, $Table, $Id)3 function TypeStringViewHtml($Type, $Item) 4 4 { 5 $Output = '%value%';5 $Output = $Item['Value']; 6 6 return($Output); 7 7 } 8 8 9 function TypeStringEditHtml($Type, $ Parameter, $Table, $Id)9 function TypeStringEditHtml($Type, $Item) 10 10 { 11 $Output = '<input type="text" name=" %name%" value="%value%">';11 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'">'; 12 12 return($Output); 13 13 }
Note:
See TracChangeset
for help on using the changeset viewer.