2010-12-01 22:59:56 +01:00
|
|
|
<?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() {
|
2012-03-22 21:41:19 +01:00
|
|
|
return new CountryDropdownField($this->Name, $this->Title);
|
2010-12-01 22:59:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getValueFromData($data) {
|
|
|
|
if(isset($data[$this->Name])) {
|
|
|
|
|
|
|
|
return Geoip::countryCode2name($data[$this->Name]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIcon() {
|
|
|
|
return 'userforms/images/editabledropdown.png';
|
|
|
|
}
|
|
|
|
}
|