Skip to content

Commit

Permalink
Adapt SubsiteXHRController to LeftAndMain API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Garion Herman committed Jun 4, 2017
1 parent a4a1ab6 commit 21a8c56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/controller/SubsiteXHRController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
*/
class SubsiteXHRController extends LeftAndMain
{
/**
* @todo Temporary addition due to new requirements for LeftAndMain
* descendants in SS4. Consider alternate implementation.
*/
private static $url_segment = 'subsite_xhr';

/**
* Relax the access permissions, so anyone who has access to any CMS subsite can access this controller.
Expand Down
6 changes: 6 additions & 0 deletions code/extensions/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
use SilverStripe\Security\Security;
use SilverStripe\Subsites\Controller\SubsiteXHRController;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements;
Expand Down Expand Up @@ -170,6 +171,11 @@ public function alternateMenuDisplayCheck($controllerName)
return false;
}

// Don't display SubsiteXHRController
if ($controllerName == SubsiteXHRController::class) {
return false;
}

// Check subsite support.
if (Subsite::currentSubsiteID() == 0) {
// Main site always supports everything.
Expand Down

0 comments on commit 21a8c56

Please sign in to comment.