BUGFIX Ensure "Add [modelClass]" is shown instead of using the field name of the GridField, partially reverts 16982ba17c which broke breadcrumbs in SecurityAdmin

This commit is contained in:
Sean Harvey 2012-05-28 11:43:47 +12:00
parent 497aa9bfa9
commit 74d444cf2f
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
if($record && !$record->canView()) return Security::permissionFailure($this); if($record && !$record->canView()) return Security::permissionFailure($this);
$memberList = GridField::create( $memberList = GridField::create(
'Member', 'Members',
false, false,
DataList::create('Member'), DataList::create('Member'),
$memberListConfig = GridFieldConfig_RecordEditor::create() $memberListConfig = GridFieldConfig_RecordEditor::create()
@ -77,7 +77,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator()); $memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator());
$groupList = GridField::create( $groupList = GridField::create(
'Group', 'Groups',
false, false,
DataList::create('Group'), DataList::create('Group'),
GridFieldConfig_RecordEditor::create() GridFieldConfig_RecordEditor::create()

View File

@ -15,7 +15,7 @@ class GridFieldAddNewButton implements GridField_HTMLProvider {
public function getHTMLFragments($gridField) { public function getHTMLFragments($gridField) {
$data = new ArrayData(array( $data = new ArrayData(array(
'NewLink' => Controller::join_links($gridField->Link('item'), 'new'), 'NewLink' => Controller::join_links($gridField->Link('item'), 'new'),
'ButtonName' => _t('GridField.Add', 'Add {name}', array('name' => $gridField->name)), 'ButtonName' => _t('GridField.Add', 'Add {name}', array('name' => $gridField->getModelClass())),
)); ));
return array( return array(
$this->targetFragment => $data->renderWith('GridFieldAddNewbutton'), $this->targetFragment => $data->renderWith('GridFieldAddNewbutton'),