mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Added fieldLabels() overloading to various DataObject subclasses. Use this method instead of directly calling _t() in getCMSFields(), and use fieldLabel('MyField') to get the label for a specific FormField. This way, we can transparently support formfield scaffolding and re-use the labels for search fields automatically.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@65073 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e2ca30f78a
commit
18912d2cb7
@ -108,6 +108,16 @@ class PageComment extends DataObject {
|
||||
return self::$bbcode;
|
||||
}
|
||||
|
||||
function fieldLabels() {
|
||||
$labels = parent::fieldLabels();
|
||||
$labels['Name'] = _t('PageComment.Name', 'Author Name');
|
||||
$labels['Comment'] = _t('PageComment.Comment', 'Comment');
|
||||
$labels['IsSpam'] = _t('PageComment.IsSpam', 'Spam?');
|
||||
$labels['NeedsModeration'] = _t('PageComment.NeedsModeration', 'Needs Moderation?');
|
||||
|
||||
return $labels;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user