From 428c974b9f0c6c5549f726553e63d2f523813e6c Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Mon, 17 Apr 2017 12:08:26 -0500 Subject: [PATCH] BUGFIX: Locator - remove autoGeocode references closes #155 --- code/pages/Locator.php | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/code/pages/Locator.php b/code/pages/Locator.php index 9108731..7e6f831 100644 --- a/code/pages/Locator.php +++ b/code/pages/Locator.php @@ -15,8 +15,6 @@ class Locator extends Page * @var array */ private static $db = array( - 'AutoGeocode' => 'Boolean', - 'ModalWindow' => 'Boolean', 'Unit' => 'Enum("m,km","m")', ); @@ -27,13 +25,6 @@ class Locator extends Page 'Categories' => 'LocationCategory', ); - /** - * @var array - */ - private static $defaults = array( - 'AutoGeocode' => true, - ); - /** * @var string */ @@ -63,9 +54,6 @@ public function getCMSFields() $fields->addFieldsToTab('Root.Settings', array( HeaderField::create('DisplayOptions', 'Display Options', 3), OptionsetField::create('Unit', 'Unit of measure', array('m' => 'Miles', 'km' => 'Kilometers')), - //CheckboxField::create('AutoGeocode', 'Auto Geocode - Automatically filter map results based on user location') - // ->setDescription('Note: if any locations are set as featured, the auto geocode is automatically disabled.'), - //CheckboxField::create('ModalWindow', 'Modal Window - Show Map results in a modal window'), )); // Filter categories @@ -253,30 +241,19 @@ public function init() $featuredInList = ($locations->filter('Featured', true)->count() > 0); $defaultCoords = $this->getAddressSearchCoords() ? $this->getAddressSearchCoords() : ''; - $isChrome = (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE); $featured = $featuredInList ? 'featuredLocations: true' : 'featuredLocations: false'; // map config based on user input in Settings tab - // AutoGeocode or Full Map $limit = Config::inst()->get('Locator_Controller', 'limit'); if ($limit < 1) $limit = -1; - if ($this->data()->AutoGeocode) { - $load = $featuredInList || $defaultCoords != '' || $isChrome - ? 'autoGeocode: false, fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,' - : 'autoGeocode: true, fullMapStart: false,'; - } else { - $load = 'autoGeocode: false, fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,'; - } + $load = 'fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,'; $listTemplatePath = Config::inst()->get('Locator_Controller', 'list_template_path'); $infowindowTemplatePath = Config::inst()->get('Locator_Controller', 'info_window_template_path'); - // in page or modal - $modal = ($this->data()->ModalWindow) ? 'modalWindow: true' : 'modalWindow: false'; - $kilometer = ($this->data()->Unit == 'km') ? "lengthUnit: 'km'" : "lengthUnit: 'm'"; // pass GET variables to xml action @@ -286,7 +263,6 @@ public function init() if (count($vars)) { $url .= '?' . http_build_query($vars); } - $link = Controller::join_links($this->AbsoluteLink(), 'xml.xml', $url); $link = Controller::join_links($this->Link(), 'xml.xml', $url); // containers @@ -302,7 +278,6 @@ public function init() listTemplatePath: '" . $listTemplatePath . "', infowindowTemplatePath: '" . $infowindowTemplatePath . "', originMarker: true, - //" . $modal . ", " . $featured . ", slideMap: false, distanceAlert: -1,