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
This commit is contained in:
Ingo Schommer 2007-10-25 03:03:14 +00:00
parent 5b7301b2db
commit bfe092ecdd

View File

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