Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
benmanu authored Feb 14, 2020
2 parents 38e646a + 5eee71c commit 0cb4cb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SimpleStyleguideController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Core\Manifest\ModuleResourceLoader;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Security\Permission;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\CMS\Controllers\ModelAsController;
Expand All @@ -24,6 +25,7 @@
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Forms\Form;
use SilverStripe\Assets\File;
use SilverStripe\Subsites\Model\Subsite;

/**
* @package simple-styleguide
Expand Down Expand Up @@ -61,11 +63,11 @@ public function index()
}

// If the subsite module is installed then set the theme based on the current subsite
if (class_exists('Subsite') && Subsite::currentSubsite()) {
if (class_exists(Subsite::class) && Subsite::currentSubsite()) {
Config::inst()->update('SSViewer', 'theme', Subsite::currentSubsite()->Theme);
}

$page = SiteTree::get()->first();
$page = Injector::inst()->create(SiteTree::class);
$controller = ModelAsController::controller_for($page);
$controller->init();

Expand Down

0 comments on commit 0cb4cb6

Please sign in to comment.