BUGFIX: Don't throw an error if the themes directory is missing

This commit is contained in:
Sam Minnee 2009-02-17 01:08:57 +00:00
parent b5072a2e40
commit e2220c0b07

View File

@ -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;
}
}