mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Conditional checks on SiteConfig existence in LeftAndMain->init()
This commit is contained in:
parent
a73c9ccb3c
commit
358975ea0c
@ -177,7 +177,7 @@ class LeftAndMain extends Controller {
|
|||||||
$cssFiles = 'sapphire/admin/css/editor.css';
|
$cssFiles = 'sapphire/admin/css/editor.css';
|
||||||
|
|
||||||
// Use theme from the site config
|
// Use theme from the site config
|
||||||
if(($config = SiteConfig::current_site_config()) && $config->Theme) {
|
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
|
||||||
$theme = $config->Theme;
|
$theme = $config->Theme;
|
||||||
} elseif(SSViewer::current_theme()) {
|
} elseif(SSViewer::current_theme()) {
|
||||||
$theme = SSViewer::current_theme();
|
$theme = SSViewer::current_theme();
|
||||||
@ -541,9 +541,11 @@ class LeftAndMain extends Controller {
|
|||||||
// This lets us override the tree title with an extension
|
// This lets us override the tree title with an extension
|
||||||
if($this->hasMethod('getCMSTreeTitle') && $customTreeTitle = $this->getCMSTreeTitle()) {
|
if($this->hasMethod('getCMSTreeTitle') && $customTreeTitle = $this->getCMSTreeTitle()) {
|
||||||
$treeTitle = $customTreeTitle;
|
$treeTitle = $customTreeTitle;
|
||||||
} else {
|
} elseif(class_exists('SiteConfig')) {
|
||||||
$siteConfig = SiteConfig::current_site_config();
|
$siteConfig = SiteConfig::current_site_config();
|
||||||
$treeTitle = $siteConfig->Title;
|
$treeTitle = $siteConfig->Title;
|
||||||
|
} else {
|
||||||
|
$treeTitle = '...';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" data-id=\"0\"class=\"Root nodelete\"><a href=\"$rootLink\"><strong>$treeTitle</strong></a>"
|
$html = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" data-id=\"0\"class=\"Root nodelete\"><a href=\"$rootLink\"><strong>$treeTitle</strong></a>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user