diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index e2ce651..307c681 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -173,16 +173,21 @@ public function readRoom() { if ($this->roomID === 0) { // no room given - $room = reset($this->rooms); - if ($room === null) { - // no valid room found - throw new exception\IllegalLinkException(); + if (CHAT_FORCE_ROOM_SELECT) { + return; + } + else { + $room = reset($this->rooms); + if ($room === null) { + // no valid room found + throw new exception\IllegalLinkException(); + } + // redirect to first chat-room + \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( + 'object' => $room + ))); + exit; } - // redirect to first chat-room - \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( - 'object' => $room - ))); - exit; } if (!isset($this->rooms[$this->roomID])) throw new exception\IllegalLinkException(); diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 78c6f3e..bd3bcd3 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -44,6 +44,8 @@ public function isVisible() { * @see \wcf\system\menu\page\PageMenuItemProvider::getLink() */ public function getLink() { + if (CHAT_FORCE_ROOM_SELECT) return parent::getLink(); + return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( 'application' => 'chat', 'object' => $this->room, diff --git a/option.xml b/option.xml index 8dbebeb..347536f 100644 --- a/option.xml +++ b/option.xml @@ -18,6 +18,11 @@ boolean 1 + + chat.general + boolean + 0 + chat.general integer diff --git a/template/chat.tpl b/template/chat.tpl index 6038aa0..cfec043 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -1,157 +1,191 @@ {include file='documentHeader'} - {$room} - {lang}chat.general.title{/lang} - {PAGE_TITLE|language} + {if $room}{$room} - {/if}{lang}chat.general.title{/lang} - {PAGE_TITLE|language} {include file='headInclude' sandbox=false} - {include file='javascriptInclude' application='chat'} - + })(jQuery, this); + //]]> + + {/if} - {capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture} - {include file='header' sandbox=false sidebarOrientation='right'} + {if $room} + {capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture} + {include file='header' sandbox=false sidebarOrientation='right'} + + + + {$room->topic|language} + + + + + + + + + + + + + + + + + {lang}chat.general.noJs{/lang} + + + + + + + + + {lang}chat.general.message{/lang} + + + + Lorem ipsum dolor sit amet. + + + + + - - - {$room->topic|language} - - - - - - - - - - - - - - - - - {lang}chat.general.noJs{/lang} - - - - - - - - - {lang}chat.general.message{/lang} - - - - Lorem ipsum dolor sit amet. - - - - - - - {if MODULE_SMILEY && $smileyCategories|count} - {include file='messageFormSmilies' wysiwygSelector=''} - {/if} - - - {lang}chat.general.controls{/lang} - - {lang}chat.general.scroll{/lang}{* - - *}{lang}chat.general.fullscreen{/lang}{* - - *}{lang}chat.general.notify{/lang}{* - - *}{lang}chat.general.smilies{/lang}{* - - *}{if MODULE_ATTACHMENT && $__wcf->session->getPermission('user.chat.canUploadAttachment')}{* - *} - - - {lang}wcf.attachment.attachments{/lang} - - - - {lang}wcf.global.button.upload{/lang} + {if MODULE_SMILEY && $smileyCategories|count} + {include file='messageFormSmilies' wysiwygSelector=''} + {/if} + + + {lang}chat.general.controls{/lang} + + {lang}chat.general.scroll{/lang}{* + + *}{lang}chat.general.fullscreen{/lang}{* + + *}{lang}chat.general.notify{/lang}{* + + *}{lang}chat.general.smilies{/lang}{* + + *}{if MODULE_ATTACHMENT && $__wcf->session->getPermission('user.chat.canUploadAttachment')}{* + *} + + + {lang}wcf.attachment.attachments{/lang} + + + + {lang}wcf.global.button.upload{/lang} + + + {/if}{* + + *}{lang}chat.general.clear{/lang}{* + + *}{lang}chat.general.mark{/lang} + + + {else} + {include file='header' sandbox=false} + + {lang}chat.general.title{/lang} + + + + + {foreach from=$rooms item='room'} + {assign var='users' value=$room->getUsers()} + + + + + + {$room} {#$users|count} + {$room->topic|language} + + + + {foreach from=$users item='user'} + {$user} + {/foreach} + + + - - {/if}{* - - *}{lang}chat.general.clear{/lang}{* - - *}{lang}chat.general.mark{/lang} - - + {/foreach} + + + {/if} {include file='footer' sandbox=false}
{lang}chat.general.noJs{/lang}
{$room->topic|language}