mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
fixing code analysis: removing unneeded else statements
This commit is contained in:
parent
abe1ac9fe6
commit
17010f39a3
@ -126,10 +126,10 @@ class GroupSubsites extends DataExtension implements PermissionProvider
|
||||
if ($this->owner->AccessAllSubsites) {
|
||||
$title = _t('GroupSubsites.GlobalGroup', 'global group');
|
||||
return htmlspecialchars($this->owner->Title, ENT_QUOTES) . ' <i>(' . $title . ')</i>';
|
||||
} else {
|
||||
$subsites = Convert::raw2xml(implode(', ', $this->owner->Subsites()->column('Title')));
|
||||
return htmlspecialchars($this->owner->Title) . " <i>($subsites)</i>";
|
||||
}
|
||||
|
||||
$subsites = Convert::raw2xml(implode(', ', $this->owner->Subsites()->column('Title')));
|
||||
return htmlspecialchars($this->owner->Title) . " <i>($subsites)</i>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,11 +170,11 @@ class LeftAndMainSubsites extends Extension
|
||||
if (Subsite::currentSubsiteID() == 0) {
|
||||
// Main site always supports everything.
|
||||
return true;
|
||||
} else {
|
||||
$controller = singleton($controllerName);
|
||||
if ($controller->hasMethod('subsiteCMSShowInMenu') && $controller->subsiteCMSShowInMenu()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$controller = singleton($controllerName);
|
||||
if ($controller->hasMethod('subsiteCMSShowInMenu') && $controller->subsiteCMSShowInMenu()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// It's not necessary to check access permissions here. Framework calls canView on the controller,
|
||||
|
@ -740,20 +740,20 @@ class Subsite extends DataObject
|
||||
{
|
||||
if ($themes = $this->stat('allowed_themes')) {
|
||||
return ArrayLib::valuekey($themes);
|
||||
} else {
|
||||
$themes = [];
|
||||
if (is_dir(THEMES_PATH)) {
|
||||
foreach (scandir(THEMES_PATH) as $theme) {
|
||||
if ($theme[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
$theme = strtok($theme, '_');
|
||||
$themes[$theme] = $theme;
|
||||
}
|
||||
ksort($themes);
|
||||
}
|
||||
return $themes;
|
||||
}
|
||||
|
||||
$themes = [];
|
||||
if (is_dir(THEMES_PATH)) {
|
||||
foreach (scandir(THEMES_PATH) as $theme) {
|
||||
if ($theme[0] == '.') {
|
||||
continue;
|
||||
}
|
||||
$theme = strtok($theme, '_');
|
||||
$themes[$theme] = $theme;
|
||||
}
|
||||
ksort($themes);
|
||||
}
|
||||
return $themes;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -763,9 +763,9 @@ class Subsite extends DataObject
|
||||
{
|
||||
if ($this->getField('Language')) {
|
||||
return $this->getField('Language');
|
||||
} else {
|
||||
return i18n::get_locale();
|
||||
}
|
||||
|
||||
return i18n::get_locale();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user