Hiding recent activity dashboard box if there is no content at all
authorAlexander Ebert <ebert@woltlab.com>
Fri, 27 Jun 2014 23:22:05 +0000 (01:22 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 27 Jun 2014 23:22:05 +0000 (01:22 +0200)
wcfsetup/install/files/lib/system/dashboard/box/RecentActivityDashboardBox.class.php

index 2c3b60748c32e61300bd648c733deab1754b55e9..d72eb33da50c8aa73a7e3a8f5379a798de64ccd3 100644 (file)
@@ -70,13 +70,17 @@ class RecentActivityDashboardBox extends AbstractContentDashboardBox {
         * @see \wcf\system\dashboard\box\AbstractContentDashboardBox::render()
         */
        protected function render() {
-               WCF::getTPL()->assign(array(
-                       'canFilterByFollowedUsers' => $this->canFilterByFollowedUsers,
-                       'eventList' => $this->eventList,
-                       'lastEventTime' => $this->lastEventTime,
-                       'filteredByFollowedUsers' => $this->filteredByFollowedUsers
-               ));
+               if (count($this->eventList) || $this->filteredByFollowedUsers) {
+                       WCF::getTPL()->assign(array(
+                               'canFilterByFollowedUsers' => $this->canFilterByFollowedUsers,
+                               'eventList' => $this->eventList,
+                               'lastEventTime' => $this->lastEventTime,
+                               'filteredByFollowedUsers' => $this->filteredByFollowedUsers
+                       ));
+                       
+                       return WCF::getTPL()->fetch('dashboardBoxRecentActivity');
+               }
                
-               return WCF::getTPL()->fetch('dashboardBoxRecentActivity');
+               return '';
        }
 }