diff --git a/_config.php b/_config.php index 325e9f9..9488d4e 100644 --- a/_config.php +++ b/_config.php @@ -6,9 +6,7 @@ */ Object::add_extension('SiteTree', 'SiteTreeSubsites'); -Object::add_extension('ContentController', 'ControllerSubsites'); Object::add_extension('LeftAndMain', 'LeftAndMainSubsites'); -Object::add_extension('LeftAndMain', 'ControllerSubsites'); Object::add_extension('Group', 'GroupSubsites'); Object::add_extension('File', 'FileSubsites'); diff --git a/code/extensions/ControllerSubsites.php b/code/extensions/ControllerSubsites.php deleted file mode 100644 index 82b3cfd..0000000 --- a/code/extensions/ControllerSubsites.php +++ /dev/null @@ -1,20 +0,0 @@ -Theme) - SSViewer::set_theme($theme); - } - } - - function CurrentSubsite(){ - if($subsite = Subsite::currentSubsite()){ - return $subsite; - } - } -} - -?> \ No newline at end of file diff --git a/code/extensions/SiteTreeSubsites.php b/code/extensions/SiteTreeSubsites.php index dd80e49..e0fbc40 100644 --- a/code/extensions/SiteTreeSubsites.php +++ b/code/extensions/SiteTreeSubsites.php @@ -368,4 +368,13 @@ class SiteTreeSubsites extends DataExtension { if(in_array($this->owner->class, $blacklisted)) return false; } } -} \ No newline at end of file + + /** + * Return the current subsite + * + * @return Subsite|null + */ + public function getCurrentSubsite() { + return Subsite::currentSubsite(); + } +} diff --git a/code/model/Subsite.php b/code/model/Subsite.php index 34317d7..6229214 100644 --- a/code/model/Subsite.php +++ b/code/model/Subsite.php @@ -263,8 +263,6 @@ JS; /** * Gets the subsite currently set in the session. * - * @uses ControllerSubsites->controllerAugmentInit() - * * @return Subsite */ static function currentSubsite() {