Changeset 858


Ignore:
Timestamp:
May 8, 2019, 7:59:39 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Missing intialization of some variables.
  • Fixed: Missing appmodule dependencies.
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/System.php

    r839 r858  
    141141  {
    142142    global $Database, $ScriptTimeStart, $ConfigFileName, $Mail, $Type,
    143       $DatabaseRevision, $Config;
     143      $DatabaseRevision, $Config, $GlobalLocaleManager;
    144144
    145145    date_default_timezone_set('Europe/Prague');
     
    171171      //$Output .= 'Nelze se připojit k databázi.';
    172172    }
     173
     174    $this->LocaleManager = new LocaleManager($this);
     175    $this->LocaleManager->Dir = dirname(dirname(__FILE__)).'/locale';
     176    $this->LocaleManager->Available = array(
     177      'cs' => array('Code' => 'cs', 'Title' => 'Česky'),
     178      'en' => array('Code' => 'en', 'Title' => 'English'),
     179    );
     180    $GlobalLocaleManager = $this->LocaleManager;
     181    $this->LinkLocaleExceptions = array('images', 'style', 'files');
     182
    173183    if(isset($this->Config['Web']['RootFolder']))
    174184      $this->RootURLFolder = $this->Config['Web']['RootFolder'];
     
    195205    {
    196206      $this->PathItems = ProcessURL();
     207
     208      // Detect interface locale
     209      if(isset($this->Config['Web']['Locale']))
     210        $this->LocaleManager->DefaultLangCode = $this->Config['Web']['Locale'];
     211      $this->LocaleManager->LangCode = $this->LocaleManager->DefaultLangCode;
     212      if(count($this->PathItems) > 0)
     213      {
     214         $NewLangCode = $this->PathItems[0];
     215         if(array_key_exists($NewLangCode, $this->LocaleManager->Available))
     216         {
     217           array_shift($this->PathItems);
     218           $this->LocaleManager->LangCode = $NewLangCode;
     219         }
     220      }
     221      if(array_key_exists($this->LocaleManager->LangCode, $this->LocaleManager->Available))
     222        $this->LocaleManager->LoadLocale($this->LocaleManager->LangCode);
     223
    197224      $this->ShowPage();
    198225    }
  • trunk/Application/Version.php

    r855 r858  
    11<?php
    22
    3 $Revision = 855; // Subversion revision
     3$Revision = 857; // Subversion revision
    44$DatabaseRevision = 855; // SQL structure revision
    5 $ReleaseTime = strtotime('2018-04-08');
     5$ReleaseTime = strtotime('2019-05-08');
  • trunk/Modules/Network/Network.php

    r855 r858  
    142142    $this->System->RegisterPage(array('network', 'frequency-plan'), 'PageFrequencyPlan');
    143143
    144     $this->System->RegisterCommandLine('config', array($this, 'ImportNetworkLog'));
     144    $this->System->RegisterCommandLine('networklogimport', array($this, 'ImportNetworkLog'));
    145145
    146146    $this->System->FormManager->RegisterClass('NetworkDomainAlias', array(
  • trunk/Modules/NetworkTopology/topologie2.php

    r738 r858  
    119119      imageline($this->Image, $ParentHostPos['x'], $ParentHostPos['y'] + $this->HostHeight * 0.5, $HostPos['x'], $ParentHostPos['y']  + $this->HostHeight * 0.5, $this->LineColor);
    120120      imageline($this->Image, $HostPos['x'], $ParentHostPos['y'] + $this->HostHeight * 0.5, $HostPos['x'], $HostPos['y'], $this->LineColor);
    121       $this->DrawNode(&$Host['subitems'][$Index]);
     121      $this->DrawNode($Host['subitems'][$Index]);
    122122      imagecopy($this->Image, $this->ImageComputer, $HostPos['x'] - imagesx($this->ImageComputer) * 0.5, $HostPos['y'] - imagesy($this->ImageComputer) * 0.5, 0, 0, 30, 30);
    123123      imagestring($this->Image, 2, $HostPos['x'] - (strlen($SubHost['name']) * imagefontwidth(2)) / 2, $HostPos['y'] + imagesy($this->ImageComputer) * 0.5, $SubHost['name'], $this->TextColor);
  • trunk/Modules/Portal/Portal.php

    r790 r858  
    1313    $this->License = 'GNU/GPLv3';
    1414    $this->Description = 'Community portal.';
    15     $this->Dependencies = array('News');
     15    $this->Dependencies = array('News', 'User');
    1616  }
    1717
  • trunk/Modules/User/User.php

    r790 r858  
    4848  `HostName` varchar(255) NOT NULL DEFAULT '',
    4949  `ScriptName` varchar(255) NOT NULL,
     50  `StayLogged` INT NOT NULL,
     51  `StayLoggedHash` VARCHAR(40) NOT NULL,
    5052  PRIMARY KEY (`Id`),
    5153  KEY `User` (`User`)
  • trunk/Packages/Common/AppModule.php

    r817 r858  
    6969    $this->License = '';
    7070    $this->Version = '';
     71    $this->Creator = '';
    7172    $this->Description = '';
    7273    $this->Dependencies = array();
    7374    $this->Type = ModuleType::Normal;
    7475  }
    75  
     76
    7677  function Install()
    7778  {
  • trunk/Packages/Common/Database.php

    r852 r858  
    109109      $this->insert_id = $this->PDO->lastInsertId();
    110110    } else
    111     {
     111    {     
    112112      $this->Error = $this->PDO->errorInfo();
    113113      $this->Error = $this->Error[2];
Note: See TracChangeset for help on using the changeset viewer.