Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (4 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Map/Map.php

    r874 r887  
    55class PageNetworkMap extends Page
    66{
    7   var $FullTitle = 'Mapa sítě';
    8   var $ShortTitle = 'Mapa sítě';
    9   var $ParentClass = 'PagePortal';
     7  function __construct(System $System)
     8  {
     9    parent::__construct($System);
     10    $this->FullTitle = 'Mapa sítě';
     11    $this->ShortTitle = 'Mapa sítě';
     12    $this->ParentClass = 'PagePortal';
     13  }
    1014  //var $Load = 'initialize()';
    1115  //var $Unload = 'GUnload()';
    1216
    13   function Show()
    14   {
    15     if (!$this->System->User->CheckPermission('Map', 'Show'))
     17  function Show(): string
     18  {
     19    if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Map', 'Show'))
    1620      return 'Nemáte oprávnění';
    1721
     
    2327  }
    2428
    25   function ShowPosition()
     29  function ShowPosition(): string
    2630  {
    2731    $DbResult = $this->Database->select('MapPosition', '*', '`Id`='.$_GET['i']);
     
    4448  }
    4549
    46   function ShowMain()
     50  function ShowMain(): string
    4751  {
    4852    $Map = new MapOpenStreetMaps($this->System);
     
    242246class TypeMapPosition extends TypeString
    243247{
    244   function OnEdit($Item)
     248  function OnEdit(array $Item): string
    245249  {
    246250    $Output = parent::OnEdit($Item);
     
    255259class ModuleMap extends AppModule
    256260{
    257   function __construct($System)
     261  function __construct(System $System)
    258262  {
    259263    parent::__construct($System);
     
    263267    $this->License = 'GNU/GPL';
    264268    $this->Description = 'Show objects on Google maps';
    265     $this->Dependencies = array('Network');
     269    $this->Dependencies = array('Network', 'User');
    266270    $this->SupportedModels = array();
    267271  }
    268272
    269   function DoStart()
     273  function DoStart(): void
    270274  {
    271275    $this->System->Pages['map'] = 'PageNetworkMap';
     
    310314  }
    311315
    312   function DoInstall()
     316  function DoInstall(): void
    313317  {
    314318    $this->System->Database->query("CREATE TABLE IF NOT EXISTS `MapPosition` (
     
    320324  }
    321325
    322   function DoUninstall()
     326  function DoUninstall(): void
    323327  {
    324328    $this->Database->query('DROP TABLE `MapPosition`');
Note: See TracChangeset for help on using the changeset viewer.