mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
5d3af16aaf
- moving all phpunit tests into tests/php - moving all extensions from _config.php into config.yml and removing obsolete _config.php - moving GridFieldSubsiteDetailForm_ItemRequest into own file (cherry picked from commit ee02828)
31 lines
598 B
PHP
31 lines
598 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Subsites\Extensions;
|
|
use SilverStripe\Core\Extension;
|
|
use SilverStripe\Subsites\Model\Subsite;
|
|
use SilverStripe\View\SSViewer;
|
|
|
|
/**
|
|
* @package subsites
|
|
*/
|
|
class ControllerSubsites extends Extension
|
|
{
|
|
|
|
public function controllerAugmentInit()
|
|
{
|
|
if ($subsite = Subsite::currentSubsite()) {
|
|
if ($theme = $subsite->Theme) {
|
|
SSViewer::set_theme($theme);
|
|
}
|
|
}
|
|
}
|
|
|
|
public function CurrentSubsite()
|
|
{
|
|
if ($subsite = Subsite::currentSubsite()) {
|
|
return $subsite;
|
|
}
|
|
}
|
|
|
|
}
|