silverstripe-userforms/code/model/formfields/EditableCountryDropdownField.php
Fred Condo 756f15a4ac Restore the EditableCountryDropdownField class
Reverts "MINOR Removed the country dropdown field due to the framework
has removed the CountryDropdownField"

This reverts commit cbe1dce4ff.

Framework has not, in fact, removed CountryDropdownField. This commit
restores the EditableCountryDropdownField class.
2013-04-24 09:57:33 -07:00

28 lines
588 B
PHP

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