@@ -7,6 +7,6 @@ |
||
| 7 | 7 | private static $menu_icon = '/mappable/icons/menuicon.png'; |
| 8 | 8 | |
| 9 | 9 | static $has_one = array( |
| 10 | - 'DefaultIcon' => 'Image' |
|
| 10 | + 'DefaultIcon' => 'Image' |
|
| 11 | 11 | ); |
| 12 | 12 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class PointsOfInterestAdmin extends ModelAdmin { |
| 4 | - private static $managed_models = array('PointsOfInterestLayer','PointOfInterest'); |
|
| 4 | + private static $managed_models = array('PointsOfInterestLayer', 'PointOfInterest'); |
|
| 5 | 5 | private static $url_segment = 'poi'; |
| 6 | 6 | private static $menu_title = 'Points of Interest'; |
| 7 | 7 | private static $menu_icon = '/mappable/icons/menuicon.png'; |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | private static $default_sort = 'Name'; |
| 15 | 15 | |
| 16 | 16 | function getCMSFields() { |
| 17 | - $fields = parent::getCMSFields(); |
|
| 18 | - $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name of the item on the map')); |
|
| 17 | + $fields = parent::getCMSFields(); |
|
| 18 | + $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name of the item on the map')); |
|
| 19 | 19 | |
| 20 | 20 | $layers = $this->PointsOfInterestLayer(); |
| 21 | 21 | $ids = array(); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->owner->getMapField()->setGuidePoints($pois); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - return $fields; |
|
| 39 | + return $fields; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /* |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | 'Name' => 'Varchar' |
| 10 | 10 | ); |
| 11 | 11 | |
| 12 | - private static $summary_fields = array('Name','Lat','Lon'); |
|
| 12 | + private static $summary_fields = array('Name', 'Lat', 'Lon'); |
|
| 13 | 13 | |
| 14 | 14 | private static $default_sort = 'Name'; |
| 15 | 15 | |
@@ -4,13 +4,13 @@ |
||
| 4 | 4 | public static $has_one = array('PointsOfInterestLayer' => 'PointsOfInterestLayer'); |
| 5 | 5 | |
| 6 | 6 | function getCMSFields() { |
| 7 | - $fields = parent::getCMSFields(); |
|
| 8 | - $field = DropdownField::create('PointsOfInterestLayerID', 'PointsOfInterestLayer', |
|
| 9 | - PointsOfInterestLayer::get()->map('ID', 'Title')) |
|
| 10 | - ->setEmptyString('-- Select one --'); |
|
| 11 | - $fields->addFieldToTab('Root.Layer', $field); |
|
| 7 | + $fields = parent::getCMSFields(); |
|
| 8 | + $field = DropdownField::create('PointsOfInterestLayerID', 'PointsOfInterestLayer', |
|
| 9 | + PointsOfInterestLayer::get()->map('ID', 'Title')) |
|
| 10 | + ->setEmptyString('-- Select one --'); |
|
| 11 | + $fields->addFieldToTab('Root.Layer', $field); |
|
| 12 | 12 | |
| 13 | - return $fields; |
|
| 13 | + return $fields; |
|
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
@@ -39,10 +39,10 @@ |
||
| 39 | 39 | foreach ($records as $record) { |
| 40 | 40 | $dob = new DataObject(); |
| 41 | 41 | //number_format((float)$number, 2, '.', ''); |
| 42 | - $dob->Latitude = number_format((float)$record['Lat'],3,'.',''); |
|
| 43 | - $dob->Longitude = number_format((float)$record['Lon'],3,'.',''); |
|
| 42 | + $dob->Latitude = number_format((float)$record['Lat'], 3, '.', ''); |
|
| 43 | + $dob->Longitude = number_format((float)$record['Lon'], 3, '.', ''); |
|
| 44 | 44 | $dob->Name = $record['Name']; |
| 45 | - $dob->Distance = number_format((float)$record['distance'],2,'.',''); |
|
| 45 | + $dob->Distance = number_format((float)$record['distance'], 2, '.', ''); |
|
| 46 | 46 | $mapurl = "http://maps.google.com?q={$dob->Latitude},{$dob->Longitude}"; |
| 47 | 47 | $dob->MapURL = $mapurl; |
| 48 | 48 | $dirurl = "http://maps.google.com?saddr={$latitude},{$longitude}&daddr={$dob->Latitude},{$dob->Longitude}"; |
@@ -8,12 +8,12 @@ |
||
| 8 | 8 | |
| 9 | 9 | // given millions of possible POIs an index is handy |
| 10 | 10 | private static $indexes = array( |
| 11 | - 'OpenStreetMapID' => true |
|
| 11 | + 'OpenStreetMapID' => true |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | /* The openstreetmap id is only for scripting purposes */ |
| 16 | - public function updateCMSFields(FieldList $fields) { |
|
| 16 | + public function updateCMSFields(FieldList $fields) { |
|
| 17 | 17 | $fields->removeByName('OpenStreetMapID'); |
| 18 | 18 | } |
| 19 | 19 | } |
@@ -7,6 +7,6 @@ |
||
| 7 | 7 | private static $menu_icon = '/mappable/icons/menuicon.png'; |
| 8 | 8 | |
| 9 | 9 | static $has_one = array( |
| 10 | - 'DefaultIcon' => 'Image' |
|
| 10 | + 'DefaultIcon' => 'Image' |
|
| 11 | 11 | ); |
| 12 | 12 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $names[] = $field->getName(); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - error_log(print_r($names,1)); |
|
| 23 | + error_log(print_r($names, 1)); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | public function testShowGuideMarkers() { |
| 22 | 22 | $layer = $this->objFromFixture('PointsOfInterestLayer', 'BTS'); |
| 23 | - error_log('LAYER: '.$layer->Name); |
|
| 23 | + error_log('LAYER: ' . $layer->Name); |
|
| 24 | 24 | $pois = $layer->PointsOfInterest(); |
| 25 | 25 | $poi = $pois->first(); |
| 26 | 26 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $expected = array( |
| 46 | - array(13.77965803301,100.54461523531), |
|
| 46 | + array(13.77965803301, 100.54461523531), |
|
| 47 | 47 | array(13.744081610619, 100.54311513861), |
| 48 | 48 | array(13.802594511242, 100.55379467004), |
| 49 | 49 | array(13.74054138487, 100.55545772112), |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | $nearPage = $this->objFromFixture('NearestPOIPage', 'StationFinder'); |
| 10 | 10 | $this->logInWithPermission('ADMIN'); |
| 11 | 11 | $nearPage->doPublish(); |
| 12 | - if(Member::currentUser()) { |
|
| 12 | + if (Member::currentUser()) { |
|
| 13 | 13 | Member::currentUser()->logOut(); |
| 14 | 14 | } |
| 15 | 15 | $link = $nearPage->Link(); |
| 16 | - error_log("POI PAGE LINK:".$link); |
|
| 16 | + error_log("POI PAGE LINK:" . $link); |
|
| 17 | 17 | |
| 18 | 18 | $url = $link; |
| 19 | 19 | error_log('TRYING URL ' . $url); |