Improved extensibility of UserOnlineListBoxController
authorMarcel Werk <burntime@woltlab.com>
Thu, 18 Aug 2016 16:26:13 +0000 (18:26 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 18 Aug 2016 16:26:18 +0000 (18:26 +0200)
wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php

index d5093c86d418edd7cd767df61ae497cf40009118..c183a5e86e3db1d291531c639e1854de6513166c 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\box;
 use wcf\data\user\online\UsersOnlineList;
+use wcf\system\event\EventHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -12,6 +13,8 @@ use wcf\system\WCF;
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\Box
  * @since      3.0
+ *        
+ * @property   UsersOnlineList         $objectList
  */
 class UserOnlineListBoxController extends AbstractDatabaseObjectListBoxController {
        /**
@@ -36,12 +39,20 @@ class UserOnlineListBoxController extends AbstractDatabaseObjectListBoxControlle
         * @inheritDoc
         */
        protected function getObjectList() {
-               $objectList = new UsersOnlineList();
-               $objectList->readStats();
-               $objectList->checkRecord();
-               $objectList->getConditionBuilder()->add('session.userID IS NOT NULL');
+               return new UsersOnlineList();
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       protected function readObjects() {
+               EventHandler::getInstance()->fireAction($this, 'readObjects');
+               
+               $this->objectList->readStats();
+               if ($this->showRecord) $this->objectList->checkRecord();
+               $this->objectList->getConditionBuilder()->add('session.userID IS NOT NULL');
                
-               return $objectList;
+               $this->objectList->readObjects();
        }
        
        /**