mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added ability for SiteTree extensions to define contentcontrollerInit() or modelascontrollerInit(), to add extra behaviour necessary for some modules (in particular, subsites)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40224 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f9b575dff4
commit
f97fc4ad65
@ -80,7 +80,7 @@ class ContentController extends Controller {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
|
||||
|
||||
// If we've accessed the homepage as /home/, then we should redirect to /.
|
||||
if($this->dataRecord && RootURLController::should_be_on_root($this->dataRecord) && !$this->urlParams['Action'] && !$_POST && !$_FILES) {
|
||||
$getVars = $_GET;
|
||||
@ -91,7 +91,8 @@ class ContentController extends Controller {
|
||||
die();
|
||||
}
|
||||
|
||||
Versioned::choose_site_stage();
|
||||
singleton('SiteTree')->extend('contentcontrollerInit', $this);
|
||||
|
||||
Director::set_site_mode('site');
|
||||
|
||||
// Check permissions
|
||||
|
@ -13,7 +13,7 @@ class ModelAsController extends Controller implements NestedController {
|
||||
}
|
||||
|
||||
public function init() {
|
||||
Versioned::choose_site_stage();
|
||||
singleton('SiteTree')->extend('modelascontrollerInit', $this);
|
||||
}
|
||||
|
||||
public function getNestedController() {
|
||||
|
Loading…
Reference in New Issue
Block a user