mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Adapt SubsiteXHRController to LeftAndMain API changes.
This commit is contained in:
parent
a4a1ab6a78
commit
21a8c56217
@ -13,6 +13,11 @@ use SilverStripe\Subsites\Model\Subsite;
|
|||||||
*/
|
*/
|
||||||
class SubsiteXHRController extends LeftAndMain
|
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.
|
* Relax the access permissions, so anyone who has access to any CMS subsite can access this controller.
|
||||||
|
@ -15,6 +15,7 @@ use SilverStripe\ORM\DataObject;
|
|||||||
use SilverStripe\Security\Member;
|
use SilverStripe\Security\Member;
|
||||||
use SilverStripe\Security\Permission;
|
use SilverStripe\Security\Permission;
|
||||||
use SilverStripe\Security\Security;
|
use SilverStripe\Security\Security;
|
||||||
|
use SilverStripe\Subsites\Controller\SubsiteXHRController;
|
||||||
use SilverStripe\Subsites\Model\Subsite;
|
use SilverStripe\Subsites\Model\Subsite;
|
||||||
use SilverStripe\View\ArrayData;
|
use SilverStripe\View\ArrayData;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
@ -170,6 +171,11 @@ class LeftAndMainSubsites extends Extension
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't display SubsiteXHRController
|
||||||
|
if ($controllerName == SubsiteXHRController::class) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Check subsite support.
|
// Check subsite support.
|
||||||
if (Subsite::currentSubsiteID() == 0) {
|
if (Subsite::currentSubsiteID() == 0) {
|
||||||
// Main site always supports everything.
|
// Main site always supports everything.
|
||||||
|
Loading…
Reference in New Issue
Block a user