Changeset 874 for trunk/Common
- Timestamp:
- Apr 6, 2020, 11:56:19 PM (5 years ago)
- Location:
- trunk/Common
- Files:
-
- 28 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 } -
trunk/Common/Global.php
r873 r874 30 30 $UnitIndex++; 31 31 } 32 return ($Value.' '.$UnitNames[$UnitIndex]);32 return $Value.' '.$UnitNames[$UnitIndex]; 33 33 } 34 34 … … 36 36 { 37 37 list($Usec, $Sec) = explode(' ', microtime()); 38 return ( (float)$Usec + (float)$Sec);38 return (float)$Usec + (float)$Sec; 39 39 } 40 40 … … 48 48 function HumanDate($Time) 49 49 { 50 if ($Time != '') { 50 if ($Time != '') 51 { 51 52 $Date = explode(' ', $Time); 52 53 $Parts = explode('-', $Date[0]); 53 if ($Date != '0000-00-00') return ( ($Parts[2]*1).'.'.($Parts[1]*1).'.'.$Parts[0]);54 else return (' ');55 } else return (' ');54 if ($Date != '0000-00-00') return ($Parts[2] * 1).'.'.($Parts[1] * 1).'.'.$Parts[0]; 55 else return ' '; 56 } else return ' '; 56 57 } 57 58 … … 62 63 $Around = 10; 63 64 $Result = ''; 64 if ($Count >1)65 { 66 if ($Page >0)65 if ($Count > 1) 66 { 67 if ($Page > 0) 67 68 { 68 69 $Result.= '<a href="'.$URL.'0"><<</a> '; 69 $Result.= '<a href="'.$URL.($Page -1).'"><</a> ';70 } 71 $PagesMax = $Count -1;70 $Result.= '<a href="'.$URL.($Page - 1).'"><</a> '; 71 } 72 $PagesMax = $Count - 1; 72 73 $PagesMin = 0; 73 if ($PagesMax >($Page+$Around)) $PagesMax = $Page+$Around;74 if ($PagesMin <($Page-$Around))74 if ($PagesMax > ($Page + $Around)) $PagesMax = $Page + $Around; 75 if ($PagesMin < ($Page - $Around)) 75 76 { 76 77 $Result.= ' .. '; 77 $PagesMin = $Page -$Around;78 } 79 for ($i =$PagesMin;$i<=$PagesMax;$i++)80 { 81 if ($i ==$Page) $Result.= '<strong>';82 $Result .= '<a href="'.$URL.$i.'">'.($i+1).'</a> ';83 if ($i ==$Page) $Result.= '</strong>';84 } 85 if ($PagesMax <($Count-1)) $Result .= ' .. ';86 if ($Page <($Count-1))87 { 88 $Result .= '<a href="'.$URL.($Page+1).'">></a> ';89 $Result .= '<a href="'.$URL.($Count-1).'">>></a>';90 } 91 } 92 return ($Result);78 $PagesMin = $Page - $Around; 79 } 80 for ($i = $PagesMin; $i <= $PagesMax; $i++) 81 { 82 if ($i == $Page) $Result.= '<strong>'; 83 $Result .= '<a href="'.$URL.$i.'">'.($i + 1).'</a> '; 84 if ($i == $Page) $Result.= '</strong>'; 85 } 86 if ($PagesMax < ($Count - 1)) $Result .= ' .. '; 87 if ($Page < ($Count - 1)) 88 { 89 $Result .= '<a href="'.$URL.($Page + 1).'">></a> '; 90 $Result .= '<a href="'.$URL.($Count - 1).'">>></a>'; 91 } 92 } 93 return $Result; 93 94 } 94 95 95 96 function ExtractTime($Time) 96 97 { 97 return (array(98 return array( 98 99 'Year' => date('Y', $Time), 99 100 'Month' => date('n', $Time), … … 102 103 'Minute' => date('i', $Time), 103 104 'Second' => date('s', $Time) 104 ) );105 ); 105 106 } 106 107 … … 118 119 } 119 120 } 120 return ($Result);121 return $Result; 121 122 } 122 123 … … 128 129 $Parts[] = $Index.'='.$Item; 129 130 } 130 return (implode('&', $Parts));131 return implode('&', $Parts); 131 132 } 132 133 … … 199 200 200 201 $Result = '<div style="text-align: center">'.$Result.'</div>'; 201 return (array('SQLLimit' => ' LIMIT '.$CurrentPage * $ItemPerPage.', '.$ItemPerPage,202 return array('SQLLimit' => ' LIMIT '.$CurrentPage * $ItemPerPage.', '.$ItemPerPage, 202 203 'Page' => $CurrentPage, 203 204 'Output' => $Result, 204 ) );205 ); 205 206 } 206 207 … … 253 254 else $Result .= '<th><a href="?'.SetQueryStringArray($QueryItems).'">'.$Column['Title'].$ArrowImage.'</a></th>'; 254 255 } 255 return (array(256 return array( 256 257 'SQL' => ' ORDER BY `'.$_SESSION[$ObjectName.'OrderCol'].'` '.$OrderDirSQL[$_SESSION[$ObjectName.'OrderDir']], 257 258 'Output' => '<tr>'.$Result.'</tr>', 258 259 'Column' => $_SESSION[$ObjectName.'OrderCol'], 259 260 'Direction' => $_SESSION[$ObjectName.'OrderDir'], 260 ) );261 ); 261 262 } 262 263 … … 265 266 if (array_key_exists('REMOTE_ADDR', $_SERVER)) $IP = $_SERVER['REMOTE_ADDR']; 266 267 else $IP = '0.0.0.0'; 267 return ($IP);268 return $IP; 268 269 } 269 270 … … 282 283 } 283 284 } 284 return ($Result);285 return $Result; 285 286 } 286 287 … … 295 296 { 296 297 $DbRow = $DbResult->fetch_assoc(); 297 return ($DbRow['Id']);298 } else return ('');298 return $DbRow['Id']; 299 } else return ''; 299 300 } 300 301 … … 302 303 { 303 304 $Result = shell_exec('which '.$Command); 304 return (!empty($Result));305 return !empty($Result); 305 306 } 306 307 307 308 function RemoveDiacritic($Text) 308 309 { 309 return (str_replace(310 return str_replace( 310 311 array('á', 'č', 'ď', 'é', 'ě', 'í', 'ľ', 'ň', 'ó', 'ř', 'š', 'ť', 'ú', 'ů', 311 312 'ý', 'ž', 'Á', 'Č', 'Ď', 'É', 'Ě', 'Í', 'Ľ', 'Ň', 'Ó', 'Ř', 'Š', 'Ť', 'Ú', 'Ů', 'Ý', 'Ž'), 312 313 array('a', 'c', 'd', 'e', 'e', 'i', 'l', 'n', 'o', 'r', 's', 't', 'u', 'u', 313 314 'y', 'z', 'A', 'C', 'D', 'E', 'E', 'I', 'L', 'N', 'O', 'R', 'S', 'T', 'U', 'U', 'Y', 'Z'), 314 $Text) );315 $Text); 315 316 } 316 317 317 318 function RouterOSIdent($Name) 318 319 { 319 return (strtr(strtolower(trim($Name)), array(' ' => '-', '.' => '', '(' => '-', ')' => '-', ',' => '-',320 return strtr(strtolower(trim($Name)), array(' ' => '-', '.' => '', '(' => '-', ')' => '-', ',' => '-', 320 321 'č' => 'c', 'š' => 's', 'ě' => 'e', 'ř' => 'r', 'ž' => 'z', 'ý' => 'y', 321 322 'á' => 'a', 'í' => 'i', 'é' => 'e', 'ů' => 'u', 'ú' => 'u', 'ď' => 'd', … … 324 325 'Á' => 'a', 'Í' => 'i', 'É' => 'e', 'Ů' => 'u', 'Ú' => 'u', 'Ď' => 'd', 325 326 'Ť' => 't', 'Ň' => 'n', 'Ó' => 'o', 326 )));327 )); 327 328 } 328 329 329 330 function NotBlank($Text) 330 331 { 331 if ($Text == '') return (' ');332 else return ($Text);332 if ($Text == '') return ' '; 333 else return $Text; 333 334 } 334 335 … … 361 362 else $_SERVER['QUERY_STRING'] = ''; 362 363 parse_str($_SERVER['QUERY_STRING'], $_GET); 363 return ($PathItems);364 return $PathItems; 364 365 } 365 366 -
trunk/Common/VCL/Database.php
r873 r874 66 66 $ListView->Rows[] = $Row; 67 67 $Output = parent::Show(); 68 return ($Output);68 return $Output; 69 69 } 70 70 } -
trunk/Common/VCL/General.php
r873 r874 15 15 if ($Persistent) $_SESSION[$Name] = $Result; 16 16 } 17 return ($Result);17 return $Result; 18 18 } 19 19 … … 34 34 $Output = ''; 35 35 //$Output .= '#'.$this->Id; 36 return ($Output);36 return $Output; 37 37 } 38 38 … … 53 53 foreach ($this->Items as $Item) 54 54 $Output .= $Item->Show(); 55 return ($Output);55 return $Output; 56 56 } 57 57 } … … 72 72 if ($this->Visible) 73 73 { 74 return (parent::Show().'<button>'.$this->Caption.'</button>');74 return parent::Show().'<button>'.$this->Caption.'</button>'; 75 75 } 76 76 } … … 83 83 function Show() 84 84 { 85 return (parent::Show().'<input type="text" name="'.$this->Id.'" value="'.$this->Text.'"/>');85 return parent::Show().'<input type="text" name="'.$this->Id.'" value="'.$this->Text.'"/>'; 86 86 } 87 87 … … 119 119 } 120 120 $Output .= '<br/>'; 121 return ($Output);121 return $Output; 122 122 } 123 123 … … 134 134 function Show() 135 135 { 136 return ($this->Name);136 return $this->Name; 137 137 } 138 138 } … … 170 170 } 171 171 $Output .= '</table>'; 172 return ($Output);172 return $Output; 173 173 } 174 174 } … … 192 192 function ColumnClick($Column) 193 193 { 194 return ('?'.$this->Id.'_SortColumn='.$Column->Id.'&'.$this->Id.'_SortOrder='.(1 - $this->SortOrder));194 return '?'.$this->Id.'_SortColumn='.$Column->Id.'&'.$this->Id.'_SortOrder='.(1 - $this->SortOrder); 195 195 } 196 196 … … 208 208 if ($this->OnColumnClick != '') 209 209 $Output = '<a href="'.call_user_func($this->OnColumnClick, $Column).'">'.$Output.'</a>'; 210 return ($Output);210 return $Output; 211 211 } 212 212 … … 219 219 $Output .= parent::Show(); 220 220 $Output .= $this->PageSelect->Show(); 221 return ($Output);221 return $Output; 222 222 } 223 223 … … 251 251 } 252 252 $Output .= '</table>'; 253 return ($Output);253 return $Output; 254 254 } 255 255 … … 279 279 $Output = '<a href="?'.$Link.'">'.$Output.'</a>'; 280 280 }; 281 return ($Output);281 return $Output; 282 282 } 283 283 … … 301 301 $Output .= $Item->Show(); 302 302 $Output .= '</body></html>'; 303 return ($Output);303 return $Output; 304 304 } 305 305
Note:
See TracChangeset
for help on using the changeset viewer.