From 0760673568799ecbec3c35e52b011474e6132af5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 22 Sep 2011 17:43:30 +0200 Subject: [PATCH] BUGFIX: Limit the top-right subsites dropdown to the content, files, and security sections. (by sminnee, merged from r102044) --- code/LeftAndMainSubsites.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/code/LeftAndMainSubsites.php b/code/LeftAndMainSubsites.php index f1fb3ff..733c8da 100644 --- a/code/LeftAndMainSubsites.php +++ b/code/LeftAndMainSubsites.php @@ -62,9 +62,16 @@ class LeftAndMainSubsites extends Extension { } } - // Don't show subsite list in reports section, it doesn't have - // any effect there - subsites are filtered through a custom dropdown there, see SubsiteReportWrapper - if($this->owner instanceof ReportAdmin) return false; + // Whitelist for admin sections which are subsite aware. + // For example, don't show subsite list in reports section, it doesn't have + // any effect there - subsites are filtered through a custom dropdown there, see SubsiteReportWrapper. + if(!( + $this->owner instanceof AssetAdmin + || $this->owner instanceof SecurityAdmin + || $this->owner instanceof CMSMain) + ) { + return false; + } $list = $this->Subsites();