Changeset 92 for trunk/Global.php


Ignore:
Timestamp:
Apr 7, 2020, 11:53:58 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Global.php

    r77 r92  
    77function HumanDate($Time)
    88{
    9   return(date('j.n.Y', $Time));
     9  return date('j.n.Y', $Time);
    1010}
    1111
     
    1313{
    1414  list($Usec, $Sec) = explode(" ", microtime());
    15   return ((float)$Usec + (float)$Sec);
     15  return (float)$Usec + (float)$Sec;
    1616}
    1717
    1818function MakeLink($Target, $Title)
    1919{
    20   return('<a href="'.$Target.'">'.$Title.'</a>');
     20  return '<a href="'.$Target.'">'.$Title.'</a>';
    2121}
    2222
     
    2525  $Result = '<table cellspacing="0" class="BasicTable">';
    2626  $Result .= '<tr>';
    27   foreach($Table['Header'] as $Item)
     27  foreach ($Table['Header'] as $Item)
    2828    $Result .= '<th>'.$Item.'</th>';
    2929  $Result .= '</tr>';
    30   foreach($Table['Rows'] as $Row)
     30  foreach ($Table['Rows'] as $Row)
    3131  {
    3232    $Result .= '<tr>';
    33     foreach($Row as $Item)
     33    foreach ($Row as $Item)
    3434      $Result .= '<td>'.$Item.'</td>';
    3535    $Result .= '</tr>';
    3636  }
    3737  $Result .= '</table>';
    38   return($Result);
     38  return $Result;
    3939}
    4040
     
    4848  );
    4949
    50   foreach($Class as $Index => $Item)
     50  foreach ($Class as $Index => $Item)
    5151  {
    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'])
    5454    {
    5555      case 'Boolean':
    56         if($Values[$Index] == 0) $Checked = ''; else $Checked = ' checked="yes"';
     56        if ($Values[$Index] == 0) $Checked = ''; else $Checked = ' checked="yes"';
    5757        $Edit = '<input type="checkbox" name="'.$Index.'"'.$Checked.'>';
    5858        break;
     
    6969  }
    7070  $Output = '<h3>Tabulka '.$ClassName.'</h3>'.Table($Table).MakeLink('?Operation=Add2', 'Přidat');
    71   return($Output);
     71  return $Output;
    7272}
    7373
    7474function ProcessURL()
    7575{
    76   if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
     76  if (array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
    7777    $PathString = $_SERVER['REDIRECT_QUERY_STRING'];
    7878    else $PathString = '';
    79   if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
     79  if (substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
    8080  $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))
    8282    $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
    8383    else $_SERVER['QUERY_STRING'] = '';
    8484  parse_str($_SERVER['QUERY_STRING'], $_GET);
    85   return($PathItems);
     85  return $PathItems;
    8686}
    8787
     
    9090  $Result = array();
    9191  $Parts = explode('&', $QueryString);
    92   foreach($Parts as $Part)
     92  foreach ($Parts as $Part)
    9393  {
    94     if($Part != '')
     94    if ($Part != '')
    9595    {
    96       if(!strpos($Part, '=')) $Part .= '=';
     96      if (!strpos($Part, '=')) $Part .= '=';
    9797      $Item = explode('=', $Part);
    9898      $Result[$Item[0]] = $Item[1];
    9999    }
    100100  }
    101   return($Result);
     101  return $Result;
    102102}
    103103
     
    105105{
    106106  $Parts = array();
    107   foreach($QueryStringArray as $Index => $Item)
     107  foreach ($QueryStringArray as $Index => $Item)
    108108  {
    109109    $Parts[] = $Index.'='.$Item;
    110110  }
    111   return(implode('&amp;', $Parts));
     111  return implode('&amp;', $Parts);
    112112}
Note: See TracChangeset for help on using the changeset viewer.