BUG: Set the summary fields of UserDefinedForm_EmailRecipient dynamically via config system

You can't dynamically expose statics; that's a no-op in 3.1
This commit is contained in:
Fred Condo 2013-04-04 12:12:37 -07:00
parent ed46cfdb08
commit f0f9ea702c

View File

@ -74,11 +74,16 @@ class UserDefinedForm extends Page {
$editor->setRows(3);
$label->addExtraClass('left');
UserDefinedForm_EmailRecipient::set_summary_fields(array(
'EmailAddress' => _t('UserDefinedForm.EMAILADDRESS', 'Email'),
'EmailSubject' => _t('UserDefinedForm.EMAILSUBJECT', 'Subject'),
'EmailFrom' => _t('UserDefinedForm.EMAILFROM', 'From')
));
// Set the summary fields of UserDefinedForm_EmailRecipient dynamically via config system
Config::inst()->update(
'UserDefinedForm_EmailRecipient',
'summary_fields',
array(
'EmailAddress' => _t('UserDefinedForm.EMAILADDRESS', 'Email'),
'EmailSubject' => _t('UserDefinedForm.EMAILSUBJECT', 'Subject'),
'EmailFrom' => _t('UserDefinedForm.EMAILFROM', 'From'),
)
);
// who do we email on submission
$emailRecipients = new GridField("EmailRecipients", _t('UserDefinedForm.EMAILRECIPIENTS', 'Email Recipients'), $this->EmailRecipients(), GridFieldConfig_RecordEditor::create(10));
@ -1034,15 +1039,6 @@ class UserDefinedForm_EmailRecipient extends DataObject {
private static $summary_fields = array();
/**
* Expose the summary_fields static
*
* @param array $fields
*/
public static function set_summary_fields($fields) {
self::$summary_fields = $fields;
}
/**
* @return FieldList
*/