source: trunk/Modules/School/School.php

Last change on this file was 63, checked in by chronos, 3 years ago
  • 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.
File size: 1.3 KB
Line 
1<?php
2
3class ModuleSchool extends Module
4{
5 function __construct($System)
6 {
7 parent::__construct($System);
8 $this->Name = 'School';
9 $this->Version = '1.0';
10 $this->Creator = 'Chronos';
11 $this->License = 'GNU/GPL';
12 $this->Description = 'List of dance schools';
13 $this->Dependencies = array();
14 $this->RSSChannels = array();
15 }
16
17 function Start(): void
18 {
19 $this->System->RegisterPage(['skoly'], 'PageSchoolList');
20 Core::Cast($this->System)->RegisterMenuItem('/skoly', 'Školy');
21 }
22}
23
24class PageSchoolList extends Page
25{
26 function __construct($System)
27 {
28 parent::__construct($System);
29 $this->Title = 'Školy';
30 $this->Description = 'Taneční školy';
31 }
32
33 function Show(): string
34 {
35 $Output = '<div class="title">Taneční školy</div>';
36 $Output .= '<table class="WideTable">';
37 $Output .= '<tr><th>Název</th><th>Webové stránky</th><th>Adresa</th>';
38 $Output .= '</tr>';
39 $DbResult = $this->Database->select('School', '*', '1 ORDER BY `Name`');
40 while ($School = $DbResult->fetch_assoc())
41 {
42 $Output .= '<tr>'.
43 '<td>'.$School['Name'].'</td>'.
44 '<td><a href="'.$this->System->Link($School['URL']).'">'.$School['URL'].'</a></td>'.
45 '<td>'.$School['Address'].'</td>'.
46 '</tr>';
47 }
48 $Output .= '</table>';
49
50 return $Output;
51 }
52}
Note: See TracBrowser for help on using the repository browser.