From cfd7147769872aea5600fd0a569103e6a54c2229 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 31 Oct 2016 11:23:55 +0100 Subject: [PATCH] box templates should always run in sandbox mode --- .../system/box/AbstractCommentListBoxController.class.php | 2 +- .../lib/system/box/ArticleCategoriesBoxController.class.php | 2 +- .../files/lib/system/box/ArticleListBoxController.class.php | 2 +- .../lib/system/box/FollowingsOnlineBoxController.class.php | 2 +- .../lib/system/box/PageCommentListBoxController.class.php | 2 +- .../lib/system/box/PaidSubscriptionsBoxController.class.php | 6 +----- .../system/box/RecentActivityListBoxController.class.php | 4 ++-- .../lib/system/box/RegisterButtonBoxController.class.php | 2 +- .../files/lib/system/box/SignedInAsBoxController.class.php | 2 +- .../lib/system/box/StaffOnlineListBoxController.class.php | 2 +- .../files/lib/system/box/StatisticsBoxController.class.php | 6 +----- .../files/lib/system/box/TagCloudBoxController.class.php | 6 ++---- .../lib/system/box/TodaysBirthdaysBoxController.class.php | 5 ++--- .../files/lib/system/box/UserListBoxController.class.php | 2 +- .../lib/system/box/UserOnlineListBoxController.class.php | 2 +- .../lib/system/box/WhoWasOnlineBoxController.class.php | 2 +- 16 files changed, 19 insertions(+), 30 deletions(-) diff --git a/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php index 676a99c908..665edfb258 100644 --- a/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/AbstractCommentListBoxController.class.php @@ -93,6 +93,6 @@ abstract class AbstractCommentListBoxController extends AbstractDatabaseObjectLi return WCF::getTPL()->fetch('boxSidebarCommentList', 'wcf', [ 'boxCommentList' => $this->objectList, 'boxSortField' => $this->sortField - ]); + ], true); } } diff --git a/wcfsetup/install/files/lib/system/box/ArticleCategoriesBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleCategoriesBoxController.class.php index 0ad64d53db..41c9b3fc50 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleCategoriesBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleCategoriesBoxController.class.php @@ -41,7 +41,7 @@ class ArticleCategoriesBoxController extends AbstractBoxController { } } - $this->content = WCF::getTPL()->fetch('boxArticleCategories', 'wcf', ['categoryList' => $categoryList, 'activeCategory' => $activeCategory]); + $this->content = WCF::getTPL()->fetch('boxArticleCategories', 'wcf', ['categoryList' => $categoryList, 'activeCategory' => $activeCategory], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php b/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php index e4e73362cb..b85c3cb572 100644 --- a/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/ArticleListBoxController.class.php @@ -79,6 +79,6 @@ class ArticleListBoxController extends AbstractDatabaseObjectListBoxController { 'boxArticleList' => $this->objectList, 'boxSortField' => $this->sortField, 'boxPosition' => $this->box->position - ]); + ], true); } } diff --git a/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php b/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php index 7b3e77a284..44cf164d9c 100644 --- a/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php @@ -38,7 +38,7 @@ class FollowingsOnlineBoxController extends AbstractDatabaseObjectListBoxControl * @inheritDoc */ protected function getTemplate() { - return WCF::getTPL()->fetch('boxFollowingsOnline', 'wcf', ['usersOnlineList' => $this->objectList]); + return WCF::getTPL()->fetch('boxFollowingsOnline', 'wcf', ['usersOnlineList' => $this->objectList], true); } /** diff --git a/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php b/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php index 25dc055faa..5060045104 100644 --- a/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php @@ -40,7 +40,7 @@ class PageCommentListBoxController extends AbstractDatabaseObjectListBoxControll 'lastCommentTime' => $this->objectList->getMinCommentTime(), 'pageID' => RequestHandler::getInstance()->getActiveRequest()->getPageID(), 'likeData' => (MODULE_LIKE && $this->objectList) ? $this->objectList->getLikeData() : [] - ]); + ], true); } /** diff --git a/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php b/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php index 7f41eddd60..99172b5a27 100644 --- a/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/PaidSubscriptionsBoxController.class.php @@ -72,11 +72,7 @@ class PaidSubscriptionsBoxController extends AbstractBoxController { $templateName = 'boxPaidSubscriptionsSidebar'; } - WCF::getTPL()->assign([ - 'subscriptions' => $subscriptions - ]); - - $this->content = WCF::getTPL()->fetch($templateName); + $this->content = WCF::getTPL()->fetch($templateName, 'wcf', ['subscriptions' => $subscriptions], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php b/wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php index 8110333206..c0708a77cc 100644 --- a/wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php @@ -97,12 +97,12 @@ class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxContr 'eventList' => $this->objectList, 'lastEventTime' => $this->objectList->getLastEventTime(), 'filteredByFollowedUsers' => $this->filteredByFollowedUsers - ]); + ], true); } else { return WCF::getTPL()->fetch('boxRecentActivitySidebar', 'wcf', [ 'eventList' => $this->objectList - ]); + ], true); } } diff --git a/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php b/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php index 140dadf146..2517fffaac 100644 --- a/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/RegisterButtonBoxController.class.php @@ -22,7 +22,7 @@ class RegisterButtonBoxController extends AbstractBoxController { */ protected function loadContent() { if (!WCF::getUser()->userID && !REGISTER_DISABLED) { - $this->content = WCF::getTPL()->fetch('boxRegisterButton'); + $this->content = WCF::getTPL()->fetch('boxRegisterButton', 'wcf', [], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php b/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php index 8c58868372..8d5ede5efb 100644 --- a/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/SignedInAsBoxController.class.php @@ -22,7 +22,7 @@ class SignedInAsBoxController extends AbstractBoxController { */ protected function loadContent() { if (WCF::getUser()->userID) { - $this->content = WCF::getTPL()->fetch('boxSignedInAs'); + $this->content = WCF::getTPL()->fetch('boxSignedInAs', 'wcf', [], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php b/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php index 023bcc94af..c0c22edeb7 100644 --- a/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/StaffOnlineListBoxController.class.php @@ -32,7 +32,7 @@ class StaffOnlineListBoxController extends AbstractDatabaseObjectListBoxControll * @inheritDoc */ protected function getTemplate() { - return WCF::getTPL()->fetch('boxStaffOnline', 'wcf', ['usersOnlineList' => $this->objectList]); + return WCF::getTPL()->fetch('boxStaffOnline', 'wcf', ['usersOnlineList' => $this->objectList], true); } /** diff --git a/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php b/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php index 0ef13cb6cf..b8857a3d12 100644 --- a/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php @@ -22,10 +22,6 @@ class StatisticsBoxController extends AbstractBoxController { * @inheritDoc */ protected function loadContent() { - WCF::getTPL()->assign([ - 'statistics' => UserStatsCacheBuilder::getInstance()->getData() - ]); - - $this->content = WCF::getTPL()->fetch('boxStatistics'); + $this->content = WCF::getTPL()->fetch('boxStatistics', 'wcf', ['statistics' => UserStatsCacheBuilder::getInstance()->getData()], true); } } diff --git a/wcfsetup/install/files/lib/system/box/TagCloudBoxController.class.php b/wcfsetup/install/files/lib/system/box/TagCloudBoxController.class.php index 7f4f207889..23a43308ee 100644 --- a/wcfsetup/install/files/lib/system/box/TagCloudBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/TagCloudBoxController.class.php @@ -50,12 +50,10 @@ class TagCloudBoxController extends AbstractBoxController { $tags = $tagCloud->getTags(); if (!empty($tags)) { - WCF::getTPL()->assign([ + $this->content = WCF::getTPL()->fetch('tagCloudBox', 'wcf', [ 'tags' => $tags, 'taggableObjectType' => $this->objectType - ]); - - $this->content = WCF::getTPL()->fetch('tagCloudBox'); + ], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php b/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php index f053286fa9..e4a2652a3e 100644 --- a/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/TodaysBirthdaysBoxController.class.php @@ -62,10 +62,9 @@ class TodaysBirthdaysBoxController extends AbstractBoxController { } if (!empty($visibleUserProfiles)) { - WCF::getTPL()->assign([ + $this->content = WCF::getTPL()->fetch($this->templateName, 'wcf', [ 'birthdayUserProfiles' => $visibleUserProfiles - ]); - $this->content = WCF::getTPL()->fetch($this->templateName); + ], true); } } } diff --git a/wcfsetup/install/files/lib/system/box/UserListBoxController.class.php b/wcfsetup/install/files/lib/system/box/UserListBoxController.class.php index fb653206cb..293be03ca2 100644 --- a/wcfsetup/install/files/lib/system/box/UserListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/UserListBoxController.class.php @@ -115,7 +115,7 @@ class UserListBoxController extends AbstractDatabaseObjectListBoxController { return WCF::getTPL()->fetch('boxUserList', 'wcf', [ 'boxUsers' => $this->userIDs !== null ? $userProfiles : $this->objectList->getObjects(), 'boxSortField' => $this->box->sortField - ]); + ], true); } /** diff --git a/wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php b/wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php index c183a5e86e..c0752571b6 100644 --- a/wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php @@ -64,7 +64,7 @@ class UserOnlineListBoxController extends AbstractDatabaseObjectListBoxControlle $templateName = 'boxUsersOnline'; } - return WCF::getTPL()->fetch($templateName, 'wcf', ['usersOnlineList' => $this->objectList, '__showRecord' => $this->showRecord]); + return WCF::getTPL()->fetch($templateName, 'wcf', ['usersOnlineList' => $this->objectList, '__showRecord' => $this->showRecord], true); } /** diff --git a/wcfsetup/install/files/lib/system/box/WhoWasOnlineBoxController.class.php b/wcfsetup/install/files/lib/system/box/WhoWasOnlineBoxController.class.php index e6b7502388..d1b57b0476 100644 --- a/wcfsetup/install/files/lib/system/box/WhoWasOnlineBoxController.class.php +++ b/wcfsetup/install/files/lib/system/box/WhoWasOnlineBoxController.class.php @@ -58,7 +58,7 @@ class WhoWasOnlineBoxController extends AbstractDatabaseObjectListBoxController 'whoWasOnlineList' => $this->users, 'boxPosition' => $this->box->position, 'whoWasOnlineTimeFormat' => DateUtil::TIME_FORMAT - ]); + ], true); } /** -- 2.20.1