Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (3 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/Meals/Meals.php

    r874 r887  
    33class PageEatingPlace extends Page
    44{
    5   var $FullTitle = 'Jídleníček jídelny Na kopečku';
    6   var $ShortTitle = 'Jídelníček';
    7   var $ParentClass = 'PagePortal';
    85  var $DayNames = array('Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota');
    96  var $DayNamesShort = array('NE', 'PO', 'ÚT', 'ST', 'ČT', 'PÁ', 'SO');
     
    118  var $DayCount = 20;    // počet dopředu zobrazených dnů
    129
    13   function Show()
     10  function __construct(System $System)
     11  {
     12    parent::__construct($System);
     13    $this->FullTitle = 'Jídleníček jídelny Na kopečku';
     14    $this->ShortTitle = 'Jídelníček';
     15    $this->ParentClass = 'PagePortal';
     16  }
     17
     18  function Show(): string
    1419  {
    1520    if (count($this->System->PathItems) > 1)
     
    2126  }
    2227
    23   function ShowMenu()
     28  function ShowMenu(): string
    2429  {
    2530    //echo('Dnes je '.HumanDate(date('Y-m-d')).'<br>');
     
    4348  }
    4449
    45   function ShowPrint()
     50  function ShowPrint(): string
    4651  {
    4752    $this->ClearPage = true;
     
    9499  }
    95100
    96   function PrintTableRow($Row)
     101  function PrintTableRow(array $Row): string
    97102  {
    98103    global $LastWeekOfYear;
     
    120125  }
    121126
    122   function ShowEdit()
     127  function ShowEdit(): string
    123128  {
    124129    Header('Cache-Control: no-cache');
     
    136141        }
    137142        $Output .= '<div style="color: red; font-size: larger;">Menu uloženo!</div>';
    138         $this->System->ModuleManager->Modules['Log']->NewRecord('EatingPlace', 'MenuSave');
     143        ModuleLog::Cast($this->System->GetModule('Log'))->NewRecord('EatingPlace', 'MenuSave');
    139144      }
    140145      if ($_GET['action'] == 'saveinfo')
     
    143148        $this->Database->insert('MealsInfo', array('Info' => $_POST['info'], 'Price' => $_POST['price']));
    144149        $Output .= '<div style="color: red; font-size: larger;">Informační údaje uloženy!</div>';
    145         $this->System->ModuleManager->Modules['Log']->NewRecord('EatingPlace', 'InfoSave');
     150        ModuleLog::Cast($this->System->GetModule('Log'))->NewRecord('EatingPlace', 'InfoSave');
    146151      }
    147152    }
     
    179184class ModuleMeals extends AppModule
    180185{
    181   function __construct($System)
     186  function __construct(System $System)
    182187  {
    183188    parent::__construct($System);
     
    191196  }
    192197
    193   function DoInstall()
    194   {
    195   }
    196 
    197   function DoUnInstall()
    198   {
    199   }
    200 
    201   function DoStart()
    202   {
    203     $this->System->RegisterPage('jidelna', 'PageEatingPlace');
     198  function DoInstall(): void
     199  {
     200  }
     201
     202  function DoUnInstall(): void
     203  {
     204  }
     205
     206  function DoStart(): void
     207  {
     208    $this->System->RegisterPage(['jidelna'], 'PageEatingPlace');
    204209  }
    205210}
Note: See TracChangeset for help on using the changeset viewer.