Changeset 815 for trunk/Modules/ShoutBox/ShoutBox.php
- Timestamp:
- Feb 22, 2015, 11:05:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ShoutBox/ShoutBox.php
r805 r815 13 13 $this->Dependencies = array('News'); 14 14 } 15 15 16 16 function Start() 17 17 { 18 18 $this->System->RegisterPage('shoutbox', 'PageShoutBox'); 19 19 $this->System->ModuleManager->Modules['News']->RegisterRSS(array( 20 'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 21 'Permission' => LICENCE_ANONYMOUS)); 20 'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 21 'Permission' => LICENCE_ANONYMOUS)); 22 22 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 23 23 $this->System->ModuleManager->Modules['Search']->RegisterSearch('shoutbox', 24 24 T('Shoutbox'), array('UserName', 'Text'), '`ShoutBox`', $this->System->Link('/shoutbox/?search=')); 25 25 } 26 26 27 27 function ShowBox() 28 28 { … … 37 37 $Output .= '</table></div>'; 38 38 return($Output); 39 } 39 } 40 40 } 41 41 … … 53 53 return($Output); 54 54 } 55 55 56 56 function ShowList() 57 57 { … … 64 64 $SearchQuery = ' AND (`Text` LIKE "%'.$_SESSION['search'].'%")'; 65 65 $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>'; 66 } else $SearchQuery = ''; 66 } else $SearchQuery = ''; 67 67 68 68 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ShoutBox` WHERE 1'.$SearchQuery); … … 71 71 72 72 $Output .= '<h3>'.T('Shoutbox').'</h3>'.$PageList['Output']; 73 if($this->System->User->Licence(LICENCE_USER)) 73 if($this->System->User->Licence(LICENCE_USER)) 74 74 $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>'; 75 75 $Output .= '<div class="shoutbox">'; … … 80 80 return($Output); 81 81 } 82 82 83 83 function ShowAddForm() 84 84 { … … 98 98 } else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL); 99 99 $Output .= $this->ShowList(); 100 return($Output); 100 return($Output); 101 101 } 102 102 103 103 function AddFinish() 104 104 { … … 134 134 $Output .= $this->ShowList(); 135 135 return($Output); 136 } 137 136 } 137 138 138 function ShowRSS() 139 139 {
Note:
See TracChangeset
for help on using the changeset viewer.