From c194c001cf8a9222b448b7e9f51fa88585d0b5da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Tue, 1 Aug 2017 14:08:35 +0200 Subject: [PATCH] Add showTooltip option for trophies See #2315 --- com.woltlab.wcf/templates/messageSidebar.tpl | 2 +- com.woltlab.wcf/templates/trophyBadge.tpl | 4 ++-- com.woltlab.wcf/templates/trophyImage.tpl | 4 ++-- com.woltlab.wcf/templates/user.tpl | 2 +- com.woltlab.wcf/templates/userProfilePreview.tpl | 2 +- .../install/files/lib/data/trophy/Trophy.class.php | 12 ++++++++---- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/com.woltlab.wcf/templates/messageSidebar.tpl b/com.woltlab.wcf/templates/messageSidebar.tpl index f9ccc323b4..09603ed6d9 100644 --- a/com.woltlab.wcf/templates/messageSidebar.tpl +++ b/com.woltlab.wcf/templates/messageSidebar.tpl @@ -49,7 +49,7 @@
diff --git a/com.woltlab.wcf/templates/trophyBadge.tpl b/com.woltlab.wcf/templates/trophyBadge.tpl index 6e305d1240..884fa4fb8e 100644 --- a/com.woltlab.wcf/templates/trophyBadge.tpl +++ b/com.woltlab.wcf/templates/trophyBadge.tpl @@ -1,6 +1,6 @@ diff --git a/com.woltlab.wcf/templates/trophyImage.tpl b/com.woltlab.wcf/templates/trophyImage.tpl index 38bc00fccb..a5ca927d61 100644 --- a/com.woltlab.wcf/templates/trophyImage.tpl +++ b/com.woltlab.wcf/templates/trophyImage.tpl @@ -1,7 +1,7 @@ diff --git a/com.woltlab.wcf/templates/user.tpl b/com.woltlab.wcf/templates/user.tpl index 4d412e6896..b8e45fb4b3 100644 --- a/com.woltlab.wcf/templates/user.tpl +++ b/com.woltlab.wcf/templates/user.tpl @@ -176,7 +176,7 @@
diff --git a/com.woltlab.wcf/templates/userProfilePreview.tpl b/com.woltlab.wcf/templates/userProfilePreview.tpl index a115d09221..c71da8221f 100644 --- a/com.woltlab.wcf/templates/userProfilePreview.tpl +++ b/com.woltlab.wcf/templates/userProfilePreview.tpl @@ -15,7 +15,7 @@
diff --git a/wcfsetup/install/files/lib/data/trophy/Trophy.class.php b/wcfsetup/install/files/lib/data/trophy/Trophy.class.php index 27a6281f79..ac86bbf9da 100644 --- a/wcfsetup/install/files/lib/data/trophy/Trophy.class.php +++ b/wcfsetup/install/files/lib/data/trophy/Trophy.class.php @@ -72,14 +72,16 @@ class Trophy extends DatabaseObject implements ITitledLinkObject, IRouteControll * Renders a trophy. * * @param integer $size + * @param boolean $showTooltip * @return string */ - public function renderTrophy($size = self::DEFAULT_SIZE) { + public function renderTrophy($size = self::DEFAULT_SIZE, $showTooltip = false) { switch ($this->type) { case self::TYPE_IMAGE: { return WCF::getTPL()->fetch('trophyImage', 'wcf', [ 'size' => $size, - 'trophy' => $this + 'trophy' => $this, + 'showTooltip' => $showTooltip ], true); break; } @@ -87,14 +89,16 @@ class Trophy extends DatabaseObject implements ITitledLinkObject, IRouteControll case self::TYPE_BADGE: return WCF::getTPL()->fetch('trophyBadge', 'wcf', [ 'size' => $size, - 'trophy' => $this + 'trophy' => $this, + 'showTooltip' => $showTooltip ], true); break; default: $parameters = [ 'renderedTemplate' => null, - 'size' => $size + 'size' => $size, + 'showTooltip' => $showTooltip ]; EventHandler::getInstance()->fireAction($this, 'renderTrophy', $parameters); -- 2.20.1