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:
Ingo Schommer 2008-11-02 20:04:26 +00:00
parent e2ca30f78a
commit 18912d2cb7

View File

@ -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;
}
}