Changeset 887 for trunk/Modules/Meteostation/Meteostation.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meteostation/Meteostation.php
r874 r887 3 3 class PageMeteo extends Page 4 4 { 5 var $FullTitle = 'Stav meteostanice'; 6 var $ShortTitle = 'Meteostanice'; 7 var $ParentClass = 'PagePortal'; 5 function __construct(System $System) 6 { 7 parent::__construct($System); 8 $this->FullTitle = 'Stav meteostanice'; 9 $this->ShortTitle = 'Meteostanice'; 10 $this->ParentClass = 'PagePortal'; 11 } 8 12 9 function Show() 13 function Show(): string 10 14 { 11 15 $Output = 'Stav meteostanice:<br/>'; … … 22 26 var $URL; 23 27 24 function DownloadData() 28 function DownloadData(): void 25 29 { 26 30 $XmlData = simplexml_load_file($this->URL); … … 50 54 } 51 55 52 function CreateImage($FileName) 56 function CreateImage($FileName): void 53 57 { 54 58 $Image = new Image(); … … 63 67 } 64 68 65 function LoadFromDb() 69 function LoadFromDb(): void 66 70 { 67 71 $DbResult = $this->Database->select('Meteostation', '*', 'Id = '.$this->Id); … … 77 81 var $Data; 78 82 79 function __construct( $System)83 function __construct(System $System) 80 84 { 81 85 parent::__construct($System); … … 88 92 } 89 93 90 function DownloadAll() 94 function DownloadAll(): void 91 95 { 92 96 $DbResult = $this->Database->select('MeteoStation', '*'); 93 97 while ($DbRow = $DbResult->fetch_assoc()) 94 98 { 95 $MeteoStation = new MeteoStation( );99 $MeteoStation = new MeteoStation($this->System); 96 100 $MeteoStation->Id = $DbRow['Id']; 97 101 $MeteoStation->LoadFromDb(); … … 102 106 103 107 104 function DoInstall() 108 function DoInstall(): void 105 109 { 106 110 } 107 111 108 function DoUninstall() 112 function DoUninstall(): void 109 113 { 110 114 } 111 115 112 function DoStart() 116 function DoStart(): void 113 117 { 114 $this->System->RegisterPage( 'meteo', 'PageMeteo');118 $this->System->RegisterPage(['meteo'], 'PageMeteo'); 115 119 } 116 120 117 function DoStop() 121 function DoStop(): void 118 122 { 119 123 }
Note:
See TracChangeset
for help on using the changeset viewer.