diff --git a/file/lib/data/room/RoomAction.class.php b/file/lib/data/room/RoomAction.class.php index 17cb765..edf6bbb 100644 --- a/file/lib/data/room/RoomAction.class.php +++ b/file/lib/data/room/RoomAction.class.php @@ -323,27 +323,28 @@ public function removeDeadUsers() { /** * Validates permissions. */ - public function validateGetDashboardRoomList() { + public function validateGetBoxRoomList() { if (!MODULE_CHAT) throw new \wcf\system\exception\IllegalLinkException(); } /** * Returns dashboard roomlist. */ - public function getDashboardRoomList() { + public function getBoxRoomList() { $rooms = RoomCache::getInstance()->getRooms(); foreach ($rooms as $key => $room) { if (!$room->canEnter()) unset($rooms[$key]); } + $this->readBoolean('showEmptyRooms', true); \wcf\system\WCF::getTPL()->assign(array( 'rooms' => $rooms, - 'onlyList' => true + 'showEmptyRooms' => $this->parameters['showEmptyRooms'] )); return array( - 'template' => \wcf\system\WCF::getTPL()->fetch('dashboardBoxOnlineList', 'chat') + 'template' => \wcf\system\WCF::getTPL()->fetch('boxRoomList', 'chat') ); } } diff --git a/template/boxRoomList.tpl b/template/boxRoomList.tpl new file mode 100644 index 0000000..31c6e1e --- /dev/null +++ b/template/boxRoomList.tpl @@ -0,0 +1,22 @@ +{foreach from=$rooms item='room'} + {assign var='users' value=$room->getUsers()} + + {if $showEmptyRooms || $users|count > 0} +
  • +
    +
    +
    +

    {$room} {#$users|count}

    +

    {$room->topic|language}

    +
    + +
      + {foreach from=$users item='user'} +
    • {$user}
    • + {/foreach} +
    +
    +
    +
  • + {/if} +{/foreach} diff --git a/template/chat.tpl b/template/chat.tpl index cfec043..1698b2e 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -161,29 +161,33 @@

    {lang}chat.general.title{/lang}

    -
    +
    +
    {/if} diff --git a/template/dashboardBoxOnlineList.tpl b/template/dashboardBoxOnlineList.tpl index f3f1ada..bdd02a6 100644 --- a/template/dashboardBoxOnlineList.tpl +++ b/template/dashboardBoxOnlineList.tpl @@ -1,62 +1,39 @@ -{capture assign='roomList'} - {foreach from=$rooms item='room'} - {assign var='users' value=$room->getUsers()} - - {if $users|count > 0} -
  • -
    -
    -
    -

    {$room} {#$users|count}

    -

    {$room->topic|language}

    -
    - -
      - {foreach from=$users item='user'} -
    • {$user}
    • - {/foreach} -
    -
    -
    -
  • - {/if} - {/foreach} -{/capture} -{if $onlyList|isset} - {@$roomList} -{else} -