2 namespace wcf\system\menu\user\profile\content;
3 use wcf\data\user\activity\event\ViewableUserActivityEventList;
4 use wcf\system\user\activity\event\UserActivityEventHandler;
5 use wcf\system\SingletonFactory;
9 * Handles user activity events.
11 * @author Alexander Ebert
12 * @copyright 2001-2015 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf
15 * @subpackage system.menu.user.profile.content
16 * @category Community Framework
18 class RecentActivityUserProfileMenuContent extends SingletonFactory implements IUserProfileMenuContent {
20 * @see \wcf\system\menu\user\profile\content\IUserProfileMenuContent::getContent()
22 public function getContent($userID) {
23 $eventList = new ViewableUserActivityEventList();
24 $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$userID]);
25 $eventList->readObjects();
27 $lastEventTime = $eventList->getLastEventTime();
29 UserActivityEventHandler::validateEvents($eventList);
32 WCF::getTPL()->assign([
33 'eventList' => $eventList,
34 'lastEventTime' => $lastEventTime,
35 'placeholder' => WCF::getLanguage()->get('wcf.user.profile.content.recentActivity.noEntries'),
39 return WCF::getTPL()->fetch('recentActivities');
43 * @see \wcf\system\menu\user\profile\content\IUserProfileMenuContent::isVisible()
45 public function isVisible($userID) {