From 405392f7f706c8a86e050914f4978cd12a48e4b5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 16 May 2009 06:02:57 +0000 Subject: [PATCH] API CHANGE #4036 ajshort: Add the ability to set the keys of ModelAdmin::$managed_models to alternate titles for the tabs. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@76998 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ModelAdmin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index fdeb0c94..c206a77d 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -191,9 +191,9 @@ abstract class ModelAdmin extends LeftAndMain { $models = $this->getManagedModels(); $forms = new DataObjectSet(); - foreach($models as $class) { + foreach($models as $title => $class) { $forms->push(new ArrayData(array ( - 'Title' => singleton($class)->singular_name(), + 'Title' => (is_string($title) ? $title : singleton($modelClass)->singular_name()), 'ClassName' => $class, 'Content' => $this->$class()->getModelSidebar() )));