Ignore:
Timestamp:
May 25, 2014, 8:29:03 PM (10 years ago)
Author:
chronos
Message:
  • Přidáno: Záznam změn online stavu dostupnosti rozhraní do tabulky.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/System.php

    r634 r657  
    1313  /** @var Database */
    1414  var $Database;
    15   var $Modules; 
     15  var $Modules;
    1616  /** @var Type */
    1717  var $Type;
     
    3838    if(substr($this->RootURLFolder, -10, 10) == '/index.php')
    3939      $this->RootURLFolder = substr($this->RootURLFolder, 0, -10);
    40   } 
    41  
     40  }
     41
    4242  function RegisterPage($Path, $Handler)
    4343  {
     
    4848      foreach($Path as $PathItem)
    4949      {
    50         $Page = &$Page[$PathItem];       
     50        $Page = &$Page[$PathItem];
    5151      }
    5252      if(!is_array($Page)) $Page = array('' => $Page);
     
    5454    } else $this->Pages[$Path] = $Handler;
    5555  }
    56  
     56
    5757  function UnregisterPage($Path)
    5858  {
    59     unset($this->Pages[$Path]); 
    60   }
    61  
     59    unset($this->Pages[$Path]);
     60  }
     61
    6262  function SearchPage($PathItems, $Pages)
    6363  {
     
    6666    if(array_key_exists($PathItem, $Pages))
    6767    {
    68       if(is_array($Pages[$PathItem])) 
     68      if(is_array($Pages[$PathItem]))
    6969      {
    7070        array_shift($PathItems);
     
    7373    } else return('');
    7474  }
    75  
     75
    7676  function PageNotFound()
    7777  {
    7878    return('Page '.implode('/', $this->PathItems).' not found.');
    7979  }
    80  
     80
    8181  function ShowPage()
    8282  {
    8383        /* @var $Page Page */
    84     $ClassName = $this->SearchPage($this->PathItems, $this->Pages);     
    85     if($ClassName != '') 
     84    $ClassName = $this->SearchPage($this->PathItems, $this->Pages);
     85    if($ClassName != '')
    8686    {
    8787      $Page = new $ClassName($this);
     
    9292    }
    9393  }
    94  
     94
    9595  function ModulePresent($Name)
    9696  {
     
    103103    $this->Modules[get_class($Module)] = $Module;
    104104  }
    105  
     105
    106106  function HumanDate($Time)
    107107  {
    108108    return(date('j.n.Y', $Time));
    109109  }
    110  
     110
    111111  function Link($Target)
    112112  {
    113113    return($this->RootURLFolder.$Target);
    114114  }
    115  
     115
    116116  function ShowAction($Id)
    117117  {
     
    136136        global $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type,
    137137      $DatabaseRevision, $Config;
    138  
     138
    139139    date_default_timezone_set('Europe/Prague');
    140140    mb_internal_encoding("UTF-8");
    141141    $ScriptTimeStart = GetMicrotime();
    142  
     142
    143143    // SQL injection hack protection
    144144    foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
     
    147147    if(isset($_SERVER['REMOTE_ADDR'])) session_start();
    148148
    149     $ConfigFileName = dirname(__FILE__).'/../config.php';     
    150     if(file_exists($ConfigFileName)) 
     149    $ConfigFileName = dirname(__FILE__).'/../config.php';
     150    if(file_exists($ConfigFileName))
    151151      $this->ConfigManager->LoadFromFile($ConfigFileName);
    152152    //$this->Config = $this->ConfigManager->GetAsArray();
    153153    $this->Config = &$Config;
    154    
    155     try { 
    156       $this->Database->Connect($this->Config['Database']['Host'], $this->Config['Database']['User'], 
     154
     155    try {
     156      $this->Database->Connect($this->Config['Database']['Host'], $this->Config['Database']['User'],
    157157        $this->Config['Database']['Password'], $this->Config['Database']['Database']);
    158158      $this->Database->Prefix = $this->Config['Database']['Prefix'];
     
    166166      $this->RootURLFolder = $this->Config['Web']['RootFolder'];
    167167    $this->FormManager->Root = $this->RootURLFolder;
    168  
     168
    169169    $this->RegisterPageBar('Top');
    170  
    171     $Database = $this->Database; 
    172     RegisterFormClasses($this->FormManager); 
    173  
     170
     171    $Database = $this->Database;
     172    RegisterFormClasses($this->FormManager);
     173
    174174    // Register and start existing modules
    175175    $this->Setup = new Setup($this);
     
    183183      $this->PathItems = ProcessURL();
    184184      $this->ShowPage();
    185     }   
    186   }
    187  
     185    }
     186  }
     187
    188188  function RegisterPageBar($Name)
    189189  {
     
    206206  var $FullTitle = 'Stránka nenalezena';
    207207  var $ShortTitle = 'Stránka nenalezena';
    208  
     208
    209209  function __construct($System)
    210210  {
     
    215215  function Show()
    216216  {
    217     Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); 
     217    Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
    218218    return('<h3 align="center">Požadovaná stránka neexistuje.</h3>');
    219219  }
Note: See TracChangeset for help on using the changeset viewer.