mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Set docblock for the setButtonName method, and don't invalidate localisation text.
This commit is contained in:
parent
651d6c1da9
commit
14283d88b8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
/vendor/*
|
/vendor/*
|
||||||
/.idea
|
|
||||||
.sass-cache/*
|
.sass-cache/*
|
||||||
/node_modules/
|
/node_modules/
|
||||||
**/*.js.map
|
**/*.js.map
|
||||||
|
@ -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]
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user