mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Remove LeftAndMain entry from CMSMenu (#3014). Thanks to hamish for the patch!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65214 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bcfa95887f
commit
59d9f2b3d8
@ -163,9 +163,9 @@ class CMSMenu extends Object implements Iterator
|
|||||||
}
|
}
|
||||||
$subClasses = array_unique($subClasses);
|
$subClasses = array_unique($subClasses);
|
||||||
foreach($subClasses as $key => $className) {
|
foreach($subClasses as $key => $className) {
|
||||||
// Test that the class is not abstract and it has a valid menu title
|
// Remove abstract classes and LeftAndMain
|
||||||
$classReflection = new ReflectionClass($className);
|
$classReflection = new ReflectionClass($className);
|
||||||
if(!$classReflection->isInstantiable()) {
|
if(!$classReflection->isInstantiable() || 'LeftAndMain' == $className) {
|
||||||
unset($subClasses[$key]);
|
unset($subClasses[$key]);
|
||||||
} else {
|
} else {
|
||||||
if(singleton($className)->getMenuTitle() == '') {
|
if(singleton($className)->getMenuTitle() == '') {
|
||||||
@ -199,4 +199,4 @@ class CMSMenu extends Object implements Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user