Changeset 874 for trunk/Common/Form
- Timestamp:
- Apr 6, 2020, 11:56:19 PM (5 years ago)
- Location:
- trunk/Common/Form
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r873 r874 113 113 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). 114 114 '</fieldset>'; 115 return ($Output);115 return $Output; 116 116 } 117 117 … … 122 122 '<div><input name="submit" type="submit" value="'.$this->Definition['SubmitText'].'" /> '. 123 123 '<input type="button" value="Zrušit" onclick="location.href=\'?\'"/></div></form>'; 124 return ($Output);124 return $Output; 125 125 } 126 126 … … 316 316 } 317 317 } 318 return ($Values);318 return $Values; 319 319 } 320 320 … … 353 353 } 354 354 if ($Valid == false) throw new Exception('not validated'); 355 return ($Valid);355 return $Valid; 356 356 } 357 357 } … … 360 360 function MakeLink($Target, $Title) 361 361 { 362 return ('<a href="'.$Target.'">'.$Title.'</a>');362 return '<a href="'.$Target.'">'.$Title.'</a>'; 363 363 } 364 364 … … 384 384 } 385 385 $Result .= '</table>'; 386 return ($Result);386 return $Result; 387 387 } 388 388 -
trunk/Common/Form/Types/Base.php
r873 r874 17 17 function OnView($Item) 18 18 { 19 return ('');19 return ''; 20 20 } 21 21 22 22 function OnEdit($Item) 23 23 { 24 return ('');24 return ''; 25 25 } 26 26 27 27 function OnLoad($Item) 28 28 { 29 return ('');29 return ''; 30 30 } 31 31 32 32 function OnLoadDb($Item) 33 33 { 34 return ($Item['Value']);34 return $Item['Value']; 35 35 } 36 36 37 37 function OnSaveDb($Item) 38 38 { 39 return ($Item['Value']);39 return $Item['Value']; 40 40 } 41 41 42 42 function DatabaseEscape($Value) 43 43 { 44 return (addslashes($Value));44 return addslashes($Value); 45 45 } 46 46 … … 50 50 $SQL = '('.$Item['SQL'].') AS '; 51 51 else $SQL = ''; 52 return ($SQL.'`'.$Item['Name'].'`');52 return $SQL.'`'.$Item['Name'].'`'; 53 53 } 54 54 … … 58 58 $Output = '('.$Item['SQL'].') AS `'.$Item['Name'].'`, ('.$Item['SQL'].') AS `'.$Item['Name'].'_Filter`'; 59 59 else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`'; 60 return ($Output);60 return $Output; 61 61 } 62 62 63 63 function Validate($Item) 64 64 { 65 return (true);65 return true; 66 66 } 67 67 68 68 function GetValidationFormat() 69 69 { 70 return ('');70 return ''; 71 71 } 72 72 } -
trunk/Common/Form/Types/Boolean.php
r873 r874 10 10 { 11 11 if ($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = ''; 12 return ('<input type="checkbox" name="'.$Item['Name'].'" disabled="1"'.$Checked.'/>');12 return '<input type="checkbox" name="'.$Item['Name'].'" disabled="1"'.$Checked.'/>'; 13 13 } 14 14 … … 16 16 { 17 17 if ($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = ''; 18 return ('<input type="checkbox" name="'.$Item['Name'].'"'.$Checked.'/>');18 return '<input type="checkbox" name="'.$Item['Name'].'"'.$Checked.'/>'; 19 19 } 20 20 21 21 function OnLoad($Item) 22 22 { 23 if (array_key_exists($Item['Name'], $_POST)) return (1);24 else return (0);23 if (array_key_exists($Item['Name'], $_POST)) return 1; 24 else return 0; 25 25 } 26 26 } -
trunk/Common/Form/Types/Color.php
r873 r874 10 10 { 11 11 $Output = '<span style="background-color: #'.$Item['Value'].'"> </span>'; 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 21 21 function OnLoad($Item) 22 22 { 23 return ($_POST[$Item['Name']]);23 return $_POST[$Item['Name']]; 24 24 } 25 25 } -
trunk/Common/Form/Types/Date.php
r873 r874 11 11 global $MonthNames; 12 12 13 if ($Item['Value'] == null) return ('');13 if ($Item['Value'] == null) return ''; 14 14 if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 15 15 $Parts = getdate($Item['Value']); 16 16 17 17 $Output = $Parts['mday'].'.'.$Parts['mon'].'.'.$Parts['year']; 18 return ($Output);18 return $Output; 19 19 } 20 20 … … 71 71 } 72 72 $Output .= '</select>'; 73 return ($Output);73 return $Output; 74 74 } 75 75 76 76 function OnLoad($Item) 77 77 { 78 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return (null);79 else return (mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']));78 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; 79 else return mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']); 80 80 } 81 81 82 82 function OnLoadDb($Item) 83 83 { 84 return (MysqlDateToTime($Item['Value']));84 return MysqlDateToTime($Item['Value']); 85 85 } 86 86 87 87 function OnSaveDb($Item) 88 88 { 89 if ($Item['Value'] == null) return (null);90 else return (date('Y-m-d', $Item['Value']));89 if ($Item['Value'] == null) return null; 90 else return date('Y-m-d', $Item['Value']); 91 91 } 92 92 93 93 function DatabaseEscape($Value) 94 94 { 95 return ('"'.addslashes($Value).'"');95 return '"'.addslashes($Value).'"'; 96 96 } 97 97 } -
trunk/Common/Form/Types/Enumeration.php
r873 r874 11 11 $Output = $Type['Parameters']['States'][$Item['Value']]; 12 12 else $Output = $Item['Value']; 13 return ($Output);13 return $Output; 14 14 } 15 15 … … 29 29 } 30 30 $Output .= '</select>'; 31 return ($Output);31 return $Output; 32 32 } 33 33 34 34 function OnLoad($Item) 35 35 { 36 if ($_POST[$Item['Name']] == '') return (NULL);37 return ($_POST[$Item['Name']]);36 if ($_POST[$Item['Name']] == '') return NULL; 37 return $_POST[$Item['Name']]; 38 38 } 39 39 40 40 function OnLoadDb($Item) 41 41 { 42 if ($Item['Value'] == '') return (NULL);43 else return ($Item['Value']);42 if ($Item['Value'] == '') return NULL; 43 else return $Item['Value']; 44 44 } 45 45 } -
trunk/Common/Form/Types/File.php
r873 r874 16 16 $Result = $FileInfo->file($this->FileName); 17 17 //$FileInfo->close(); 18 return ($Result);18 return $Result; 19 19 } 20 20 … … 24 24 if (file_exists($FileName)) $Result = filesize($FileName); 25 25 else $Result = 0; 26 return ($Result);26 return $Result; 27 27 } 28 28 … … 38 38 } 39 39 $Result = $this->UploadFileFolder.'/'.$Path.$File->Name; 40 return ($Result);40 return $Result; 41 41 } 42 42 43 43 function GetExt() 44 44 { 45 return (substr($this->Name, 0, strpos($this->Name, '.') - 1));45 return substr($this->Name, 0, strpos($this->Name, '.') - 1); 46 46 } 47 47 … … 55 55 if ($this->TempName != '') $Content = file_get_contents($this->TempName); 56 56 else $Content = file_get_contents($this->GetFullName()); 57 return ($Content);57 return $Content; 58 58 } 59 59 } … … 75 75 { 76 76 $File = &$Item['Value']; 77 return ('<a href="'.$this->FileDownloadURL.'?id='.$File->Id.'">'.78 $File.'</a> ('.HumanSize($File->Size).')' );77 return '<a href="'.$this->FileDownloadURL.'?id='.$File->Id.'">'. 78 $File.'</a> ('.HumanSize($File->Size).')'; 79 79 } 80 80 … … 86 86 $File = &$Item['Value']; 87 87 $Output = '<input type="file" name="'.$Item['Name'].'" value="'.$File->Name.'">'; 88 return ($Output);88 return $Output; 89 89 } 90 90 … … 103 103 } 104 104 } 105 return ($File);105 return $File; 106 106 } 107 107 … … 118 118 $File->Directory = $DbRow['Directory']; 119 119 } 120 return ($File);120 return $File; 121 121 } 122 122 -
trunk/Common/Form/Types/Float.php
r873 r874 10 10 { 11 11 $Output = $Item['Value']; 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 21 21 function OnLoad($Item) 22 22 { 23 return ($_POST[$Item['Name']]);23 return $_POST[$Item['Name']]; 24 24 } 25 25 } -
trunk/Common/Form/Types/GPS.php
r873 r874 17 17 $Output = '<a href="http://www.mapy.cz/?st=search&fr=loc:'.$DbRow['Latitude'].' '.$DbRow['Longitude'].'">'.$Latitude[0].'°'.$Latitude[1]."'".$Latitude[2].'" '.$Longitude[0].'°'.$Longitude[1]."'".$Longitude[2].'"</a>'; 18 18 } 19 return ($Output);19 return $Output; 20 20 } 21 21 … … 40 40 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-min" value="'.$Value[1].'"/>\''; 41 41 $Output .= '<input type="text" size="3" name="'.$Item['Name'].'-lon-sec" value="'.$Value[2].'"/>"'; 42 return ($Output);42 return $Output; 43 43 } 44 44 … … 50 50 $Longitude = $this->Implode($_POST[$Item['Name'].'-lon-deg'], $_POST[$Item['Name'].'-lon-min'], $_POST[$Item['Name'].'-lon-sec']); 51 51 $Database->query('INSERT INTO SystemGPS (`Latitude`, `Longitude`) VALUES ("'.$Latitude.'", "'.$Longitude.'")'); 52 return ($Database->insert_id);52 return $Database->insert_id; 53 53 } 54 54 … … 61 61 $Float = ($Float - intval($Float)) * 60; 62 62 $Seconds = round($Float, 3); 63 return (array($Degrees, $Minutes, $Seconds));63 return array($Degrees, $Minutes, $Seconds); 64 64 } 65 65 66 66 function Implode($Degrees, $Minutes, $Seconds) 67 67 { 68 if ($Degrees < 0) return (-(abs($Degrees) + ($Minutes + $Seconds / 60) / 60));69 else return ($Degrees + ($Minutes + $Seconds / 60) / 60);68 if ($Degrees < 0) return -(abs($Degrees) + ($Minutes + $Seconds / 60) / 60); 69 else return $Degrees + ($Minutes + $Seconds / 60) / 60; 70 70 } 71 71 } -
trunk/Common/Form/Types/Hidden.php
r873 r874 14 14 { 15 15 $Output = $Item['Value']; 16 return ($Output);16 return $Output; 17 17 } 18 18 … … 20 20 { 21 21 $Output = '<input type="hidden" name="'.$Item['Name'].'" value="'.$Item['Value'].'" />'; 22 return ($Output);22 return $Output; 23 23 } 24 24 25 25 function OnLoad($Item) 26 26 { 27 return ($_POST[$Item['Name']]);27 return $_POST[$Item['Name']]; 28 28 } 29 29 } -
trunk/Common/Form/Types/Hyperlink.php
r873 r874 8 8 { 9 9 $Output = '<a href="'.$Item['Value'].'">'.$Item['Value'].'</a>'; 10 return ($Output);10 return $Output; 11 11 } 12 12 … … 14 14 { 15 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 return ($Output);16 return $Output; 17 17 } 18 18 19 19 function OnLoad($Item) 20 20 { 21 return ($_POST[$Item['Name']]);21 return $_POST[$Item['Name']]; 22 22 } 23 23 } -
trunk/Common/Form/Types/IPv4Address.php
r873 r874 8 8 { 9 9 $Output = $Item['Value']; 10 return ($Output);10 return $Output; 11 11 } 12 12 … … 14 14 { 15 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 return ($Output);16 return $Output; 17 17 } 18 18 19 19 function OnLoad($Item) 20 20 { 21 return ($_POST[$Item['Name']]);21 return $_POST[$Item['Name']]; 22 22 } 23 23 24 24 function Validate($Item) 25 25 { 26 if ($Item['Null'] and ($Item['Value'] == '')) return (true);27 return (filter_var($Item['Value'], FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)));26 if ($Item['Null'] and ($Item['Value'] == '')) return true; 27 return filter_var($Item['Value'], FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)); 28 28 } 29 29 30 30 function GetValidationFormat() 31 31 { 32 return ('x.x.x.x kde x je hodnota 0..255');32 return 'x.x.x.x kde x je hodnota 0..255'; 33 33 } 34 34 } -
trunk/Common/Form/Types/IPv6Address.php
r873 r874 8 8 { 9 9 $Output = $Item['Value']; 10 return ($Output);10 return $Output; 11 11 } 12 12 … … 14 14 { 15 15 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 16 return ($Output);16 return $Output; 17 17 } 18 18 19 19 function OnLoad($Item) 20 20 { 21 return ($_POST[$Item['Name']]);21 return $_POST[$Item['Name']]; 22 22 } 23 23 24 24 function Validate($Item) 25 25 { 26 if ($Item['Null'] and ($Item['Value'] == '')) return (true);27 return (filter_var($Item['Value'], FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)));26 if ($Item['Null'] and ($Item['Value'] == '')) return true; 27 return filter_var($Item['Value'], FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)); 28 28 } 29 29 30 30 function GetValidationFormat() 31 31 { 32 return ('xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx kde x je hexa hodnota 0..f');32 return 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx kde x je hexa hodnota 0..f'; 33 33 } 34 34 } -
trunk/Common/Form/Types/Image.php
r873 r874 7 7 global $System; 8 8 9 return ('<img src="'.$System->Link('/images/favicons/'.$Item['Value']).'"/> '.$Item['Value']);9 return '<img src="'.$System->Link('/images/favicons/'.$Item['Value']).'"/> '.$Item['Value']; 10 10 } 11 11 } -
trunk/Common/Form/Types/Integer.php
r873 r874 10 10 { 11 11 $Output = $Item['Value']; 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<input type="text" name="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 21 21 function OnLoad($Item) 22 22 { 23 return ($_POST[$Item['Name']]);23 return $_POST[$Item['Name']]; 24 24 } 25 25 26 26 function Validate($Item) 27 27 { 28 if ($Item['Null'] and ($Item['Value'] == '')) return (true);29 return (preg_match('/^\-*[0-9\.]+$/', $Item['Value']));28 if ($Item['Null'] and ($Item['Value'] == '')) return true; 29 return preg_match('/^\-*[0-9\.]+$/', $Item['Value']); 30 30 } 31 31 32 32 function GetValidationFormat() 33 33 { 34 return ('číselná hodnota');34 return 'číselná hodnota'; 35 35 } 36 36 } -
trunk/Common/Form/Types/MacAddress.php
r873 r874 10 10 { 11 11 $Output = $Item['Value']; 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<input type="text" name="'.$Item['Name'].'" id="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 … … 22 22 { 23 23 //echo($Item['Name'].'='.$_POST[$Item['Name']].','.is_null(NULL).'<br>'); 24 return (strtoupper($_POST[$Item['Name']]));24 return strtoupper($_POST[$Item['Name']]); 25 25 } 26 26 27 27 function DatabaseEscape($Value) 28 28 { 29 return ('"'.addslashes($Value).'"');29 return '"'.addslashes($Value).'"'; 30 30 } 31 31 32 32 function Validate($Item) 33 33 { 34 if ($Item['Null'] and ($Item['Value'] == '')) return (true);35 return (preg_match('/^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$/', $Item['Value']));34 if ($Item['Null'] and ($Item['Value'] == '')) return true; 35 return preg_match('/^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$/', $Item['Value']); 36 36 } 37 37 38 38 function GetValidationFormat() 39 39 { 40 return ('XX:XX:XX:XX:XX:XX kde X je hexa hodnota 0..F');40 return 'XX:XX:XX:XX:XX:XX kde X je hexa hodnota 0..F'; 41 41 } 42 42 } -
trunk/Common/Form/Types/OneToMany.php
r873 r874 15 15 'view'.'&i='.$Item['Value'].'">'.$Item['Filter'].'</a>'; 16 16 } else $Output = ''; 17 return ($Output);17 return $Output; 18 18 } 19 19 … … 51 51 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=select&t='.$Table.'&r='.$Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>'; 52 52 } 53 return ($Output);53 return $Output; 54 54 } 55 55 56 56 function OnLoad($Item) 57 57 { 58 if ($_POST[$Item['Name']] == '') return (NULL);59 else return ($_POST[$Item['Name']]);58 if ($_POST[$Item['Name']] == '') return NULL; 59 else return $_POST[$Item['Name']]; 60 60 } 61 61 62 62 function OnLoadDb($Item) 63 63 { 64 if ($Item['Value'] == '') return (NULL);65 else return ($Item['Value']);64 if ($Item['Value'] == '') return NULL; 65 else return $Item['Value']; 66 66 } 67 67 68 68 function OnFilterName($Item) 69 69 { 70 return ('`'.$Item['Name'].'_Filter`');70 return '`'.$Item['Name'].'_Filter`'; 71 71 } 72 72 … … 82 82 $Type['Parameters']['Id'].'`=`TX`.`'.$Item['Name'].'`) AS `'.$Item['Name'].'_Filter`'; 83 83 //} else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`'; 84 return ($Output);84 return $Output; 85 85 } 86 86 } -
trunk/Common/Form/Types/OneToMany2.php
r873 r874 8 8 { 9 9 $Output = '<a href="?Action=ShowList&TableId='.$Item['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 10 return ($Output);10 return $Output; 11 11 } 12 12 … … 14 14 { 15 15 $Output = '<a href="?Action=ShowList&TableId='.$Item['TypeDefinition'].'&ParentTable='.$Item['SourceTable'].'&ParentColumn='.$Item['SourceItemId'].'">Seznam</a>'; 16 return ($Output);16 return $Output; 17 17 } 18 18 19 19 function OnLoad($Item) 20 20 { 21 return ($_POST[$Item['Name']]);21 return $_POST[$Item['Name']]; 22 22 } 23 23 } -
trunk/Common/Form/Types/Password.php
r873 r874 12 12 for ($I = 0; $I < 6; $I++) 13 13 $Output .= '*'; 14 return ($Output);14 return $Output; 15 15 } 16 16 … … 18 18 { 19 19 $Output = '<input type="password" name="'.$Item['Name'].'" value=""/>'; 20 return ($Output);20 return $Output; 21 21 } 22 22 … … 39 39 } 40 40 */ 41 return ($Result);41 return $Result; 42 42 } 43 43 44 44 function OnSaveDb($Item) 45 45 { 46 if ($Item['Value'] == '') return ('');46 if ($Item['Value'] == '') return ''; 47 47 else { 48 48 $PasswordHash = new PasswordHash(); 49 return ($PasswordHash->Hash($Item['Value'], $Item['Values']['Salt']));49 return $PasswordHash->Hash($Item['Value'], $Item['Values']['Salt']); 50 50 } 51 51 } … … 53 53 function OnLoadDb($Item) 54 54 { 55 return ('');55 return ''; 56 56 } 57 57 } -
trunk/Common/Form/Types/RandomHash.php
r873 r874 14 14 { 15 15 $Output = $Item['Value']; 16 return ($Output);16 return $Output; 17 17 } 18 18 … … 26 26 } 27 27 $Output = '<input type="hidden" name="'.$Item['Name'].'" value="'.$Item['Value'].'" />'; 28 return ($Output);28 return $Output; 29 29 } 30 30 31 31 function OnLoad($Item) 32 32 { 33 return ($_POST[$Item['Name']]);33 return $_POST[$Item['Name']]; 34 34 } 35 35 } -
trunk/Common/Form/Types/String.php
r873 r874 10 10 { 11 11 $Output = $Item['Value']; 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<input type="text" name="'.$Item['Name'].'" id="'.$Item['Name'].'" value="'.$Item['Value'].'"/>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 … … 22 22 { 23 23 //echo($Item['Name'].'='.$_POST[$Item['Name']].','.is_null(NULL).'<br>'); 24 return ($_POST[$Item['Name']]);24 return $_POST[$Item['Name']]; 25 25 } 26 26 27 27 function DatabaseEscape($Value) 28 28 { 29 return ('"'.addslashes($Value).'"');29 return '"'.addslashes($Value).'"'; 30 30 } 31 31 } -
trunk/Common/Form/Types/Text.php
r873 r874 10 10 { 11 11 $Output = str_replace("\n", '<br/>', strip_tags($Item['Value'])); 12 return ($Output);12 return $Output; 13 13 } 14 14 … … 16 16 { 17 17 $Output = '<textarea name="'.$Item['Name'].'">'.$Item['Value'].'</textarea>'; 18 return ($Output);18 return $Output; 19 19 } 20 20 21 21 function OnLoad($Item) 22 22 { 23 return ($_POST[$Item['Name']]);23 return $_POST[$Item['Name']]; 24 24 } 25 25 26 26 function DatabaseEscape($Value) 27 27 { 28 return ('"'.addslashes($Value).'"');28 return '"'.addslashes($Value).'"'; 29 29 } 30 30 } -
trunk/Common/Form/Types/Time.php
r873 r874 9 9 function OnView($Item) 10 10 { 11 if ($Item['Value'] == 0) return ('');11 if ($Item['Value'] == 0) return ''; 12 12 if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 13 13 $TimeParts = getdate($Item['Value']); 14 14 15 15 $Output = sprintf('%02d', $TimeParts['hours']).':'.sprintf('%02d', $TimeParts['minutes']).':'.sprintf('%02d', $TimeParts['seconds']); 16 return ($Output);16 return $Output; 17 17 } 18 18 … … 67 67 } 68 68 $Output .= '</select>'; 69 return ($Output);69 return $Output; 70 70 } 71 71 72 72 function OnLoad($Item) 73 73 { 74 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return (null);75 return (mktime($_POST[$Item['Name'].'-hour'], $_POST[$Item['Name'].'-minute'], $_POST[$Item['Name'].'-second']));74 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; 75 return mktime($_POST[$Item['Name'].'-hour'], $_POST[$Item['Name'].'-minute'], $_POST[$Item['Name'].'-second']); 76 76 } 77 77 78 78 function OnLoadDb($Item) 79 79 { 80 return (MysqlTimeToTime($Item['Value']));80 return MysqlTimeToTime($Item['Value']); 81 81 } 82 82 83 83 function OnSaveDb($Item) 84 84 { 85 if ($Item['Value'] == null) return (null);86 else return (date('H:i:s', $Item['Value']));85 if ($Item['Value'] == null) return null; 86 else return date('H:i:s', $Item['Value']); 87 87 } 88 88 89 89 function DatabaseEscape($Value) 90 90 { 91 return ('"'.addslashes($Value).'"');91 return '"'.addslashes($Value).'"'; 92 92 } 93 93 } -
trunk/Common/Form/Types/TimeDiff.php
r873 r874 15 15 if ($Days > 0) $Output = $Days.' dnů '.$Output; 16 16 } 17 return ($Output);17 return $Output; 18 18 } 19 19 } -
trunk/Common/Form/Types/Type.php
r873 r874 72 72 $TypeClass = 'Type'.$Type['Class']; 73 73 $TypeObject = new $TypeClass($this->FormManager); 74 if (is_callable(array($TypeObject, $Event))) return ($TypeObject->$Event($Parameters));75 else return ($TypeName.'->'.$Event.'('.serialize($Parameters).')');76 } else return ($TypeName);74 if (is_callable(array($TypeObject, $Event))) return $TypeObject->$Event($Parameters); 75 else return $TypeName.'->'.$Event.'('.serialize($Parameters).')'; 76 } else return $TypeName; 77 77 } 78 78 … … 84 84 $TypeClass = 'Type'.$Type['Class']; 85 85 $TypeObject = new $TypeClass($this->FormManager); 86 return ($TypeObject->Hidden);87 } else return (false);86 return $TypeObject->Hidden; 87 } else return false; 88 88 } 89 89 … … 111 111 function GetTypeDefinition($TypeName) 112 112 { 113 return ($this->TypeDefinitionList[$TypeName]);113 return $this->TypeDefinitionList[$TypeName]; 114 114 } 115 115 }
Note:
See TracChangeset
for help on using the changeset viewer.