@@ -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'; |
@@ -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) { |
|
| 17 | - $osmid = $fields->removeByName('OpenStreetMapID'); |
|
| 16 | + public function updateCMSFields(FieldList $fields) { |
|
| 17 | + $osmid = $fields->removeByName('OpenStreetMapID'); |
|
| 18 | 18 | } |
| 19 | 19 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | ); |
| 7 | 7 | |
| 8 | 8 | /* The openstreetmap id is only for scripting purposes */ |
| 9 | - public function updateCMSFields(FieldList $fields) { |
|
| 10 | - //$osmid = $fields->removeByName('OpenStreetMapID'); |
|
| 9 | + public function updateCMSFields(FieldList $fields) { |
|
| 10 | + //$osmid = $fields->removeByName('OpenStreetMapID'); |
|
| 11 | 11 | } |
| 12 | 12 | } |
@@ -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 | |
@@ -8,21 +8,21 @@ |
||
| 8 | 8 | private static $many_many = array('PointsOfInterest' => 'PointOfInterest'); |
| 9 | 9 | |
| 10 | 10 | static $has_one = array( |
| 11 | - 'DefaultIcon' => 'Image' |
|
| 11 | + 'DefaultIcon' => 'Image' |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | function getCMSFields() { |
| 15 | - $fields = parent::getCMSFields(); |
|
| 16 | - $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name of this layer')); |
|
| 17 | - $fields->addFieldToTab('Root.Main', |
|
| 18 | - $uf = new UploadField('DefaultIcon', |
|
| 19 | - _t('PointsOfInterest.ICON', |
|
| 20 | - 'Default Icon')) |
|
| 15 | + $fields = parent::getCMSFields(); |
|
| 16 | + $fields->addFieldToTab('Root.Main', new TextField('Name', 'Name of this layer')); |
|
| 17 | + $fields->addFieldToTab('Root.Main', |
|
| 18 | + $uf = new UploadField('DefaultIcon', |
|
| 19 | + _t('PointsOfInterest.ICON', |
|
| 20 | + 'Default Icon')) |
|
| 21 | 21 | ); |
| 22 | 22 | $fields->addFieldToTab('Root.Main', new CheckboxField('ShowGuideMarkers', |
| 23 | - 'Show grey guide markers of others points in this layer')); |
|
| 24 | - $uf->setFolderName('mapicons'); |
|
| 23 | + 'Show grey guide markers of others points in this layer')); |
|
| 24 | + $uf->setFolderName('mapicons'); |
|
| 25 | 25 | |
| 26 | - return $fields; |
|
| 26 | + return $fields; |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -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}"; |