Created
December 25, 2016 16:17
-
-
Save ImEmil/af4bb092fa49b6c9bc2fbf3fcd7dafa7 to your computer and use it in GitHub Desktop.
BlackWolf Habbo Housekeeping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace controllers; | |
class DashboardController extends AppController | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
public function beforeAction() | |
{ | |
/* | |
* [Optional] Check for required permissions before anything | |
*/ | |
$this->hasPermission('hk.dashboard'); | |
} | |
public function index() | |
{ | |
/** | |
* Assign users count | |
*/ | |
$this->view->assign('users', $this->Dashboard->getUsersCount()); | |
/** | |
* Assign catalog_items count | |
*/ | |
$this->view->assign('catalogItems', $this->Dashboard->getCatalogItemsCount()); | |
/** | |
* Assign furniture count | |
*/ | |
$this->view->assign('furniture', $this->Dashboard->getFurnitureCount()); | |
/** | |
* Assign ban count | |
*/ | |
$this->view->assign('bannedUsers', $this->Dashboard->getBannedUsersCount()); | |
/** | |
* Assign loaded_rooms count | |
*/ | |
$this->view->assign('roomsLoaded', $this->Dashboard->getServerStatus('loaded_rooms')); | |
/** | |
* Assign users_online count | |
*/ | |
$this->view->assign('usersOnline', $this->Dashboard->getServerStatus('users_online')); | |
/** | |
* Render the dashboard template | |
*/ | |
$this->view->render('dashboard'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment