From bfe092ecdd1b11f844b8955b222574b9b6f5f303 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 25 Oct 2007 03:03:14 +0000 Subject: [PATCH] ENHANCEMENT Changed page dropdown labels from "Add a page" to "page" (doesn't work out with i18n) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@43844 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index 20c0bbb4..126ae694 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -256,11 +256,17 @@ JS; if($instance->stat('need_permission') && !$this->can( singleton($class)->stat('need_permission') ) ) continue; $addAction = $instance->uninherited('add_action', true); - if(!$addAction) $addAction = "a $class"; + if($addAction) { + // backwards compatibility for actions like "a page" (instead of "page") + $addAction = preg_replace('/^a /','',$addAction); + $addAction = ucfirst($addAction); + } else { + $addAction = $class; + } $result->push(new ArrayData(array( "ClassName" => $class, - "AddAction" => _t('CMSMain.CREATE','Create ',PR_MEDIUM,'"Create " message, followed by an action (e.g. "a contact form")') .$addAction, + "AddAction" => $addAction, ))); } return $result;