Added missing file
authorMarcel Werk <burntime@woltlab.com>
Tue, 27 May 2014 19:14:19 +0000 (21:14 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 27 May 2014 19:14:19 +0000 (21:14 +0200)
wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php
new file mode 100644 (file)
index 0000000..337c7fc
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+namespace wcf\system\menu\user\profile\content;
+use wcf\data\like\Like;
+use wcf\data\like\ViewableLikeList;
+use wcf\system\SingletonFactory;
+use wcf\system\WCF;
+
+/**
+ * Handles user profile likes content.
+ * 
+ * @author     Alexander Ebert
+ * @copyright  2001-2014 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage system.menu.user.profile.content
+ * @category   Community Framework
+ */
+class LikesUserProfileMenuContent extends SingletonFactory implements IUserProfileMenuContent {
+       /**
+        * @see \wcf\system\menu\user\profile\content\IUserProfileMenuContent::getContent()
+        */
+       public function getContent($userID) {
+               $likeList = new ViewableLikeList();
+               $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", array($userID));
+               $likeList->getConditionBuilder()->add("like_table.likeValue = ?", array(Like::LIKE));
+               $likeList->readObjects();
+               
+               WCF::getTPL()->assign(array(
+                       'likeList' => $likeList,
+                       'userID' => $userID,
+                       'lastLikeTime' => $likeList->getLastLikeTime(),
+               ));
+               
+               return WCF::getTPL()->fetch('userProfileLikes');
+       }
+       
+       /**
+        * @see \wcf\system\menu\user\profile\content\IUserProfileMenuContent::isVisible()
+        */
+       public function isVisible($userID) {
+               return true;
+       }
+}