silverstripe-userforms/code/model/formfields/EditableCountryDropdownField.php
Damian Mooyman 5e0b7fdf7a Updated jquery validate plugin (dist files only)
Cleanup of validation script. Refactor into template to allow customisation of validation.
Explicitly set error element to 'span' as per new jquery-validate support
[ref: CWPBUG-110]
2014-05-22 10:34:11 +12:00

28 lines
641 B
PHP

<?php
/**
* A dropdown field which allows the user to select a country
*
* @package userforms
*/
class EditableCountryDropdownField extends EditableFormField {
private static $singular_name = 'Country Dropdown';
private static $plural_name = 'Country Dropdowns';
public function getFormField() {
return new CountryDropdownField($this->Name, $this->Title);
}
public function getValueFromData($data) {
if(isset($data[$this->Name])) {
$source = $this->getFormField()->getSource();
return $source[$data[$this->Name]];
}
}
public function getIcon() {
return USERFORMS_DIR . '/images/editabledropdown.png';
}
}