mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
656a9fbb4e
- Make statics private - Use Config::get rather than eval to read private statics - Add a helper function to expose UserDefinedForm_EmailRecipient::$summary_fields (to make them available for i18n).
33 lines
711 B
PHP
Executable File
33 lines
711 B
PHP
Executable File
<?php
|
|
/**
|
|
* EditableEmailField
|
|
*
|
|
* Allow users to define a validating editable email field for a UserDefinedForm
|
|
*
|
|
* @package userforms
|
|
*/
|
|
|
|
class EditableEmailField extends EditableFormField {
|
|
|
|
private static $singular_name = 'Email Field';
|
|
|
|
private static $plural_name = 'Email Fields';
|
|
|
|
public function getFormField() {
|
|
return new EmailField($this->Name, $this->Title);
|
|
}
|
|
|
|
/**
|
|
* Return the validation information related to this field. This is
|
|
* interrupted as a JSON object for validate plugin and used in the
|
|
* PHP.
|
|
*
|
|
* @see http://docs.jquery.com/Plugins/Validation/Methods
|
|
* @return Array
|
|
*/
|
|
public function getValidation() {
|
|
return array(
|
|
'email' => true
|
|
);
|
|
}
|
|
} |