2007-07-19 10:40:28 +00:00
|
|
|
<?php
|
|
|
|
|
2008-01-09 04:18:36 +00:00
|
|
|
/**
|
|
|
|
* @package forms
|
|
|
|
* @subpackage fields-relational
|
|
|
|
*/
|
|
|
|
|
2007-07-19 10:40:28 +00:00
|
|
|
/**
|
|
|
|
* A simple extension to dropdown field, pre-configured to list countries.
|
|
|
|
* It will default to the country of the current visiotr.
|
2008-01-09 04:18:36 +00:00
|
|
|
* @package forms
|
|
|
|
* @subpackage fields-relational
|
2007-07-19 10:40:28 +00:00
|
|
|
*/
|
|
|
|
class CountryDropdownField extends DropdownField {
|
2008-10-22 03:45:36 +00:00
|
|
|
function __construct($name, $title, $value = '') {
|
|
|
|
if(!$value) {
|
2008-10-22 04:02:06 +00:00
|
|
|
$value = Geoip::visitor_country();
|
2008-10-22 03:45:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
parent::__construct($name, $title, Geoip::getCountryDropDown(), $value);
|
2007-07-19 10:40:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-22 03:45:36 +00:00
|
|
|
?>
|