getActiveRequest(); if ($activeRequest && $activeRequest->getRequestObject() instanceof \chat\page\RoomPage) { $this->activeRoomID = $activeRequest->getRequestObject()->room->roomID; } } /** * Sets the active room ID. */ public function setActiveRoomID($activeRoomID) { $this->activeRoomID = $activeRoomID; } /** * Returns the active room ID. * * @return int */ public function getActiveRoomID() { return $this->activeRoomID; } /** * @inheritDoc */ public function hasLink() { return true; } /** * @inheritDoc */ public function getLink() { return \wcf\system\request\LinkHandler::getInstance()->getLink('RoomList', [ 'application' => 'chat' ]); } /** * @inheritDoc */ protected function getObjectList() { return new \chat\data\room\RoomList(); } /** * @inheritDoc */ protected function getTemplate() { $templateName = 'boxRoomList'; if ($this->box->position === 'sidebarLeft' || $this->box->position === 'sidebarRight') { $templateName = 'boxRoomListSidebar'; } return WCF::getTPL()->fetch($templateName, 'chat', [ 'boxRoomList' => $this->objectList , 'boxID' => $this->getBox()->boxID , 'activeRoomID' => $this->activeRoomID ?: 0 ], true); } /** * @inheritDoc */ public function hasContent() { if ($this->box->position === 'sidebarLeft' || $this->box->position === 'sidebarRight') { parent::hasContent(); foreach ($this->objectList as $room) { if ($room->canSee()) return true; } return false; } else { return \chat\data\room\Room::canSeeAny(); } } }