MINOR "New <record title>" breadcrumb for GridFieldPopupForm

This commit is contained in:
Ingo Schommer 2012-03-05 18:21:08 +01:00
parent 0117b32fee
commit e2c21cce8e

View File

@ -329,11 +329,16 @@ class GridFieldPopupForm_ItemRequest extends RequestHandler {
if(!($this->popupController instanceof LeftAndMain)) return false;
$items = $this->popupController->Breadcrumbs($unlinked);
if($this->record) {
if($this->record && $this->record->ID) {
$items->push(new ArrayData(array(
'Title' => $this->record->Title,
'Link' => false
)));
} else {
$items->push(new ArrayData(array(
'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->singular_name()),
'Link' => false
)));
}
// TODO Remove once ViewableData->First()/Last() is fixed