1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-11 00:40:09 +00:00

Adding ChatLeaveAction to Routing

This commit is contained in:
Tim Düsterhus 2012-02-18 17:21:57 +01:00
parent 856587648a
commit a7e6bab0cd
2 changed files with 19 additions and 20 deletions

View File

@ -105,23 +105,22 @@ public function readDefaultSmileys() {
public function readParameters() { public function readParameters() {
parent::readParameters(); parent::readParameters();
if ($this->action == 'Message') { switch ($this->action) {
case 'Message':
new ChatMessagePage(); new ChatMessagePage();
exit; exit;
} case 'Log':
else if ($this->action == 'Log') {
//TODO: Initialise LogPage
exit; exit;
} case 'RefreshRoomList':
else if ($this->action == 'RefreshRoomList') {
new ChatRefreshRoomListPage(); new ChatRefreshRoomListPage();
exit; exit;
} case 'Send':
else if ($this->action == 'Send') {
new \wcf\form\ChatForm(); new \wcf\form\ChatForm();
exit; exit;
} case 'Leave':
else if ($this->action == 'Copyright') { new \wcf\action\ChatLeaveAction();
exit;
case 'Copyright':
new ChatCopyrightPage(); new ChatCopyrightPage();
exit; exit;
} }

View File

@ -18,7 +18,7 @@ public function execute($eventObj, $className, $eventName) {
$route = new \wcf\system\request\Route('chatAction'); $route = new \wcf\system\request\Route('chatAction');
$route->setSchema('/{controller}/{action}'); $route->setSchema('/{controller}/{action}');
$route->setParameterOption('controller', null, 'Chat'); $route->setParameterOption('controller', null, 'Chat');
$route->setParameterOption('action', null, '(Message|Log|Send|RefreshRoomList|Copyright)'); $route->setParameterOption('action', null, '(Message|Log|Send|RefreshRoomList|Copyright|Leave)');
$eventObj->addRoute($route); $eventObj->addRoute($route);
} }
} }