getRoom($objectID); if ($room === null) { throw new \InvalidArgumentException('Invalid room ID given'); } return LinkHandler::getInstance()->getControllerLink( LogPage::class, [ 'object' => $room, ] ); } /** * @inheritDoc */ public function isVisible($objectID = null): bool { if (!WCF::getUser()->userID) { return false; } if ($objectID === null) { throw new \InvalidArgumentException('Invalid room ID given'); } $room = RoomCache::getInstance()->getRoom($objectID); if ($room === null) { throw new \InvalidArgumentException('Invalid room ID given'); } return $room->canSee() && $room->canSeeLog(); } /** * @inheritDoc */ public function getOnlineLocation(Page $page, UserOnline $user): string { if ($user->pageObjectID === null) { return ''; } $room = RoomCache::getInstance()->getRoom($user->pageObjectID); if ($room === null) { return ''; } if (!$room->canSeeLog()) { return ''; } return WCF::getLanguage()->getDynamicVariable( 'wcf.page.onlineLocation.' . $page->identifier, [ 'room' => $room, ] ); } }