Changeset 956
- Timestamp:
- Sep 4, 2023, 11:30:03 PM (16 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r954 r956 1 1 <?php 2 2 3 $Revision = 95 4; // Subversion revision3 $Revision = 956; // Subversion revision 4 4 $DatabaseRevision = 953; // SQL structure revision 5 $ReleaseTime = strtotime('2023-0 8-11');5 $ReleaseTime = strtotime('2023-09-04'); -
trunk/Modules/Notify/Notify.php
r925 r956 40 40 ), 41 41 )); 42 $this->System->RegisterPage(['notify'], 'PageNotify'); 42 43 $this->System->RegisterCommandLine('notify', 'Perform notifications processing.', array($this, 'RunCheck')); 43 44 ModuleRSS::Cast($this->System->GetModule('RSS'))->RegisterRSS(array('Title' => 'Notify log', 44 'Channel' => 'notifylog', 'Callback' => array($this, 'ShowLogRSS'),45 'Permission' => array('Module' => 'Notify', 'Operation' => 'RSS')));45 'Channel' => 'notifylog', 'Callback' => array($this, 'ShowLogRSS'), 46 'Permission' => array('Module' => 'Notify', 'Operation' => 'RSS'))); 46 47 } 47 48 … … 124 125 125 126 return $Output; 126 } 127 } 127 128 128 129 function RunCheck(array $Parameters): void … … 147 148 $this->FormatHTML = false; 148 149 Header('Content-Type: text/xml'); 149 $Count = 100; 150 151 $Output = ''; 150 $Count = 20; 151 152 152 $Items = array(); 153 $sql = 'SELECT Title,Content, UNIX_TIMESTAMP(`Time`) AS `Time` FROM `NotifyLog`'.153 $sql = 'SELECT `Id`,`Title`,`Content`, UNIX_TIMESTAMP(`Time`) AS `Time` FROM `NotifyLog`'. 154 154 ' ORDER BY `Time` DESC LIMIT '.$Count; 155 155 $DbResult = $this->System->Database->query($sql); … … 159 159 ( 160 160 'Title' => $Line['Title'], 161 'Link' => 'https://'.$this->System->Config['Web']['Host'].$this->System->Link('/ Notify.php'),161 'Link' => 'https://'.$this->System->Config['Web']['Host'].$this->System->Link('/notify/?i='.$Line['Id']), 162 162 'Description' => $Line['Content'], 163 163 'Time' => $Line['Time'], … … 184 184 } 185 185 186 class PageNotify extends Page 187 { 188 function __construct(System $System) 189 { 190 parent::__construct($System); 191 $this->Title = 'Upozornění'; 192 $this->Description = 'Upozornění'; 193 $this->ParentClass = 'PagePortal'; 194 } 195 196 function Show(): string 197 { 198 if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Notify', 'Show')) 199 return 'Nemáte oprávnění'; 200 201 $Output = '<style> 202 table { border-collapse: collapse; } 203 table, th, td { border: 1px solid gray; } 204 td { padding: 5px; } 205 </style>'; 206 if (!array_key_exists('i', $_GET)) return 'Položka nenalezena'; 207 $Id = $_GET['i'] * 1; 208 $DbResult = $this->Database->select('NotifyLog', 'Title,Content, UNIX_TIMESTAMP(`Time`) AS `Time`', 'Id='.$Id); 209 if ($DbResult->num_rows > 0) 210 { 211 $DbRow = $DbResult->fetch_assoc(); 212 $Output .= '<h3>'.$DbRow['Title'].'</h3>'. 213 '<div>Čas: '.TimeToMysqlDateTime($DbRow['Time']).'</div>'. 214 '<p>'.$DbRow['Content'].'</p>'; 215 } else $Output = 'Položka nenalezena'; 216 return $Output; 217 } 218 } 219 186 220 class NotifyCategory extends Model 187 221 {
Note:
See TracChangeset
for help on using the changeset viewer.