Commit | Line | Data |
---|---|---|
ea42130c MW |
1 | <?php |
2 | namespace wcf\system\box; | |
3 | use wcf\system\cache\builder\UserStatsCacheBuilder; | |
4 | use wcf\system\WCF; | |
5 | ||
6 | /** | |
7 | * Box that shows global statistics. | |
8 | * | |
9 | * @author Marcel Werk | |
cea1798f | 10 | * @copyright 2001-2017 WoltLab GmbH |
ea42130c | 11 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 MW |
12 | * @package WoltLabSuite\Core\System\Box |
13 | * @since 3.0 | |
ea42130c MW |
14 | */ |
15 | class StatisticsBoxController extends AbstractBoxController { | |
16 | /** | |
17 | * @inheritDoc | |
18 | */ | |
c21b2424 | 19 | protected static $supportedPositions = ['sidebarLeft', 'sidebarRight']; |
ea42130c | 20 | |
ea42130c MW |
21 | /** |
22 | * @inheritDoc | |
23 | */ | |
24 | protected function loadContent() { | |
1510f9ce AE |
25 | if (WCF::getSession()->getPermission('user.profile.canViewStatistics')) { |
26 | $this->content = WCF::getTPL()->fetch('boxStatistics', 'wcf', ['statistics' => UserStatsCacheBuilder::getInstance()->getData()], true); | |
27 | } | |
ea42130c MW |
28 | } |
29 | } |