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-2016 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Menu\User\Profile\Content
16 class RecentActivityUserProfileMenuContent extends SingletonFactory implements IUserProfileMenuContent {
20 public function getContent($userID) {
21 $eventList = new ViewableUserActivityEventList();
22 $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$userID]);
23 $eventList->readObjects();
25 $lastEventTime = $eventList->getLastEventTime();
27 UserActivityEventHandler::validateEvents($eventList);
30 WCF::getTPL()->assign([
31 'eventList' => $eventList,
32 'lastEventTime' => $lastEventTime,
33 'placeholder' => WCF::getLanguage()->get('wcf.user.profile.content.recentActivity.noEntries'),
37 return WCF::getTPL()->fetch('recentActivities');
43 public function isVisible($userID) {