mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Merge pull request #143 from ss23/0.4-deadcode
Remove dead code - ControllerSubsites
This commit is contained in:
commit
21636d7581
@ -6,9 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Object::add_extension('SiteTree', 'SiteTreeSubsites');
|
Object::add_extension('SiteTree', 'SiteTreeSubsites');
|
||||||
Object::add_extension('ContentController', 'ControllerSubsites');
|
|
||||||
Object::add_extension('LeftAndMain', 'LeftAndMainSubsites');
|
Object::add_extension('LeftAndMain', 'LeftAndMainSubsites');
|
||||||
Object::add_extension('LeftAndMain', 'ControllerSubsites');
|
|
||||||
|
|
||||||
Object::add_extension('Group', 'GroupSubsites');
|
Object::add_extension('Group', 'GroupSubsites');
|
||||||
Object::add_extension('File', 'FileSubsites');
|
Object::add_extension('File', 'FileSubsites');
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package subsites
|
|
||||||
*/
|
|
||||||
class ControllerSubsites extends Extension {
|
|
||||||
function controllerAugmentInit(){
|
|
||||||
if($subsite = Subsite::currentSubsite()){
|
|
||||||
if($theme = $subsite->Theme)
|
|
||||||
SSViewer::set_theme($theme);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function CurrentSubsite(){
|
|
||||||
if($subsite = Subsite::currentSubsite()){
|
|
||||||
return $subsite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@ -368,4 +368,13 @@ class SiteTreeSubsites extends DataExtension {
|
|||||||
if(in_array($this->owner->class, $blacklisted)) return false;
|
if(in_array($this->owner->class, $blacklisted)) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the current subsite
|
||||||
|
*
|
||||||
|
* @return Subsite|null
|
||||||
|
*/
|
||||||
|
public function getCurrentSubsite() {
|
||||||
|
return Subsite::currentSubsite();
|
||||||
|
}
|
||||||
}
|
}
|
@ -263,8 +263,6 @@ JS;
|
|||||||
/**
|
/**
|
||||||
* Gets the subsite currently set in the session.
|
* Gets the subsite currently set in the session.
|
||||||
*
|
*
|
||||||
* @uses ControllerSubsites->controllerAugmentInit()
|
|
||||||
*
|
|
||||||
* @return Subsite
|
* @return Subsite
|
||||||
*/
|
*/
|
||||||
static function currentSubsite() {
|
static function currentSubsite() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user