Changeset 92 for trunk/Global.php
- Timestamp:
- Apr 7, 2020, 11:53:58 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Global.php
r77 r92 7 7 function HumanDate($Time) 8 8 { 9 return (date('j.n.Y', $Time));9 return date('j.n.Y', $Time); 10 10 } 11 11 … … 13 13 { 14 14 list($Usec, $Sec) = explode(" ", microtime()); 15 return ( (float)$Usec + (float)$Sec);15 return (float)$Usec + (float)$Sec; 16 16 } 17 17 18 18 function MakeLink($Target, $Title) 19 19 { 20 return ('<a href="'.$Target.'">'.$Title.'</a>');20 return '<a href="'.$Target.'">'.$Title.'</a>'; 21 21 } 22 22 … … 25 25 $Result = '<table cellspacing="0" class="BasicTable">'; 26 26 $Result .= '<tr>'; 27 foreach ($Table['Header'] as $Item)27 foreach ($Table['Header'] as $Item) 28 28 $Result .= '<th>'.$Item.'</th>'; 29 29 $Result .= '</tr>'; 30 foreach ($Table['Rows'] as $Row)30 foreach ($Table['Rows'] as $Row) 31 31 { 32 32 $Result .= '<tr>'; 33 foreach ($Row as $Item)33 foreach ($Row as $Item) 34 34 $Result .= '<td>'.$Item.'</td>'; 35 35 $Result .= '</tr>'; 36 36 } 37 37 $Result .= '</table>'; 38 return ($Result);38 return $Result; 39 39 } 40 40 … … 48 48 ); 49 49 50 foreach ($Class as $Index => $Item)50 foreach ($Class as $Index => $Item) 51 51 { 52 if (!array_key_exists($Index, $Values)) $Values[$Index] = $Item['Default'];53 switch ($Item['Type'])52 if (!array_key_exists($Index, $Values)) $Values[$Index] = $Item['Default']; 53 switch ($Item['Type']) 54 54 { 55 55 case 'Boolean': 56 if ($Values[$Index] == 0) $Checked = ''; else $Checked = ' checked="yes"';56 if ($Values[$Index] == 0) $Checked = ''; else $Checked = ' checked="yes"'; 57 57 $Edit = '<input type="checkbox" name="'.$Index.'"'.$Checked.'>'; 58 58 break; … … 69 69 } 70 70 $Output = '<h3>Tabulka '.$ClassName.'</h3>'.Table($Table).MakeLink('?Operation=Add2', 'Přidat'); 71 return ($Output);71 return $Output; 72 72 } 73 73 74 74 function ProcessURL() 75 75 { 76 if (array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))76 if (array_key_exists('REDIRECT_QUERY_STRING', $_SERVER)) 77 77 $PathString = $_SERVER['REDIRECT_QUERY_STRING']; 78 78 else $PathString = ''; 79 if (substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);79 if (substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1); 80 80 $PathItems = explode('/', $PathString); 81 if (array_key_exists('REQUEST_URI', $_SERVER) and (strpos($_SERVER['REQUEST_URI'], '?') !== false))81 if (array_key_exists('REQUEST_URI', $_SERVER) and (strpos($_SERVER['REQUEST_URI'], '?') !== false)) 82 82 $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1); 83 83 else $_SERVER['QUERY_STRING'] = ''; 84 84 parse_str($_SERVER['QUERY_STRING'], $_GET); 85 return ($PathItems);85 return $PathItems; 86 86 } 87 87 … … 90 90 $Result = array(); 91 91 $Parts = explode('&', $QueryString); 92 foreach ($Parts as $Part)92 foreach ($Parts as $Part) 93 93 { 94 if ($Part != '')94 if ($Part != '') 95 95 { 96 if (!strpos($Part, '=')) $Part .= '=';96 if (!strpos($Part, '=')) $Part .= '='; 97 97 $Item = explode('=', $Part); 98 98 $Result[$Item[0]] = $Item[1]; 99 99 } 100 100 } 101 return ($Result);101 return $Result; 102 102 } 103 103 … … 105 105 { 106 106 $Parts = array(); 107 foreach ($QueryStringArray as $Index => $Item)107 foreach ($QueryStringArray as $Index => $Item) 108 108 { 109 109 $Parts[] = $Index.'='.$Item; 110 110 } 111 return (implode('&', $Parts));111 return implode('&', $Parts); 112 112 }
Note:
See TracChangeset
for help on using the changeset viewer.