Commit | Line | Data |
---|---|---|
320f4a6d MW |
1 | <?php |
2 | namespace wcf\page; | |
157054c9 | 3 | use wcf\data\user\follow\UserFollowingList; |
320f4a6d MW |
4 | use wcf\system\menu\user\UserMenu; |
5 | use wcf\system\WCF; | |
6 | ||
7 | /** | |
8 | * Shows a list with all users the active user is following. | |
9 | * | |
10 | * @author Alexander Ebert | |
c839bd49 | 11 | * @copyright 2001-2018 WoltLab GmbH |
320f4a6d | 12 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 | 13 | * @package WoltLabSuite\Core\Page |
fe4f149a MS |
14 | * |
15 | * @property UserFollowingList $objectList | |
320f4a6d MW |
16 | */ |
17 | class FollowingPage extends MultipleLinkPage { | |
18 | /** | |
0fcfe5f6 | 19 | * @inheritDoc |
320f4a6d MW |
20 | */ |
21 | public $loginRequired = true; | |
22 | ||
23 | /** | |
0fcfe5f6 | 24 | * @inheritDoc |
320f4a6d | 25 | */ |
157054c9 | 26 | public $objectListClassName = UserFollowingList::class; |
320f4a6d MW |
27 | |
28 | /** | |
0fcfe5f6 | 29 | * @inheritDoc |
320f4a6d MW |
30 | */ |
31 | public $sqlOrderBy = 'user_follow.time DESC'; | |
32 | ||
33 | /** | |
0fcfe5f6 | 34 | * @inheritDoc |
320f4a6d MW |
35 | */ |
36 | protected function initObjectList() { | |
37 | parent::initObjectList(); | |
38 | ||
058cbd6a | 39 | $this->objectList->getConditionBuilder()->add("user_follow.userID = ?", [WCF::getUser()->userID]); |
320f4a6d MW |
40 | } |
41 | ||
42 | /** | |
0fcfe5f6 | 43 | * @inheritDoc |
320f4a6d MW |
44 | */ |
45 | public function show() { | |
46 | // set active tab | |
47 | UserMenu::getInstance()->setActiveMenuItem('wcf.user.menu.community.following'); | |
48 | ||
49 | parent::show(); | |
50 | } | |
51 | } |