Skip to content

Commit

Permalink
BUGFIX #7298 Fixed incorrect message in GridFieldDetailForm from en.y…
Browse files Browse the repository at this point in the history
…ml language file.
  • Loading branch information
Sean Harvey committed May 10, 2012
1 parent 138ba0c commit c1f7e0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions forms/gridfield/GridFieldDetailForm.php
Expand Up @@ -266,13 +266,13 @@ function ItemEditForm() {


$actions = new FieldList(); $actions = new FieldList();
if($this->record->ID !== 0) { if($this->record->ID !== 0) {
$actions->push(FormAction::create('doSave', _t('GridFieldDetailsForm.Save', 'Save')) $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Save', 'Save'))
->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')); ->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept'));
$actions->push(FormAction::create('doDelete', _t('GridFieldDetailsForm.Delete', 'Delete')) $actions->push(FormAction::create('doDelete', _t('GridFieldDetailForm.Delete', 'Delete'))
->addExtraClass('ss-ui-action-destructive')); ->addExtraClass('ss-ui-action-destructive'));
}else{ // adding new record }else{ // adding new record
//Change the Save label to 'Create' //Change the Save label to 'Create'
$actions->push(FormAction::create('doSave', _t('GridFieldDetailsForm.Create', 'Create')) $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Create', 'Create'))
->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'add')); ->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'add'));


// Add a Cancel link which is a button-like link and link back to one level up. // Add a Cancel link which is a button-like link and link back to one level up.
Expand Down Expand Up @@ -347,7 +347,7 @@ function doSave($data, $form) {
// TODO Save this item into the given relationship // TODO Save this item into the given relationship


$message = sprintf( $message = sprintf(
_t('ComplexTableField.SUCCESSEDIT2', 'Saved %s %s'), _t('GridFieldDetailForm.Saved', 'Saved %s %s'),
$this->record->singular_name(), $this->record->singular_name(),
'<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>' '<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>'
); );
Expand All @@ -361,7 +361,7 @@ function doDelete($data, $form) {
try { try {
$toDelete = $this->record; $toDelete = $this->record;
if (!$toDelete->canDelete()) { if (!$toDelete->canDelete()) {
throw new ValidationException(_t('GridFieldDetailsForm.DeletePermissionsFailure',"No delete permissions"),0); throw new ValidationException(_t('GridFieldDetailForm.DeletePermissionsFailure',"No delete permissions"),0);
} }


$toDelete->delete(); $toDelete->delete();
Expand All @@ -371,7 +371,7 @@ function doDelete($data, $form) {
} }


$message = sprintf( $message = sprintf(
_t('ComplexTableField.SUCCESSEDIT2', 'Deleted %s %s'), _t('GridFieldDetailForm.Deleted', 'Deleted %s %s'),
$this->record->singular_name(), $this->record->singular_name(),
'<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>' '<a href="' . $this->Link('edit') . '">"' . htmlspecialchars($this->record->Title, ENT_QUOTES) . '"</a>'
); );
Expand Down
4 changes: 3 additions & 1 deletion lang/en.yml
Expand Up @@ -188,11 +188,13 @@ en:
ResetFilter: Reset ResetFilter: Reset
GridFieldAction_Delete: GridFieldAction_Delete:
DeletePermissionsFailure: 'No delete permissions' DeletePermissionsFailure: 'No delete permissions'
GridFieldDetailsForm: GridFieldDetailForm:
Create: Create Create: Create
Delete: Delete Delete: Delete
DeletePermissionsFailure: 'No delete permissions' DeletePermissionsFailure: 'No delete permissions'
Save: Save Save: Save
Saved: 'Saved %s %s'
Deleted: 'Deleted %s %s'
GridFieldItemEditView.ss: GridFieldItemEditView.ss:
'Go back': 'Go back' 'Go back': 'Go back'
Group: Group:
Expand Down

0 comments on commit c1f7e0e

Please sign in to comment.