mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Add option to force a room selection
This commit is contained in:
parent
4d208f8893
commit
1c1f695ecd
@ -173,6 +173,10 @@ public function readRoom() {
|
|||||||
|
|
||||||
if ($this->roomID === 0) {
|
if ($this->roomID === 0) {
|
||||||
// no room given
|
// no room given
|
||||||
|
if (CHAT_FORCE_ROOM_SELECT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$room = reset($this->rooms);
|
$room = reset($this->rooms);
|
||||||
if ($room === null) {
|
if ($room === null) {
|
||||||
// no valid room found
|
// no valid room found
|
||||||
@ -184,6 +188,7 @@ public function readRoom() {
|
|||||||
)));
|
)));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($this->rooms[$this->roomID])) throw new exception\IllegalLinkException();
|
if (!isset($this->rooms[$this->roomID])) throw new exception\IllegalLinkException();
|
||||||
$this->room = $this->rooms[$this->roomID];
|
$this->room = $this->rooms[$this->roomID];
|
||||||
|
@ -44,6 +44,8 @@ public function isVisible() {
|
|||||||
* @see \wcf\system\menu\page\PageMenuItemProvider::getLink()
|
* @see \wcf\system\menu\page\PageMenuItemProvider::getLink()
|
||||||
*/
|
*/
|
||||||
public function getLink() {
|
public function getLink() {
|
||||||
|
if (CHAT_FORCE_ROOM_SELECT) return parent::getLink();
|
||||||
|
|
||||||
return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array(
|
return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array(
|
||||||
'application' => 'chat',
|
'application' => 'chat',
|
||||||
'object' => $this->room,
|
'object' => $this->room,
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
<optiontype>boolean</optiontype>
|
<optiontype>boolean</optiontype>
|
||||||
<defaultvalue>1</defaultvalue>
|
<defaultvalue>1</defaultvalue>
|
||||||
</option>
|
</option>
|
||||||
|
<option name="chat_force_room_select">
|
||||||
|
<categoryname>chat.general</categoryname>
|
||||||
|
<optiontype>boolean</optiontype>
|
||||||
|
<defaultvalue>0</defaultvalue>
|
||||||
|
</option>
|
||||||
<option name="chat_reloadtime">
|
<option name="chat_reloadtime">
|
||||||
<categoryname>chat.general</categoryname>
|
<categoryname>chat.general</categoryname>
|
||||||
<optiontype>integer</optiontype>
|
<optiontype>integer</optiontype>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
{include file='documentHeader'}
|
{include file='documentHeader'}
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>{$room} - {lang}chat.general.title{/lang} - {PAGE_TITLE|language}</title>
|
<title>{if $room}{$room} - {/if}{lang}chat.general.title{/lang} - {PAGE_TITLE|language}</title>
|
||||||
|
|
||||||
{include file='headInclude' sandbox=false}
|
{include file='headInclude' sandbox=false}
|
||||||
|
{if $room}
|
||||||
{include file='javascriptInclude' application='chat'}
|
{include file='javascriptInclude' application='chat'}
|
||||||
<script data-relocate="true">
|
<script data-relocate="true">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
@ -74,9 +75,11 @@
|
|||||||
})(jQuery, this);
|
})(jQuery, this);
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
|
{/if}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="tpl{$templateName|ucfirst}">
|
<body id="tpl{$templateName|ucfirst}">
|
||||||
|
{if $room}
|
||||||
{capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture}
|
{capture assign='sidebar'}{include application='chat' file='sidebar'}{/capture}
|
||||||
{include file='header' sandbox=false sidebarOrientation='right'}
|
{include file='header' sandbox=false sidebarOrientation='right'}
|
||||||
|
|
||||||
@ -152,6 +155,37 @@
|
|||||||
*}<li><a id="timsChatMark" class="button timsChatToggle jsTooltip" title="{lang}chat.general.mark{/lang}" data-status="0"><span class="icon icon16 icon-check"></span><span class="invisible">{lang}chat.general.mark{/lang}</span></a></li>
|
*}<li><a id="timsChatMark" class="button timsChatToggle jsTooltip" title="{lang}chat.general.mark{/lang}" data-status="0"><span class="icon icon16 icon-check"></span><span class="invisible">{lang}chat.general.mark{/lang}</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
{else}
|
||||||
|
{include file='header' sandbox=false}
|
||||||
|
<header class="boxHeadline">
|
||||||
|
<h1>{lang}chat.general.title{/lang}</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="container marginTop">
|
||||||
|
<ul class="containerList">
|
||||||
|
{foreach from=$rooms item='room'}
|
||||||
|
{assign var='users' value=$room->getUsers()}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div class="containerHeadline">
|
||||||
|
<h3><a href="{link application='chat' controller='Chat' object=$room}{/link}">{$room}</a> <span class="badge">{#$users|count}</span></h3>
|
||||||
|
<p>{$room->topic|language}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="dataList">
|
||||||
|
{foreach from=$users item='user'}
|
||||||
|
<li><a href="{link controller='User' object=$user}{/link}" class="userLink" data-user-id="{$user->userID}">{$user}</a></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{include file='footer' sandbox=false}
|
{include file='footer' sandbox=false}
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user