Changeset 92 for trunk/Application


Ignore:
Timestamp:
Apr 7, 2020, 11:53:58 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
Location:
trunk/Application
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Core.php

    r84 r92  
    22
    33$ConfigFileName = dirname(__FILE__).'/../Config/Config.php';
    4 if(file_exists($ConfigFileName)) include_once($ConfigFileName);
     4if (file_exists($ConfigFileName)) include_once($ConfigFileName);
    55
    66include_once(dirname(__FILE__).'/../Global.php');
     
    2424    $this->ShowPage = true;
    2525    $this->BaseURL = $_SERVER['SCRIPT_NAME'];
    26     if(substr($this->BaseURL, -10, 10) == '/index.php')
     26    if (substr($this->BaseURL, -10, 10) == '/index.php')
    2727      $this->BaseURL = substr($this->BaseURL, 0, -10);
    2828  }
     
    3232    global $Config, $DatabaseRevision, $WithoutSessionStart;
    3333
    34     if($this->UseSession) session_start();
     34    if ($this->UseSession) session_start();
    3535
    3636    $ErrorHandler = new ErrorHandler();
     
    5050
    5151    // SQL injection hack protection
    52     foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
    53     foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
     52    foreach ($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
     53    foreach ($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
    5454
    5555    $this->Config = &$Config;
     
    5858    $this->Setup = new Setup($this);
    5959    $this->Setup->Start();
    60     if($this->Setup->CheckState())
     60    if ($this->Setup->CheckState())
    6161    {
    6262      $this->ModuleManager->Start();
     
    6767  {
    6868    $this->RunCommon();
    69     if($this->ShowPage)
     69    if ($this->ShowPage)
    7070    {
    7171      $this->PathItems = ProcessURL();
     
    8080    /* @var $Page Page */
    8181    $ClassName = $this->SearchPage($this->PathItems, $this->Pages);
    82     if($ClassName != '')
     82    if ($ClassName != '')
    8383    {
    8484      $Page = new $ClassName($this);
     
    9191  function RegisterPage($Path, $Handler)
    9292  {
    93     if(is_array($Path))
     93    if (is_array($Path))
    9494    {
    9595      $Page = &$this->Pages;
    9696      $LastKey = array_pop($Path);
    97       foreach($Path as $PathItem)
     97      foreach ($Path as $PathItem)
    9898      {
    9999        $Page = &$Page[$PathItem];
    100100      }
    101       if(!is_array($Page)) $Page = array('' => $Page);
     101      if (!is_array($Page)) $Page = array('' => $Page);
    102102      $Page[$LastKey] = $Handler;
    103103    } else $this->Pages[$Path] = $Handler;
     
    111111  function SearchPage($PathItems, $Pages)
    112112  {
    113     if(count($PathItems) > 0) $PathItem = $PathItems[0];
     113    if (count($PathItems) > 0) $PathItem = $PathItems[0];
    114114      else $PathItem = '';
    115     if(array_key_exists($PathItem, $Pages))
     115    if (array_key_exists($PathItem, $Pages))
    116116    {
    117       if(is_array($Pages[$PathItem]))
     117      if (is_array($Pages[$PathItem]))
    118118      {
    119119        array_shift($PathItems);
    120         return($this->SearchPage($PathItems, $Pages[$PathItem]));
    121       } else return($Pages[$PathItem]);
    122     } else return('');
     120        return $this->SearchPage($PathItems, $Pages[$PathItem]);
     121      } else return $Pages[$PathItem];
     122    } else return '';
    123123  }
    124124
    125125  function Link($Target)
    126126  {
    127     return($this->BaseURL.$Target);
     127    return $this->BaseURL.$Target;
    128128  }
    129129}
     
    141141  {
    142142    Header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
    143     return('<h3 align="center">'.T('Required page not found'));
     143    return '<h3 align="center">'.T('Required page not found');
    144144  }
    145145}
  • trunk/Application/DefaultConfig.php

    r78 r92  
    66  {
    77    $IsDeveloper = in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'));
    8     return(array
     8    return array
    99    (
    1010        array('Name' => 'SystemPassword', 'Type' => 'PasswordEncoded', 'Default' => '', 'Title' => 'Systémové heslo'),
     
    5353        array('Name' => 'MainRouter/ConnectTimeout', 'Type' => 'Integer', 'Default' => '5', 'Title' => 'Vypršení času'),
    5454        array('Name' => 'MainRouter/MangleRuleSubgroupMinPrefix', 'Type' => 'Integer', 'Default' => '28', 'Title' => 'Nejmenší prefix podsítě pro mangle pravidla'),
    55     ));
     55    );
    5656  }
    5757}
  • trunk/Application/UpdateTrace.php

    r81 r92  
    4444  'REFERENCES `Measure`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
    4545  $DbResult = $Manager->Execute('SELECT `Id`, `PermissionAdd` FROM `Measure`');
    46   while($DbRow = $DbResult->fetch_assoc())
     46  while ($DbRow = $DbResult->fetch_assoc())
    4747  {
    4848    $Manager->Execute('INSERT INTO `Permission` (`Measure`, `Operation`) VALUES ('.
     
    5050        }
    5151  $DbResult = $Manager->Execute('SELECT `Id`, `PermissionView` FROM `Measure`');
    52   while($DbRow = $DbResult->fetch_assoc())
     52  while ($DbRow = $DbResult->fetch_assoc())
    5353  {
    5454          $Manager->Execute('INSERT INTO `Permission` (`Measure`, `Operation`) VALUES ('.
     
    6161{
    6262  $DbResult = $Manager->Execute('SELECT `DataTable`,`DataType` FROM `Measure`;');
    63   while($Measure = $DbResult->fetch_assoc())
     63  while ($Measure = $DbResult->fetch_assoc())
    6464  {
    6565    $Table = $Measure['DataTable'];
     
    8080  function Get()
    8181  {
    82     return(array(
     82    return array(
    8383      65 => array('Revision' => 67, 'Function' => 'UpdateTo67'),
    8484      67 => array('Revision' => 79, 'Function' => 'UpdateTo79'),
    85     ));
     85    );
    8686  }
    8787}
  • trunk/Application/Version.php

    r90 r92  
    66// and system will need database update.
    77
    8 $Revision = 88;
     8$Revision = 92;
    99$DatabaseRevision = 79;
    10 $ReleaseTime = strtotime('2019-10-04');
     10$ReleaseTime = strtotime('2020-04-07');
  • trunk/Application/View.php

    r90 r92  
    2828  {
    2929    $Output = $this->ShowPage($Page->Show());
    30     return($Output);
     30    return $Output;
    3131  }
    3232}
Note: See TracChangeset for help on using the changeset viewer.