Changeset 63 for trunk/Modules


Ignore:
Timestamp:
Aug 3, 2021, 11:20:41 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Used explicit types where possible for better error reporting.
  • Modified: Updated Common packaged to newer version.
  • Modified: Simplified pages title.
  • Added: Simple keyword based spam filter for meet items.
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 nbproject
        2 Config.php
        31.settings
        42.project
        53.buildpath
         4.htaccess
  • trunk/Modules/Club/Club.php

    r55 r63  
    11<?php
    22
    3 class ModuleClub extends AppModule
     3class ModuleClub extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
     17  function Start(): void
    1818  {
    19     $this->System->RegisterPage('tancirny', 'PageDanceClub');
    20   } 
     19    $this->System->RegisterPage(['tancirny'], 'PageDanceClub');
     20  }
    2121}
    2222
    2323class PageClub extends Page
    24 { 
     24{
    2525  function __construct($System)
    2626  {
    2727    parent::__construct($System);
    28     $this->FullTitle = 'Tančírny';
    29     $this->ShortTitle = 'Tančírny';
     28    $this->Title = 'Tančírny';
    3029  }
    31  
    32   function Show()
     30
     31  function Show(): string
    3332  {
    34    
    3533    return 'Dance clubs';
    3634  }
  • trunk/Modules/Dance/Dance.php

    r55 r63  
    11<?php
    22
    3 class ModuleDance extends AppModule
     3class ModuleDance extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
    18   {
    19     $this->System->RegisterPage('tance', 'PageDanceList');
    20     $this->System->RegisterPage('tanec', 'PageDance');
    21     $this->System->RegisterPage('figura', 'PageDanceFigure');
    22     $this->System->RegisterPage('figury', 'PageDanceFigureList');
    23     $this->System->RegisterMenuItem('/tance', 'Tance');
    24     $this->System->RegisterMenuItem('/figury', 'Figury');
    25   } 
     17  function Start(): void
     18  {
     19    $this->System->RegisterPage(['tance'], 'PageDanceList');
     20    $this->System->RegisterPage(['tanec'], 'PageDance');
     21    $this->System->RegisterPage(['figura'], 'PageDanceFigure');
     22    $this->System->RegisterPage(['figury'], 'PageDanceFigureList');
     23    Core::Cast($this->System)->RegisterMenuItem('/tance', 'Tance');
     24    Core::Cast($this->System)->RegisterMenuItem('/figury', 'Figury');
     25  }
    2626}
    2727
     
    3131  {
    3232    parent::__construct($System);
    33     $this->FullTitle = 'Tanec';
    34     $this->ShortTitle = 'Tanec';
    35   }
    36 
    37   function Show()
    38   {
    39     $this->Title = 'Tanec - Tance - '.$this->Title;
     33    $this->Title = 'Tanec';
     34  }
     35
     36  function Show(): string
     37  {
    4038    $Output = '';
    4139    if (count($this->System->PathItems) > 1)
     
    10199        $Output .= '</td>';
    102100      }*/
    103  
     101
    104102    return $Output;
    105103  }
     
    111109  {
    112110    parent::__construct($System);
    113     $this->FullTitle = 'Tance';
    114     $this->ShortTitle = 'Tance';
    115   }
    116 
    117   function Show()
    118   {
    119     $this->Title = 'Tance - '.$this->Title;
     111    $this->Title = 'Tance';
     112  }
     113
     114  function Show(): string
     115  {
    120116    $Output = '<div class="title">Tance</div>';
    121117    $Output .= '<table class="WideTable">';
     
    141137  {
    142138    parent::__construct($System);
    143     $this->FullTitle = 'Taneční figura';
    144     $this->ShortTitle = 'Figura';
    145   }
    146 
    147   function Show()
    148   {
    149     $this->Title = 'Taneční figura - Tance - '.$this->Title;
     139    $this->Title = 'Figura';
     140    $this->Description = 'Taneční figura';
     141  }
     142
     143  function Show(): string
     144  {
    150145    $Output = '';
    151146    if (count($this->System->PathItems) > 1)
     
    196191        $Output .= '</td>';
    197192      }*/
    198  
     193
    199194    return $Output;
    200195  }
     
    206201  {
    207202    parent::__construct($System);
    208     $this->FullTitle = 'Tance';
    209     $this->ShortTitle = 'Tance';
    210   }
    211 
    212   function Show()
    213   {
    214     $this->Title = 'Tance - '.$this->Title;
     203    $this->Title = 'Figury';
     204    $this->Description = 'Taneční figury';
     205  }
     206
     207  function Show(): string
     208  {
    215209    $Output = '<div class="title">Taneční figury</div>';
    216210    $Output .= '<table class="WideTable">';
  • trunk/Modules/Event/Event.php

    r61 r63  
    33include_once(dirname(__FILE__).'/Import/JoeClub.php');
    44
    5 function GetDefaultEventFilter($Table = '')
     5function GetDefaultEventFilter(string $Table = ''): string
    66{
    77  global $Config;
     
    99  if ($Table != '') $Table = $Table.'.';
    1010
    11   return '('.$Table.'Hidden=0) AND ('.$Table.'TimeFrom > "'.TimeToMysqlDateTime(time() - $Config['EventInterval']).'")';
     11  return '('.$Table.'Hidden=0) AND ('.$Table.'TimeFrom > "'.TimeToMysqlDateTime(time() - (int)$Config['EventInterval']).'")';
    1212}
    1313
    14 function ReduceSpaces($Content)
     14function ReduceSpaces(string $Content): string
    1515{
    1616  while (strpos($Content, '  ') !== false) $Content = str_replace('  ', ' ', $Content);
     
    1818}
    1919
    20 function RemoveLines($Content)
     20function RemoveLines(string $Content): string
    2121{
    2222  while (strpos($Content, "\n") !== false) $Content = str_replace("\n", ' ', $Content);
     
    2424}
    2525
    26 function RemoveTabs($Content)
     26function RemoveTabs(string $Content): string
    2727{
    2828  while (strpos($Content, "\t") !== false) $Content = str_replace("\t", '', $Content);
     
    3434  public $Database;
    3535
    36   function Parse($Id = null)
     36  function Parse(int $Id = null): string
    3737  {
    3838    $Output = '';
     
    7373  }
    7474
    75   function Import()
     75  function Import(): string
    7676  {
    7777    $this->AddedCount = 0;
     
    9999  var $Price = 0;
    100100
    101   function AddIfNotExist($TimeInterval = 0, $CompareTime = true, $CompareRemoteId = false)
     101  function AddIfNotExist(int $TimeInterval = 0, bool $CompareTime = true, bool $CompareRemoteId = false): int
    102102  {
    103103    $Where = '(`Description` = "'.$this->Database->real_escape_string($this->Description).'") AND '.
  • trunk/Modules/Event/EventPage.php

    r62 r63  
    11<?php
    22
    3 class ModuleEvent extends AppModule
     3class ModuleEvent extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
    18   {
    19     $this->System->RegisterPage('udalosti', 'PageEventList');
    20     $this->System->RegisterPage(array('udalosti', 'udalost'), 'PageEventItem');
    21     $this->System->RegisterPage(array('udalosti', 'aktualizace'), 'PageEventUpdate');
    22     $this->System->RegisterPage(array('udalosti', 'rss'), 'PageEventRss');
    23     $this->System->RegisterMenuItem('/udalosti', 'Události');
     17  function Start(): void
     18  {
     19    $this->System->RegisterPage(['udalosti'], 'PageEventList');
     20    $this->System->RegisterPage(['udalosti', 'udalost'], 'PageEventItem');
     21    $this->System->RegisterPage(['udalosti', 'aktualizace'], 'PageEventUpdate');
     22    $this->System->RegisterPage(['udalosti', 'rss'], 'PageEventRss');
     23    Core::Cast($this->System)->RegisterMenuItem('/udalosti', 'Události');
    2424  }
    2525}
     
    3030  {
    3131    parent::__construct($System);
    32     $this->FullTitle = 'Taneční události';
    33     $this->ShortTitle = 'Události';
    34   }
    35 
    36   function Show()
     32    $this->Title = 'Události';
     33    $this->Description = 'Taneční události';
     34  }
     35
     36  function Show(): string
    3737  {
    3838    $Filter = new Filter();
     
    4747
    4848    $Output = '';
    49     $this->Title = 'Události - '.$this->Title;
    5049    if (array_key_exists('lvm', $_GET) and ($_GET['lvm'] == 'seznam'))
    5150      $this->RawPage = true;
     
    111110  {
    112111    parent::__construct($System);
    113     $this->FullTitle = 'Aktualizace tanečních událostí';
    114     $this->ShortTitle = 'Aktualizace událostí';
    115   }
    116 
    117   function Show()
     112    $this->Title = 'Aktualizace událostí';
     113    $this->Description = 'Aktualizace tanečních událostí';
     114  }
     115
     116  function Show(): string
    118117  {
    119118    $EventSources = new EventSources();
     
    130129  {
    131130    parent::__construct($System);
    132     $this->FullTitle = 'Taneční událost';
    133     $this->ShortTitle = 'Událost';
    134   }
    135 
    136   function Show()
    137   {
    138     $this->Title = 'Událost - Události - '.$this->Title;
     131    $this->Title = 'Událost';
     132    $this->Description = 'Taneční událost';
     133  }
     134
     135  function Show(): string
     136  {
    139137    $Output = '';
    140138    if (count($this->System->PathItems) > 2)
     
    142140      $id = $this->System->PathItems[2] * 1;
    143141    } else return 'Položka nenalezena';
    144     if ($this->System->IsAdmin())
     142    if (Core::Cast($this->System)->IsAdmin())
    145143    {
    146144      if (array_key_exists('hide', $_GET)) $this->Database->update('Event', 'Id='.$id, array('Hidden' => 1));
     
    154152    {
    155153      $Event = $DbResult->fetch_assoc();
    156       if (($Event['Filter'] == '0') and !$this->System->IsAdmin())
     154      if (($Event['Filter'] == '0') and !Core::Cast($this->System)->IsAdmin())
    157155        return 'Položka nenalezena';
    158156      if ($Event['Link'] != '') $Link = '<a href="'.$Event['Link'].'">Odkaz</a>';
     
    168166        '<tr><th>Zdroj importu</th><td><a href="'.$Event['SourceURL'].'">'.$Event['SourceName'].'</a></td></tr>';
    169167      $Output .= '</table>';
    170       if ($this->System->IsAdmin()) {
     168      if (Core::Cast($this->System)->IsAdmin()) {
    171169        if ($Event['Hidden'] == '1')
    172170          $Output .= '<div>Skrytá položka <a href="?unhide">Zviditelnit</a></div>';
     
    183181  {
    184182    parent::__construct($System);
    185     $this->FullTitle = 'RSS kanál tanečních událostí';
    186     $this->ShortTitle = 'RSS taneční událostí';
    187   }
    188 
    189   function Show()
     183    $this->Title = 'RSS tanečních událostí';
     184    $this->Description = 'RSS kanál tanečních událostí';
     185  }
     186
     187  function Show(): string
    190188  {
    191189    global $Config;
  • trunk/Modules/Event/Import/JoeClub.php

    r55 r63  
    33class EventSourceJoeClub extends EventSource
    44{
    5   function ImportInternal()
     5  function ImportInternal(): string
    66  {
    77    $Output = '';
  • trunk/Modules/Meet/Import/Amblar.php

    r57 r63  
    2626class MeetSourceAmblar extends MeetSource
    2727{
    28   function Import()
     28  function Import(): string
    2929  {
    3030    $Output = parent::Import();
     
    7979  }
    8080
    81   function ImportItem(&$MeetItem)
     81  function ImportItem(MeetItem &$MeetItem): string
    8282  {
    8383    global $HeightTags, $AgeTags, $LevelTags;
     
    9292    {
    9393      $Output .= 'Main block not isolated.</br>';
    94       return;
     94      return $Output;
    9595    }
    9696
  • trunk/Modules/Meet/Import/AstraPraha.php

    r57 r63  
    33class MeetSourceAstraPraha extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Csts.php

    r57 r63  
    33class MeetSourceCsts extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Ella.php

    r57 r63  
    33class MeetSourceElla extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Eso.php

    r57 r63  
    33class MeetSourceEso extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Facebook.php

    r57 r63  
    33class MeetSourceFacebook extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    7     return;
     7    return '';
    88    $Output = parent::Import();
    99    $Content = file_get_contents($this->URL);
  • trunk/Modules/Meet/Import/MajkluvSvet.php

    r57 r63  
    33class MeetSourceMajkluvSvet extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/SalsaDance.php

    r57 r63  
    33class MeetSourceSalsaDance extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Seznamka.php

    r58 r63  
    33class MeetSourceSeznamka extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/TanecniSkola.php

    r60 r63  
    33class MeetSourceTanecniSkola extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Import/Vavruska.php

    r57 r63  
    33class MeetSourceVavruska extends MeetSource
    44{
    5   function Import()
     5  function Import(): string
    66  {
    77    $Output = parent::Import();
  • trunk/Modules/Meet/Meet.php

    r61 r63  
    2020}
    2121
    22 function GetTextBetween(&$Text, $Start, $End)
     22function GetTextBetween(string &$Text, string $Start, string $End): string
    2323{
    2424  $Result = '';
     
    3232}
    3333
    34 function HumanDateTimeToTime($DateTime)
     34function HumanDateTimeToTime(string $DateTime): ?int
    3535{
    3636  if ($DateTime == '') return NULL;
     
    4747}
    4848
    49 function HumanDateToTime($Date)
     49function HumanDateToTime(string $Date): ?int
    5050{
    5151  if ($Date == '') return NULL;
     
    5353}
    5454
    55 function DecodeHtmlEnt($str)
     55function DecodeHtmlEnt(string $str): string
    5656{
    5757  $prefix = '&#';
     
    9090}
    9191
    92 function RemoveHtmlComments($Content)
     92function RemoveHtmlComments(string $Content): string
    9393{
    9494  $Result = '';
     
    103103}
    104104
    105 function is_alpha($Char)
     105function is_alpha(string $Char): bool
    106106{
    107107  return (($Char >= 'a') and ($Char <= 'z')) or (($Char >= 'A') and ($Char <= 'Z'));
    108108}
    109109
    110 function is_white_space($Char)
     110function is_white_space(string $Char): bool
    111111{
    112112  return ($Char == ' ') or ($Char == "\t");
    113113}
    114114
    115 function GetDefaultMeetFilter($Table = '')
     115function GetDefaultMeetFilter(string $Table = ''): string
    116116{
    117117  global $Config;
     
    119119  if ($Table != '') $Table = $Table.'.';
    120120
    121   return '('.$Table.'Hidden=0) AND ('.$Table.'Time > "'.TimeToMysqlDateTime(time() - $Config['MeetInterval']).'")';
    122 }
    123 
    124 function GetNumberBeforeText($Text, $Needle)
     121  return '('.$Table.'Hidden=0) AND ('.$Table.'Time > "'.TimeToMysqlDateTime(time() - (int)$Config['MeetInterval']).'")';
     122}
     123
     124function GetNumberBeforeText(string $Text, string $Needle): string
    125125{
    126126  $Result = '';
     
    148148}
    149149
    150 function GetNumberAfterText($Text, $Needle)
     150function GetNumberAfterText(string $Text, string $Needle): string
    151151{
    152152  $Result = '';
     
    175175}
    176176
    177 function GetAgeFromText($Text)
     177function GetAgeFromText(string $Text): string
    178178{
    179179  $Text = strtolower($Text);
     
    212212}
    213213
    214 function GetHeightFromText($Text)
     214function GetHeightFromText(string $Text): string
    215215{
    216216  $Text = strtolower($Text);
     
    228228}
    229229
    230 function GetWeightFromText($Text)
     230function GetWeightFromText(string $Text): string
    231231{
    232232  $Text = strtolower($Text);
     
    238238}
    239239
    240 function GetAgeHeightWeightFromText($Text)
     240function GetAgeHeightWeightFromText(string $Text): array
    241241{
    242242  $Result = array('', '', '');
     
    261261}
    262262
    263 function GetEmailFromText($Text)
     263function GetEmailFromText(string $Text): string
    264264{
    265265  $Result = '';
     
    302302);
    303303
    304 function GetLocationFromText($Text)
     304function GetLocationFromText(string $Text): string
    305305{
    306306  global $Locations;
     
    315315}
    316316
    317 function GetGenderFromName($Text)
     317function GetGenderFromName(string $Text): string
    318318{
    319319  $Gender = Gender::Male;
     
    334334  public $Database;
    335335
    336   function Parse($Id = null)
     336  function Parse(?int $Id = null): string
    337337  {
    338338    $Output = '';
     
    392392  }
    393393
    394   function Import()
     394  function Import(): string
    395395  {
    396396    return '';
    397397  }
    398398
    399   function DoImport()
     399  function DoImport(): string
    400400  {
    401401    $this->MeetItems = array();
     
    406406    foreach ($this->MeetItems as $MeetItem)
    407407    {
     408      if ($MeetItem->IsSpam()) continue;
    408409      $this->AddedCount += $MeetItem->AddIfNotExist($this->AddTimeInterval, $this->AddCompareTime, $this->AddCompareRemoteId);
    409410    }
     
    434435  var $RemoteId = '';
    435436
    436   function AddIfNotExist($TimeInterval = 0, $CompareTime = true, $CompareRemoteId = false)
     437  function AddIfNotExist(int $TimeInterval = 0, bool $CompareTime = true, bool $CompareRemoteId = false): int
    437438  {
    438439    $Where = '(`Message` = "'.$this->Database->real_escape_string($this->Message).'") AND '.
     
    473474    return $Result;
    474475  }
    475 }
     476
     477  function IsSpam(): bool
     478  {
     479    $Keywords = array('půjčk', 'úvěr');
     480    foreach ($Keywords as $Keyword)
     481    {
     482      if (strpos($this->Message, $Keyword) !== false)
     483      {
     484        return false;
     485      }
     486    }
     487    return true;
     488  }
     489}
  • trunk/Modules/Meet/MeetPage.php

    r62 r63  
    11<?php
    22
    3 class ModuleMeet extends AppModule
     3class ModuleMeet extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
    18   {
    19     $this->System->RegisterPage('seznamka', 'PageMeetList');
    20     $this->System->RegisterPage(array('seznamka', 'inzerat'), 'PageMeetItem');
    21     $this->System->RegisterPage(array('seznamka', 'aktualizace'), 'PageMeetUpdate');
    22     $this->System->RegisterPage(array('seznamka', 'rss'), 'PageMeetRss');
    23     $this->System->RegisterMenuItem('/seznamka', 'Seznamka');
     17  function Start(): void
     18  {
     19    $this->System->RegisterPage(['seznamka'], 'PageMeetList');
     20    $this->System->RegisterPage(['seznamka', 'inzerat'], 'PageMeetItem');
     21    $this->System->RegisterPage(['seznamka', 'aktualizace'], 'PageMeetUpdate');
     22    $this->System->RegisterPage(['seznamka', 'rss'], 'PageMeetRss');
     23    Core::Cast($this->System)->RegisterMenuItem('/seznamka', 'Seznamka');
    2424  }
    2525}
     
    3030  {
    3131    parent::__construct($System);
    32     $this->FullTitle = 'Taneční seznamka';
    33     $this->ShortTitle = 'Seznamka';
    34   }
    35 
    36   function Show()
     32    $this->Title = 'Seznamka';
     33    $this->Description = 'Taneční seznamka';
     34  }
     35
     36  function Show(): string
    3737  {
    3838    global $Config;
     
    5252
    5353    $Output = '';
    54     $this->Title = 'Seznamka - '.$this->Title;
    5554    if (array_key_exists('lvm', $_GET) and ($_GET['lvm'] == 'seznam'))
    5655      $this->RawPage = true;
     
    121120  {
    122121    parent::__construct($System);
    123     $this->FullTitle = 'Aktualizace taneční seznamky';
    124     $this->ShortTitle = 'Aktualizace seznamky';
    125   }
    126 
    127   function Show()
     122    $this->Title = 'Aktualizace seznamky';
     123    $this->Description = 'Aktualizace taneční seznamky';
     124  }
     125
     126  function Show(): string
    128127  {
    129128    $MeetSources = new MeetSources();
     
    140139  {
    141140    parent::__construct($System);
    142     $this->FullTitle = 'Inzerát taneční seznamky';
    143     $this->ShortTitle = 'Inzerát seznamky';
    144   }
    145 
    146   function Show()
    147   {
    148     $this->Title = 'Inzerát - Seznamka - '.$this->Title;
     141    $this->Title = 'Inzerát';
     142    $this->Description = 'Inzerát taneční seznamky';
     143  }
     144
     145  function Show(): string
     146  {
    149147    $Output = '';
    150148    if (count($this->System->PathItems) > 2)
     
    152150      $id = $this->System->PathItems[2] * 1;
    153151    } else return 'Položka nenalezena';
    154     if ($this->System->IsAdmin())
     152    if (Core::Cast($this->System)->IsAdmin())
    155153    {
    156154      if (array_key_exists('hide', $_GET)) $this->Database->update('MeetItem', 'Id='.$id, array('Hidden' => 1));
     
    165163    {
    166164      $MeetItem = $DbResult->fetch_assoc();
    167       if (($MeetItem['Filter'] == '0') and !$this->System->IsAdmin())
     165      if (($MeetItem['Filter'] == '0') and !Core::Cast($this->System)->IsAdmin())
    168166        return 'Položka nenalezena';
    169167      if ($MeetItem['Link'] != '') $Link = '<a href="'.$MeetItem['Link'].'">Odkaz</a>';
     
    183181        '<tr><th>Zdroj importu</th><td><a href="'.$MeetItem['SourceURL'].'">'.$MeetItem['SourceName'].'</a></td></tr>';
    184182      $Output .= '</table>';
    185       if ($this->System->IsAdmin()) {
     183      if (Core::Cast($this->System)->IsAdmin()) {
    186184        if ($MeetItem['Hidden'] == '1')
    187185          $Output .= '<div>Skrytá položka <a href="?unhide">Zviditelnit</a></div>';
     
    198196  {
    199197    parent::__construct($System);
    200     $this->FullTitle = 'RSS kanál taneční seznamky';
    201     $this->ShortTitle = 'RSS inzeráty seznamky';
    202   }
    203 
    204   function Show()
     198    $this->Title = 'RSS inzeráty seznamky';
     199    $this->Description = 'RSS kanál taneční seznamky';
     200  }
     201
     202  function Show(): string
    205203  {
    206204    global $Config;
  • trunk/Modules/Movie/Movie.php

    r56 r63  
    11<?php
    22
    3 class ModuleMovie extends AppModule
     3class ModuleMovie extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
     17  function Start(): void
    1818  {
    19     $this->System->RegisterPage('filmy', 'PageMovieList');
    20     $this->System->RegisterMenuItem('/filmy', 'Filmy');
     19    $this->System->RegisterPage(['filmy'], 'PageMovieList');
     20    Core::Cast($this->System)->RegisterMenuItem('/filmy', 'Filmy');
    2121  }
    2222}
     
    2727  {
    2828    parent::__construct($System);
    29     $this->FullTitle = 'Taneční filmy';
    30     $this->ShortTitle = 'Filmy';
     29    $this->Title = 'Filmy';
     30    $this->Description = 'Taneční filmy';
    3131  }
    3232
    33   function Show()
     33  function Show(): string
    3434  {
    3535    $Output = '';
    36     $this->Title = 'Filmy - '.$this->Title;
    3736    if (array_key_exists('lvm', $_GET) and ($_GET['lvm'] == 'seznam'))
    3837      $this->RawPage = true;
  • trunk/Modules/RSS/RSS.php

    r56 r63  
    11<?php
    22
    3 class ModuleRSS extends AppModule
     3class ModuleRSS extends Module
    44{
    55  var $RSSChannels;
     
    1717  }
    1818
    19   function Start()
     19  function Start(): void
    2020  {
    21     $this->System->RegisterPage('rss', 'PageRSS');
    22     $this->System->RegisterPageHeader('RSS', array($this, 'ShowRSSHeader'));
     21    $this->System->RegisterPage(array('rss'), 'PageRSS');
     22    Core::Cast($this->System)->RegisterPageHeader('RSS', array($this, 'ShowRSSHeader'));
    2323  }
    2424
    25   function RegisterRSS($Channel, $Pos = NULL, $Callback = NULL)
     25  function RegisterRSS(array $Channel, ?int $Pos = NULL, $Callback = NULL): void
    2626  {
    2727    $this->RSSChannels[$Channel['Channel']] = $Channel;
     
    3333  }
    3434
    35   function UnregisterRSS($ChannelName)
     35  function UnregisterRSS(string $ChannelName): void
    3636  {
    3737    unset($this->RSSChannels[$ChannelName]);
     
    3939  }
    4040
    41   function ShowRSSHeader()
     41  function ShowRSSHeader(): string
    4242  {
    4343    $Output = '';
     
    5454class PageRSS extends Page
    5555{
    56   function Show()
     56  function Show(): string
    5757  {
    5858    $this->RawPage = true;
  • trunk/Modules/School/School.php

    r55 r63  
    11<?php
    22
    3 class ModuleSchool extends AppModule
     3class ModuleSchool extends Module
    44{
    55  function __construct($System)
     
    1515  }
    1616
    17   function Start()
     17  function Start(): void
    1818  {
    19     $this->System->RegisterPage('skoly', 'PageSchoolList');
    20     $this->System->RegisterMenuItem('/skoly', 'Školy');
    21   } 
     19    $this->System->RegisterPage(['skoly'], 'PageSchoolList');
     20    Core::Cast($this->System)->RegisterMenuItem('/skoly', 'Školy');
     21  }
    2222}
    2323
     
    2727  {
    2828    parent::__construct($System);
    29     $this->FullTitle = 'Taneční školy';
    30     $this->ShortTitle = 'Školy';
     29    $this->Title = 'Školy';
     30    $this->Description = 'Taneční školy';
    3131  }
    3232
    33   function Show()
     33  function Show(): string
    3434  {
    35     $this->Title = 'Taneční školy - '.$this->Title;
    3635    $Output = '<div class="title">Taneční školy</div>';
    3736    $Output .= '<table class="WideTable">';
Note: See TracChangeset for help on using the changeset viewer.