Set docblock for the setButtonName method, and don't invalidate localisation text.

This commit is contained in:
Ryan Potter 2019-07-01 10:32:19 +12:00 committed by Robbie Averill
parent 651d6c1da9
commit 14283d88b8
2 changed files with 3 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
/vendor/* /vendor/*
/.idea
.sass-cache/* .sass-cache/*
/node_modules/ /node_modules/
**/*.js.map **/*.js.map

View File

@ -152,7 +152,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
/** /**
* Set the button name * Set the button name
* *
* @param $name * @param $name string
* @return $this * @return $this
*/ */
public function setButtonName($name) public function setButtonName($name)
@ -211,7 +211,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
if (!$this->buttonName) { if (!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()} on this component // provide a default button name, can be changed by calling {@link setButtonName()} on this component
$objectName = $obj->i18n_singular_name(); $objectName = $obj->i18n_singular_name();
$this->buttonName = _t(__CLASS__ . '.ButtonName', 'Add {name}', array('name' => $objectName)); $this->buttonName = _t(__CLASS__ . '.ButtonName', '{name}', ['name' => $objectName]);
} }
$addAction = GridField_FormAction::create( $addAction = GridField_FormAction::create(
@ -219,7 +219,7 @@ class GridFieldAddByDBField implements GridField_ActionProvider, GridField_HTMLP
'add', 'add',
_t( _t(
__CLASS__ . '.Add', __CLASS__ . '.Add',
'{name}', 'Add {name}',
'Add button text', 'Add button text',
['name' => $this->buttonName] ['name' => $this->buttonName]
), ),