Changeset 63 for trunk/Modules/Event
- Timestamp:
- Aug 3, 2021, 11:20:41 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 nbproject2 Config.php3 1 .settings 4 2 .project 5 3 .buildpath 4 .htaccess
-
- Property svn:ignore
-
trunk/Modules/Event/Event.php
r61 r63 3 3 include_once(dirname(__FILE__).'/Import/JoeClub.php'); 4 4 5 function GetDefaultEventFilter( $Table = '')5 function GetDefaultEventFilter(string $Table = ''): string 6 6 { 7 7 global $Config; … … 9 9 if ($Table != '') $Table = $Table.'.'; 10 10 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']).'")'; 12 12 } 13 13 14 function ReduceSpaces( $Content)14 function ReduceSpaces(string $Content): string 15 15 { 16 16 while (strpos($Content, ' ') !== false) $Content = str_replace(' ', ' ', $Content); … … 18 18 } 19 19 20 function RemoveLines( $Content)20 function RemoveLines(string $Content): string 21 21 { 22 22 while (strpos($Content, "\n") !== false) $Content = str_replace("\n", ' ', $Content); … … 24 24 } 25 25 26 function RemoveTabs( $Content)26 function RemoveTabs(string $Content): string 27 27 { 28 28 while (strpos($Content, "\t") !== false) $Content = str_replace("\t", '', $Content); … … 34 34 public $Database; 35 35 36 function Parse( $Id = null)36 function Parse(int $Id = null): string 37 37 { 38 38 $Output = ''; … … 73 73 } 74 74 75 function Import() 75 function Import(): string 76 76 { 77 77 $this->AddedCount = 0; … … 99 99 var $Price = 0; 100 100 101 function AddIfNotExist( $TimeInterval = 0, $CompareTime = true, $CompareRemoteId = false)101 function AddIfNotExist(int $TimeInterval = 0, bool $CompareTime = true, bool $CompareRemoteId = false): int 102 102 { 103 103 $Where = '(`Description` = "'.$this->Database->real_escape_string($this->Description).'") AND '. -
trunk/Modules/Event/EventPage.php
r62 r63 1 1 <?php 2 2 3 class ModuleEvent extends AppModule3 class ModuleEvent extends Module 4 4 { 5 5 function __construct($System) … … 15 15 } 16 16 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'); 24 24 } 25 25 } … … 30 30 { 31 31 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 37 37 { 38 38 $Filter = new Filter(); … … 47 47 48 48 $Output = ''; 49 $this->Title = 'Události - '.$this->Title;50 49 if (array_key_exists('lvm', $_GET) and ($_GET['lvm'] == 'seznam')) 51 50 $this->RawPage = true; … … 111 110 { 112 111 parent::__construct($System); 113 $this-> FullTitle = 'Aktualizace tanečníchudálostí';114 $this-> ShortTitle = 'Aktualizaceudá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 118 117 { 119 118 $EventSources = new EventSources(); … … 130 129 { 131 130 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 { 139 137 $Output = ''; 140 138 if (count($this->System->PathItems) > 2) … … 142 140 $id = $this->System->PathItems[2] * 1; 143 141 } else return 'Položka nenalezena'; 144 if ( $this->System->IsAdmin())142 if (Core::Cast($this->System)->IsAdmin()) 145 143 { 146 144 if (array_key_exists('hide', $_GET)) $this->Database->update('Event', 'Id='.$id, array('Hidden' => 1)); … … 154 152 { 155 153 $Event = $DbResult->fetch_assoc(); 156 if (($Event['Filter'] == '0') and ! $this->System->IsAdmin())154 if (($Event['Filter'] == '0') and !Core::Cast($this->System)->IsAdmin()) 157 155 return 'Položka nenalezena'; 158 156 if ($Event['Link'] != '') $Link = '<a href="'.$Event['Link'].'">Odkaz</a>'; … … 168 166 '<tr><th>Zdroj importu</th><td><a href="'.$Event['SourceURL'].'">'.$Event['SourceName'].'</a></td></tr>'; 169 167 $Output .= '</table>'; 170 if ( $this->System->IsAdmin()) {168 if (Core::Cast($this->System)->IsAdmin()) { 171 169 if ($Event['Hidden'] == '1') 172 170 $Output .= '<div>Skrytá položka <a href="?unhide">Zviditelnit</a></div>'; … … 183 181 { 184 182 parent::__construct($System); 185 $this-> FullTitle = 'RSS kanáltaneč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 190 188 { 191 189 global $Config; -
trunk/Modules/Event/Import/JoeClub.php
r55 r63 3 3 class EventSourceJoeClub extends EventSource 4 4 { 5 function ImportInternal() 5 function ImportInternal(): string 6 6 { 7 7 $Output = '';
Note:
See TracChangeset
for help on using the changeset viewer.