Ignore:
Timestamp:
Feb 22, 2015, 11:20:50 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Tabs converted to spaces.
  • Modified: Remove spaces from end of lines.
  • Added: Code format script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r806 r816  
    4242  $System = new System();
    4343  $System->DoNotShowPage = true;
    44         $System->Run();
     44  $System->Run();
    4545  $User = $System->User; // Back compatibility, will be removed
    4646}
     
    4848class TempPage extends Page
    4949{
    50         function Show()
    51         {
    52                 global $TempPageContent;
    53                 return($TempPageContent);
    54         }
     50  function Show()
     51  {
     52    global $TempPageContent;
     53    return($TempPageContent);
     54  }
    5555}
    5656
    5757function ShowPageClass($Page)
    5858{
    59         global $TempPageContent, $System;
     59  global $TempPageContent, $System;
    6060
    6161  $System->Pages['temporary-page'] = get_class($Page);
    62         $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page';
     62  $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page';
    6363  $System->PathItems = ProcessURL();
    64         $System->ShowPage();
     64  $System->ShowPage();
    6565}
    6666
    6767function ShowPage($Content)
    6868{
    69         global $TempPageContent, $System;
     69  global $TempPageContent, $System;
    7070
    7171  $TempPage = new TempPage($System);
    7272  $System->Pages['temporary-page'] = 'TempPage';
    73         $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page';
    74         $TempPageContent = $Content;
     73  $_SERVER['REDIRECT_QUERY_STRING'] = 'temporary-page';
     74  $TempPageContent = $Content;
    7575  $System->PathItems = ProcessURL();
    76         $System->ShowPage();
     76  $System->ShowPage();
    7777}
    7878
     
    260260  if(array_key_exists('OrderCol', $_GET)) $_SESSION['OrderCol'] = $_GET['OrderCol'];
    261261  if(array_key_exists('OrderDir', $_GET) and (array_key_exists($_GET['OrderDir'], $OrderArrowImage)))
    262         $_SESSION['OrderDir'] = $_GET['OrderDir'];
     262    $_SESSION['OrderDir'] = $_GET['OrderDir'];
    263263  if(!array_key_exists('OrderCol', $_SESSION)) $_SESSION['OrderCol'] = $DefaultColumn;
    264264  if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder;
     
    557557}
    558558
    559 function GetTranslatNamesArray() 
     559function GetTranslatNamesArray()
    560560{
    561561  $TablesColumn = array
     
    733733
    734734  $IconName = array(
    735           MESSAGE_INFORMATION => 'information',
     735    MESSAGE_INFORMATION => 'information',
    736736    MESSAGE_WARNING => 'warning',
    737737    MESSAGE_CRITICAL => 'critical'
    738738  );
    739739  $BackgroundColor = array(
    740         MESSAGE_INFORMATION => '#e0e0ff',
     740    MESSAGE_INFORMATION => '#e0e0ff',
    741741    MESSAGE_WARNING => '#ffffe0',
    742         MESSAGE_CRITICAL => '#ffe0e0'
     742    MESSAGE_CRITICAL => '#ffe0e0'
    743743  );
    744744
    745745  return('<div class="message" style="background-color: '.$BackgroundColor[$Type].
    746         ';"><table><tr><td class="icon"><img src="'.
    747         $System->Link('/images/message/'.$IconName[$Type].'.png').'" alt="'.
    748         $IconName[$Type].'"><td>'.$Text.'</td></tr></table></div>');
     746    ';"><table><tr><td class="icon"><img src="'.
     747    $System->Link('/images/message/'.$IconName[$Type].'.png').'" alt="'.
     748    $IconName[$Type].'"><td>'.$Text.'</td></tr></table></div>');
    749749}
    750750
    751751function ProcessURL()
    752752{
    753         if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
    754                 $PathString = $_SERVER['REDIRECT_QUERY_STRING'];
    755         else $PathString = '';
    756         if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
    757         $PathItems = explode('/', $PathString);
    758         if(strpos(GetRequestURI(), '?') !== false)
    759                 $_SERVER['QUERY_STRING'] = substr(GetRequestURI(), strpos(GetRequestURI(), '?') + 1);
    760         else $_SERVER['QUERY_STRING'] = '';
    761         parse_str($_SERVER['QUERY_STRING'], $_GET);
     753  if(array_key_exists('REDIRECT_QUERY_STRING', $_SERVER))
     754    $PathString = $_SERVER['REDIRECT_QUERY_STRING'];
     755  else $PathString = '';
     756  if(substr($PathString, -1, 1) == '/') $PathString = substr($PathString, 0, -1);
     757  $PathItems = explode('/', $PathString);
     758  if(strpos(GetRequestURI(), '?') !== false)
     759    $_SERVER['QUERY_STRING'] = substr(GetRequestURI(), strpos(GetRequestURI(), '?') + 1);
     760  else $_SERVER['QUERY_STRING'] = '';
     761  parse_str($_SERVER['QUERY_STRING'], $_GET);
    762762  // SQL injection hack protection
    763763  foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]);
    764         return($PathItems);
     764  return($PathItems);
    765765}
    766766
    767767function WriteLanguages($Selected)
    768768{
    769         global $System;
    770 
    771         $Output = '<select name="Language">';
    772         $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');
    773         while($Language = $DbResult->fetch_assoc())
    774         {
    775                 $Output .= '<option value="'.$Language['Id'].'"';
    776                 if($Selected == $Language['Id'])
    777                         $Output .= ' selected="selected"';
    778                 $Output .= '>'.$Language['Name'].'</option>';
    779         }
    780         $Output .= '</select>';
    781         return($Output);
     769  global $System;
     770
     771  $Output = '<select name="Language">';
     772  $DbResult = $System->Database->select('Language', '`Id`, `Name`', '`Enabled` = 1');
     773  while($Language = $DbResult->fetch_assoc())
     774  {
     775    $Output .= '<option value="'.$Language['Id'].'"';
     776    if($Selected == $Language['Id'])
     777      $Output .= ' selected="selected"';
     778    $Output .= '>'.$Language['Name'].'</option>';
     779  }
     780  $Output .= '</select>';
     781  return($Output);
    782782}
    783783
Note: See TracChangeset for help on using the changeset viewer.