Changeset 815 for trunk/Modules/News/News.php
- Timestamp:
- Feb 22, 2015, 11:05:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r765 r815 6 6 { 7 7 var $RSSChannels; 8 8 9 9 function __construct($System) 10 10 { … … 17 17 $this->Dependencies = array(); 18 18 } 19 19 20 20 function Start() 21 21 { 22 22 $this->System->RegisterPage('news', 'PageNews'); 23 23 $this->System->RegisterPage('rss', 'PageRSS'); 24 $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news', 24 $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news', 25 25 'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS)); 26 26 } 27 27 28 28 function ShowBox() 29 29 { … … 37 37 return($Output); 38 38 } 39 39 40 40 function RegisterRSS($Channel, $Pos = NULL, $Callback = NULL) 41 41 { … … 47 47 } 48 48 } 49 49 50 50 function ShowRSSHeader() 51 51 { 52 $Output = ''; 52 $Output = ''; 53 53 foreach($this->RSSChannels as $Channel) 54 54 { … … 56 56 $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'. 57 57 $this->System->Link('/rss/?channel='.$Channel['Channel']).'" type="application/rss+xml" />'; 58 } 58 } 59 59 return($Output); 60 60 } … … 74 74 return($Output); 75 75 } 76 76 77 77 function ShowList() 78 78 { … … 82 82 83 83 $Output = '<h3>'.T('News').'</h3>'.$PageList['Output']; 84 if($this->System->User->Licence(LICENCE_ADMIN)) 84 if($this->System->User->Licence(LICENCE_ADMIN)) 85 85 $Output .= ' <a href="?a=add">'.T('Add').'</a>'; 86 86 $Output .= '<div class="shoutbox">'; … … 90 90 $Output .= '<div><strong>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</strong><br/> '.$Line['Text'].' ('.$Line['User'].')</div>'; 91 91 $Output .= '</div>'.$PageList['Output']; 92 return($Output); 92 return($Output); 93 93 } 94 94 95 95 function ShowAddForm() 96 96 { … … 124 124 return($Output); 125 125 } 126 126 127 127 function ShowRSS() 128 128 { … … 149 149 'Items' => $Items, 150 150 )); 151 return($Output); 151 return($Output); 152 152 } 153 153 }
Note:
See TracChangeset
for help on using the changeset viewer.