Source of file NZRegionDropdownField.php
Size: 1,063 Bytes - Last Modified: 2021-12-24T06:19:10+00:00
/var/www/docs.ssmods.com/process/src/code/NZRegionDropdownField.php
123456789101112131415161718192021222324252627282930313233 | <?php class NZRegionDropdownField extends DropdownField { private static $regions = array('Northland' => 'Northland', 'Auckland' => 'Auckland', 'Waikato' => 'Waikato', 'Bay of Plenty' => 'Bay of Plenty', 'Gisborne' => 'Gisborne', 'Hawke’s Bay' => 'Hawke’s Bay', 'Taranaki' => 'Taranaki', 'Manawatu-Wanganui' => 'Manawatu-Wanganui', 'Wellington' => 'Wellington', 'Nelson' => 'Nelson', 'Marlborough' => 'Marlborough', 'West Coast' => 'West Coast', 'Canterbury' => 'Canterbury', 'Otago' => 'Otago', 'Southland' => 'Southland', 'Chatham Islands' => 'Chatham Islands', 'International' => 'International', ); // = Config::inst()->get('NZRegionDropdownField', 'Regions'); public function __construct($name, $title = null, $source = null, $value = '', $form = null, $emptyString = null) { // Get the regions from config.yml parent::__construct($name, ($title === null) ? $name : $title, $value, $form); if (!$source) { $this->setSource(self::$regions); } } } |