Changeset 957 for trunk/Modules/News/NewsPage.php
- Timestamp:
- Sep 22, 2023, 11:55:38 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/NewsPage.php
r955 r957 24 24 { 25 25 $Category = $this->GetCategory(); 26 if (array_key_exists('id', $_GET) ) $Id = $_GET['id'] * 1;26 if (array_key_exists('id', $_GET) and is_integer($_GET['id'])) $Id = $_GET['id'] * 1; 27 27 else return $Output .= 'Položka nenalezena.'; 28 28 $DbResult = $this->Database->query('SELECT `News`.*, `User`.`Name` FROM `News` '. … … 67 67 if ($User->CheckPermission('News', 'Insert', 'Group', $Category['Id'])) 68 68 { 69 $this->System->PageHeaders[] = array($this, 'GetPageHeader');69 Core::Cast($this->System)->PageHeaders[] = array($this, 'GetPageHeader'); 70 70 $Output = '<strong>Vložení nové aktuality:</strong><br />'; 71 71 // TODO: Static reference to dynamic category item … … 170 170 if ($Row['Intranet'] == 1) $IntranetChecked = ' checked="1"'; 171 171 else $IntranetChecked = 0; 172 $this->System->PageHeaders[] = array($this, 'GetPageHeader');172 Core::Cast($this->System)->PageHeaders[] = array($this, 'GetPageHeader'); 173 173 $Output .= '<strong>Editace aktuality v kategorii '.$Category['Caption'].':</strong><br />'; 174 174 $Output .= '<form action="?action=update" method="post">'. … … 296 296 { 297 297 $Category = array('Id' => 1); // Default category 298 if (array_key_exists('category', $_GET) ) $Category['Id'] = $_GET['category'] * 1;299 if (array_key_exists('category', $_POST) ) $Category['Id'] = $_POST['category'] * 1;298 if (array_key_exists('category', $_GET) and is_integer($_GET['category'])) $Category['Id'] = $_GET['category'] * 1; 299 if (array_key_exists('category', $_POST) and is_integer($_POST['category'])) $Category['Id'] = $_POST['category'] * 1; 300 300 //if (is_null($Category)) throw new Exception('Kategorie neurčena'); 301 301 else … … 311 311 { 312 312 $Output = ''; 313 if (array_key_exists('action', $_GET)) $Action = $_GET['action'];313 if (array_key_exists('action', $_GET)) $Action = $_GET['action']; 314 314 else $Action = ''; 315 315 if ($Action == 'view') $Output .= $this->ShowView(); … … 361 361 if (substr($Index, 0, 8) == 'category') $Select .= '-'.substr($Index, 8); 362 362 } 363 $Select = $this->System->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1);363 $Select = Core::Cast($this->System)->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1); 364 364 $Output = 'Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>'; 365 365 } else … … 412 412 foreach ($Parts as $Part) 413 413 { 414 $Where .= 'OR (`Category`='.($Part * 1).')';414 if (is_integer($Part)) $Where .= 'OR (`Category`='.($Part * 1).')'; 415 415 } 416 416 $Where = substr($Where, 2); … … 474 474 $Items[] = array( 475 475 'Title' => $Categories[$Row['Category']].' - '.$Row['Title'], 476 'Link' => 'https://'. $this->System->Config['Web']['Host'].'/aktuality/?category='.$Row['Category'],476 'Link' => 'https://'.Core::Cast($this->System)->Config['Web']['Host'].'/aktuality/?category='.$Row['Category'], 477 477 'Description' => $Row['Content'].' ('.$Author.')'.$EnclosuresText, 478 478 'Time' => $Row['UnixTime'], … … 481 481 482 482 $RSS = new RSS(); 483 $RSS->Title = $this->System->Config['Web']['Title'].' - Aktuality';484 $RSS->Link = 'https://'. $this->System->Config['Web']['Host'].'/';485 $RSS->Description = 'Aktuality '. $this->System->Config['Web']['Description'];486 $RSS->WebmasterEmail = $this->System->Config['Web']['AdminEmail'];483 $RSS->Title = Core::Cast($this->System)->Config['Web']['Title'].' - Aktuality'; 484 $RSS->Link = 'https://'.Core::Cast($this->System)->Config['Web']['Host'].'/'; 485 $RSS->Description = 'Aktuality '.Core::Cast($this->System)->Config['Web']['Description']; 486 $RSS->WebmasterEmail = Core::Cast($this->System)->Config['Web']['AdminEmail']; 487 487 $RSS->Items = $Items; 488 488 return $RSS->Generate();
Note:
See TracChangeset
for help on using the changeset viewer.