Changeset 63 for trunk/Global.php
- Timestamp:
- Aug 3, 2021, 11:20:41 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 nbproject2 Config.php3 1 .settings 4 2 .project 5 3 .buildpath 4 .htaccess
-
- Property svn:ignore
-
trunk/Global.php
r55 r63 1 1 <?php 2 2 3 function HumanDate( $Time)3 function HumanDate(int $Time): string 4 4 { 5 5 return date('j.n.Y', $Time); 6 6 } 7 7 8 function HumanTime( $Time)8 function HumanTime(int $Time): string 9 9 { 10 10 return date('H:i:s', $Time); 11 11 } 12 12 13 function HumanDateTime( $Time)13 function HumanDateTime(int $Time): string 14 14 { 15 15 $Output = HumanDate($Time); … … 19 19 } 20 20 21 function Link2( $URL)21 function Link2(string $URL): string 22 22 { 23 23 global $Config; … … 26 26 } 27 27 28 function ProcessURL() 28 function ProcessURL(): array 29 29 { 30 30 if (array_key_exists('REDIRECT_QUERY_STRING', $_SERVER)) … … 40 40 } 41 41 42 function GetQueryStringArray( $QueryString)42 function GetQueryStringArray(string $QueryString): array 43 43 { 44 44 $Result = array(); … … 56 56 } 57 57 58 function SetQueryStringArray( $QueryStringArray)58 function SetQueryStringArray(array $QueryStringArray): string 59 59 { 60 60 $Parts = array(); … … 66 66 } 67 67 68 function GetPageList($TotalCount) 68 function HumanSize(int $Value): string 69 { 70 global $UnitNames; 71 72 $UnitIndex = 0; 73 while ($Value > 1024) 74 { 75 $Value = round($Value / 1024, 3); 76 $UnitIndex++; 77 } 78 return $Value.' '.$UnitNames[$UnitIndex]; 79 } 80 81 function GetPageList(int $TotalCount): array 69 82 { 70 83 global $Config; … … 72 85 $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']); 73 86 74 $ItemPerPage = $Config['ItemsPerPage'];75 $Around = round( $Config['VisiblePagingItems'] / 2);87 $ItemPerPage = (int)$Config['ItemsPerPage']; 88 $Around = round((int)$Config['VisiblePagingItems'] / 2); 76 89 $Result = ''; 77 90 $PageCount = floor($TotalCount / $ItemPerPage) + 1; … … 131 144 $OrderArrowImage = array('sort_asc.png', 'sort_desc.png'); 132 145 133 function GetOrderTableHeader( $Columns, $DefaultColumn, $DefaultOrder = 0)146 function GetOrderTableHeader(array $Columns, string $DefaultColumn, int $DefaultOrder = 0): array 134 147 { 135 148 global $OrderDirSQL, $OrderArrowImage, $Config; … … 179 192 } 180 193 181 function GetMicrotime() 194 function GetMicrotime(): float 182 195 { 183 196 list($Usec, $Sec) = explode(' ', microtime()); … … 189 202 var $Items = array(); 190 203 191 function GetOutput( $Link)204 function GetOutput(string $Link): string 192 205 { 193 206 $Output = ''; … … 355 368 '<input value="'.$_SESSION[$Item['Name'].'do'].'" onkeyup="'. 356 369 'if (event.keyCode!=9) upf(\''.$Item['Name'].'do\',$(this).val(),(event.keyCode==13?0:1));" '. 357 'id="'.$Item['Name'].'do" autocomplete="off" type="text"/>'. 358 '<div class="label-box">'.$Item['Units'].'</div>'. 359 '</div> '; 370 'id="'.$Item['Name'].'do" autocomplete="off" type="text"/>'; 371 if (array_key_exists('Units', $Item)) 372 { 373 $Output .= '<div class="label-box">'.$Item['Units'].'</div>'; 374 } 375 $Output .= '</div> '; 360 376 } 361 377 } … … 365 381 } 366 382 367 function GetWhere( $Database)383 function GetWhere(Database $Database): string 368 384 { 369 385 $Where = '';
Note:
See TracChangeset
for help on using the changeset viewer.