Changeset 42 for trunk/Base/Types
- Timestamp:
- Nov 24, 2009, 9:13:38 AM (15 years ago)
- Location:
- trunk/Base/Types
- Files:
-
- 1 added
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Base/Types/Base.php
r40 r42 1 1 <?php 2 2 3 class TypeBase extends Module3 class TypeBase 4 4 { 5 var $System; 5 6 var $DatabaseCompareOperators = array(); 7 8 function __construct($System) 9 { 10 $this->System = $System; 11 } 6 12 7 13 function OnView($Item) -
trunk/Base/Types/Boolean.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeBoolean extends TypeBase … … 8 10 { 9 11 if($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = ''; 10 return('<input type="checkbox" name="'.$Item['Name'].'" disabled="1"'.$Checked.' >');12 return('<input type="checkbox" name="'.$Item['Name'].'" disabled="1"'.$Checked.'/>'); 11 13 } 12 14 … … 14 16 { 15 17 if($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = ''; 16 return('<input type="checkbox" name="'.$Item['Name'].'"'.$Checked.' >');18 return('<input type="checkbox" name="'.$Item['Name'].'"'.$Checked.'/>'); 17 19 } 18 20 -
trunk/Base/Types/Date.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeDate extends TypeBase -
trunk/Base/Types/DateTime.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeDateTime extends TypeBase -
trunk/Base/Types/Enumeration.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeEnumeration extends TypeBase … … 5 7 function OnView($Item) 6 8 { 7 $Type = GetTypeDefinition($Item['Type']); 8 $Output = $Type['Parameters'][$Item['Value']]; 9 $Type = $this->System->Type->GetTypeDefinition($Item['Type']); 10 if(array_key_exists($Item['Value'], $Type['Parameters'])) 11 $Output = $Type['Parameters'][$Item['Value']]; 12 else $Output = $Item['Value']; 9 13 return($Output); 10 14 } … … 12 16 function OnEdit($Item) 13 17 { 14 $Type = GetTypeDefinition($Item['Type']);18 $Type = $this->System->Type->GetTypeDefinition($Item['Type']); 15 19 $Output = '<select name="'.$Item['Name'].'">'; 16 20 foreach($Type['Parameters'] as $Index => $StateName) -
trunk/Base/Types/Float.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeFloat extends TypeBase … … 13 15 function OnEdit($Item) 14 16 { 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 18 return($Output); 17 19 } -
trunk/Base/Types/GPS.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeGPS extends TypeBase … … 31 33 } else $DbRow = array('Longitude' => 0, 'Latitude' => 0); 32 34 $Value = $this->Explode($DbRow['Latitude']); 33 $Output = '<input type="text" size="3" name="'.$Item['Name'].'-lat-deg" value="'.$Value[0].'" >°';34 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lat-min" value="'.$Value[1].'" >\'';35 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lat-sec" value="'.$Value[2].'" >"<br />';35 $Output = '<input type="text" size="3" name="'.$Item['Name'].'-lat-deg" value="'.$Value[0].'"/>°'; 36 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lat-min" value="'.$Value[1].'"/>\''; 37 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lat-sec" value="'.$Value[2].'"/>"<br />'; 36 38 $Value = $this->Explode($DbRow['Longitude']); 37 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-deg" value="'.$Value[0].'" >°';38 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-min" value="'.$Value[1].'" >\'';39 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-sec" value="'.$Value[2].'" >"';39 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-deg" value="'.$Value[0].'"/>°'; 40 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-min" value="'.$Value[1].'"/>\''; 41 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-sec" value="'.$Value[2].'"/>"'; 40 42 return($Output); 41 43 } -
trunk/Base/Types/Hidden.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeHidden extends TypeBase … … 11 13 function OnEdit($Item) 12 14 { 13 $Output = '<input type="hidden" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';15 $Output = '<input type="hidden" name="'.$Item['Name'].'" value="'.$Item['Value'].'" />'; 14 16 return($Output); 15 17 } -
trunk/Base/Types/Hyperlink.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeHyperlink extends TypeBase … … 11 13 function OnEdit($Item) 12 14 { 13 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 14 16 return($Output); 15 17 } -
trunk/Base/Types/IPv4Address.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeIPv4Address extends TypeBase … … 11 13 function OnEdit($Item) 12 14 { 13 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 14 16 return($Output); 15 17 } -
trunk/Base/Types/Integer.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeInteger extends TypeBase … … 13 15 function OnEdit($Item) 14 16 { 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 18 return($Output); 17 19 } -
trunk/Base/Types/Password.php
r40 r42 2 2 3 3 // SHA1 hash used 4 5 include_once(dirname(__FILE__).'/Base.php'); 4 6 5 7 class TypePassword extends TypeBase … … 15 17 function OnEdit($Item) 16 18 { 17 $Output = '<input type="password" name="'.$Item['Name'].'" value="" >';19 $Output = '<input type="password" name="'.$Item['Name'].'" value=""/>'; 18 20 return($Output); 19 21 } -
trunk/Base/Types/PointerOneToMany.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypePointerOneToMany extends TypeBase -
trunk/Base/Types/PointerOneToOne.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypePointerOneToOne extends TypeBase … … 5 7 function OnView($Item) 6 8 { 7 global $TypeDefinitionList; 8 9 $Type = $TypeDefinitionList[$Item['Type']]; 10 $DbResult = $this->Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name FROM `'.$Type['Parameters']['Table'].'` WHERE `'.$Type['Parameters']['Id'].'`='.$Item['Value']); 9 $Type = $this->System->Type->TypeDefinitionList[$Item['Type']]; 10 $DbResult = $this->System->Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name FROM `'.$Type['Parameters']['Table'].'` WHERE `'.$Type['Parameters']['Id'].'`='.$Item['Value']); 11 11 $DbRow = $DbResult->fetch_assoc(); 12 $Output = $DbRow['Name']; 13 14 /* $Type = GetTypeDefinition($Item['Type']); 15 $List = GetListDefinition($Type['Parameters'][0]); 16 $TargetTable = $Type['Parameters'][0]; 17 $TargetName = $this->GetTablePointerName($Type, $Item); 18 if($TargetName != '') $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$TargetName[$List['IdName']].'">'.$TargetName['Name'].'</a>'; 19 else $Output = ''; 20 */ 12 if($this->System->Modules['Permission']->Check('Corporation', 'Show')) 13 $Output = $this->System->HTML->MakeLink($DbRow['Name'], $this->System->MakeLink($Type['Parameters']['Table'], 'Show', array('Id' => $Item['Value']))); 14 else $Output = $DbRow['Name']; 21 15 return($Output); 22 16 } … … 24 18 function OnEdit($Item) 25 19 { 26 global $TypeDefinitionList;27 28 20 $Output = '<select name="'.$Item['Name'].'">'; 29 $Type = $ TypeDefinitionList[$Item['Type']];21 $Type = $this->System->Type->TypeDefinitionList[$Item['Type']]; 30 22 if(array_key_exists('Condition', $Type['Parameters'])) $Where = ' WHERE '.$Type['Parameters']['Condition']; 31 23 else $Where = ''; 32 $DbResult = $this-> Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name,'.$Type['Parameters']['Id'].' AS Id FROM `'.$Type['Parameters']['Table'].'`'.$Where.' ORDER BY Name DESC');24 $DbResult = $this->System->Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name,'.$Type['Parameters']['Id'].' AS Id FROM `'.$Type['Parameters']['Table'].'`'.$Where.' ORDER BY Name DESC'); 33 25 while($DbRow = $DbResult->fetch_assoc()) 34 26 { -
trunk/Base/Types/String.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeString extends TypeBase … … 13 15 function OnEdit($Item) 14 16 { 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'" >';17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 18 return($Output); 17 19 } -
trunk/Base/Types/Text.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeText extends TypeBase -
trunk/Base/Types/Time.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Base.php'); 2 4 3 5 class TypeTime extends TypeBase
Note:
See TracChangeset
for help on using the changeset viewer.