mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX: Don't throw an error if the themes directory is missing
This commit is contained in:
parent
b5072a2e40
commit
e2220c0b07
@ -113,12 +113,14 @@ class Subsite extends DataObject implements PermissionProvider {
|
||||
return ArrayLib::valuekey($themes);
|
||||
} else {
|
||||
$themes = array();
|
||||
foreach(scandir('../themes/') as $theme) {
|
||||
if($theme[0] == '.') continue;
|
||||
$theme = strtok($theme,'_');
|
||||
$themes[$theme] = $theme;
|
||||
if(is_dir('../themes/')) {
|
||||
foreach(scandir('../themes/') as $theme) {
|
||||
if($theme[0] == '.') continue;
|
||||
$theme = strtok($theme,'_');
|
||||
$themes[$theme] = $theme;
|
||||
}
|
||||
ksort($themes);
|
||||
}
|
||||
ksort($themes);
|
||||
return $themes;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user