/** * @return \FieldList */ public function getGeoFields() { $fields = new FieldList(); $fields->push(new HeaderField('AddressHeader', _t('GeoMemberExtension.ADDRESSHEADER', 'Address'))); $fields->push($this->getAddressFields(), 'Address'); $fields->push(new HeaderField('GeoHeader', _t('GeoMemberExtension.GEOHEADER', 'Geo data'))); $latitude = new TextField('Latitude', _t('GeoMemberExtension.LATITUDE', 'Latitude'), $this->owner->Latitude ? $this->owner->Latitude : null); $latitude->setAttribute('placeholder', _t('GeoMemberExtension.LATITUDE', 'Latitude')); $latitude->setTitle(''); $longitude = new TextField('Longitude', _t('GeoMemberExtension.LONGITUDE', 'Longitude'), $this->owner->Longitude ? $this->owner->Longitude : null); $longitude->setAttribute('placeholder', _t('GeoMemberExtension.LONGITUDE', 'Longitude')); $longitude->setTitle(''); $coords = new FieldGroup($latitude, $longitude); $coords->setFieldHolderTemplate('AddressFieldHolder'); $coords->setTitle(_t('GeoMemberExtension.COORDS', 'Coordinates')); $fields->push($coords); $fields->push(new CheckboxField('GeolocateOnLocation', _t('GeoMemberExtension.GEOLOCATEONLOCATION', 'Only show location instead of full address'))); $tz = timezone_identifiers_list(); $timezone = $this->owner->Timezone; if (!$timezone) { $timezone = date_default_timezone_get(); } $fields->push($tzdd = new DropdownField('Timezone', _t('GeoMemberExtension.TIMEZONE', 'Timezone'), array_combine($tz, $tz), $timezone)); $tzdd->setEmptyString(''); return $fields; }