mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
Restore the EditableCountryDropdownField class
Reverts "MINOR Removed the country dropdown field due to the framework has removed the CountryDropdownField" This reverts commit cbe1dce4ff08476a19e4bdea9d12da4e6cd55ad0. Framework has not, in fact, removed CountryDropdownField. This commit restores the EditableCountryDropdownField class.
This commit is contained in:
parent
4c79a2077a
commit
756f15a4ac
28
code/model/formfields/EditableCountryDropdownField.php
Normal file
28
code/model/formfields/EditableCountryDropdownField.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user