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:
Sam Minnee 2007-08-16 06:27:32 +00:00
parent f9b575dff4
commit f97fc4ad65
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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() {