@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * |
213 | 213 | * @param string $googleMapKey the googleMapKey |
214 | 214 | * |
215 | - * @return void |
|
215 | + * @return MapAPI |
|
216 | 216 | */ |
217 | 217 | |
218 | 218 | public function setKey($googleMapKey) { |
@@ -220,6 +220,9 @@ discard block |
||
220 | 220 | return $this; |
221 | 221 | } |
222 | 222 | |
223 | + /** |
|
224 | + * @param boolean $inclusion |
|
225 | + */ |
|
223 | 226 | public function setIncludeDownloadJavascript($inclusion) { |
224 | 227 | self::$include_download_javascript = $inclusion; |
225 | 228 | return $this; |
@@ -253,13 +256,9 @@ discard block |
||
253 | 256 | * Set the useClusterer parameter (optimization to display a lot of marker) |
254 | 257 | * |
255 | 258 | * @param boolean $useClusterer use cluster or not |
256 | - * @param string $clusterIcon the cluster icon |
|
257 | - * @param int $maxVisibleMarkers max visible markers |
|
258 | 259 | * @param int $gridSize grid size |
259 | - * @param int $minMarkersPerClusterer minMarkersPerClusterer |
|
260 | - * @param int $maxLinesPerInfoBox maxLinesPerInfoBox |
|
261 | 260 | * |
262 | - * @return void |
|
261 | + * @return MapAPI |
|
263 | 262 | */ |
264 | 263 | |
265 | 264 | public function setClusterer($useClusterer, $gridSize=50, $maxZoom=17, |
@@ -276,7 +275,7 @@ discard block |
||
276 | 275 | * |
277 | 276 | * @param string $googleMapId the google div ID |
278 | 277 | * |
279 | - * @return void |
|
278 | + * @return MapAPI |
|
280 | 279 | */ |
281 | 280 | |
282 | 281 | public function setDivId($googleMapId) { |
@@ -289,7 +288,7 @@ discard block |
||
289 | 288 | * |
290 | 289 | * @param string $googleMapDirectionId GoogleMap Direction ID for the HTML DIV |
291 | 290 | * |
292 | - * @return void |
|
291 | + * @return MapAPI |
|
293 | 292 | */ |
294 | 293 | |
295 | 294 | public function setDirectionDivId($googleMapDirectionId) { |
@@ -304,7 +303,7 @@ discard block |
||
304 | 303 | * @param int $width GoogleMap width |
305 | 304 | * @param int $height GoogleMap height |
306 | 305 | * |
307 | - * @return void |
|
306 | + * @return MapAPI |
|
308 | 307 | */ |
309 | 308 | |
310 | 309 | public function setSize($width, $height) { |
@@ -320,7 +319,7 @@ discard block |
||
320 | 319 | * @param int $iconWidth GoogleMap marker icon width |
321 | 320 | * @param int $iconHeight GoogleMap marker icon height |
322 | 321 | * |
323 | - * @return void |
|
322 | + * @return MapAPI |
|
324 | 323 | */ |
325 | 324 | |
326 | 325 | public function setIconSize($iconWidth, $iconHeight) { |
@@ -334,7 +333,7 @@ discard block |
||
334 | 333 | * |
335 | 334 | * @param string $lang GoogleMap lang : fr,en,.. |
336 | 335 | * |
337 | - * @return void |
|
336 | + * @return MapAPI |
|
338 | 337 | */ |
339 | 338 | |
340 | 339 | public function setLang($lang) { |
@@ -347,7 +346,7 @@ discard block |
||
347 | 346 | * |
348 | 347 | * @param int $zoom GoogleMap zoom. |
349 | 348 | * |
350 | - * @return void |
|
349 | + * @return MapAPI |
|
351 | 350 | */ |
352 | 351 | |
353 | 352 | public function setZoom($zoom) { |
@@ -358,9 +357,8 @@ discard block |
||
358 | 357 | /** |
359 | 358 | * Set the zoom of the infowindow |
360 | 359 | * |
361 | - * @param int $zoom GoogleMap zoom. |
|
362 | 360 | * |
363 | - * @return void |
|
361 | + * @return MapAPI |
|
364 | 362 | */ |
365 | 363 | |
366 | 364 | public function setInfoWindowZoom($infoWindowZoom) { |
@@ -371,9 +369,8 @@ discard block |
||
371 | 369 | /** |
372 | 370 | * Enable the zoom on the marker when you click on it |
373 | 371 | * |
374 | - * @param int $zoom GoogleMap zoom. |
|
375 | 372 | * |
376 | - * @return void |
|
373 | + * @return MapAPI |
|
377 | 374 | */ |
378 | 375 | |
379 | 376 | public function setEnableWindowZoom($enableWindowZoom) { |
@@ -384,9 +381,9 @@ discard block |
||
384 | 381 | /** |
385 | 382 | * Enable theautomatic center/zoom at the gmap load |
386 | 383 | * |
387 | - * @param int $zoom GoogleMap zoom. |
|
388 | 384 | * |
389 | - * @return void |
|
385 | + * @param boolean $enableAutomaticCenterZoom |
|
386 | + * @return MapAPI |
|
390 | 387 | */ |
391 | 388 | |
392 | 389 | public function setEnableAutomaticCenterZoom($enableAutomaticCenterZoom) { |
@@ -399,7 +396,7 @@ discard block |
||
399 | 396 | * |
400 | 397 | * @param string $center GoogleMap center (an address) |
401 | 398 | * |
402 | - * @return void |
|
399 | + * @return MapAPI |
|
403 | 400 | */ |
404 | 401 | |
405 | 402 | public function setCenter($center) { |
@@ -412,7 +409,7 @@ discard block |
||
412 | 409 | * |
413 | 410 | * @param string $mapType Can be one of road,satellite,hybrid or terrain. Defaults to road |
414 | 411 | * |
415 | - * @return void |
|
412 | + * @return MapAPI |
|
416 | 413 | */ |
417 | 414 | |
418 | 415 | public function setMapType($mapType) { |
@@ -458,7 +455,7 @@ discard block |
||
458 | 455 | * |
459 | 456 | * @param boolean $displayDirectionFields display directions or not in the info window |
460 | 457 | * |
461 | - * @return void |
|
458 | + * @return MapAPI |
|
462 | 459 | */ |
463 | 460 | |
464 | 461 | public function setDisplayDirectionFields($displayDirectionFields) { |
@@ -471,7 +468,7 @@ discard block |
||
471 | 468 | * |
472 | 469 | * @param boolean $defaultHideMarker hide all the markers on the map by default |
473 | 470 | * |
474 | - * @return void |
|
471 | + * @return MapAPI |
|
475 | 472 | */ |
476 | 473 | |
477 | 474 | public function setDefaultHideMarker($defaultHideMarker) { |
@@ -555,7 +552,7 @@ discard block |
||
555 | 552 | * @param string $category marker category |
556 | 553 | * @param string $icon an icon url |
557 | 554 | * |
558 | - * @return void |
|
555 | + * @return MapAPI |
|
559 | 556 | */ |
560 | 557 | |
561 | 558 | public function addMarkerByCoords($lat, $lng, $html='', $category='', $icon='') { |
@@ -579,7 +576,7 @@ discard block |
||
579 | 576 | * @param string $category marker category |
580 | 577 | * @param string $icon an icon url |
581 | 578 | * |
582 | - * @return void |
|
579 | + * @return MapAPI |
|
583 | 580 | */ |
584 | 581 | |
585 | 582 | public function addMarkerByAddress($address, $content='', $category='', $icon='') { |
@@ -599,7 +596,7 @@ discard block |
||
599 | 596 | * @param string $category marker category |
600 | 597 | * @param string $icon an icon url |
601 | 598 | * |
602 | - * @return void |
|
599 | + * @return MapAPI |
|
603 | 600 | */ |
604 | 601 | |
605 | 602 | public function addArrayMarkerByCoords($coordtab, $category='', $icon='') { |
@@ -681,7 +678,7 @@ discard block |
||
681 | 678 | * @param string $category marker category |
682 | 679 | * @param string $icon an icon url |
683 | 680 | * |
684 | - * @return void |
|
681 | + * @return MapAPI |
|
685 | 682 | */ |
686 | 683 | |
687 | 684 | public function addArrayMarkerByAddress($coordtab, $category='', $icon='') { |
@@ -710,7 +707,7 @@ discard block |
||
710 | 707 | * |
711 | 708 | * @param string $url url of the kml file compatible with gmap and gearth |
712 | 709 | * |
713 | - * @return void |
|
710 | + * @return MapAPI |
|
714 | 711 | */ |
715 | 712 | |
716 | 713 | public function addKML($url) { |
@@ -870,6 +867,10 @@ discard block |
||
870 | 867 | return $result; |
871 | 868 | } |
872 | 869 | |
870 | + /** |
|
871 | + * @param string $templateName |
|
872 | + * @param ArrayData $templateVariables |
|
873 | + */ |
|
873 | 874 | function processTemplateHTML($templateName, $templateVariables = null ) { |
874 | 875 | if (!$templateVariables) { |
875 | 876 | $templateVariables = new ArrayList(); |
@@ -446,8 +446,8 @@ |
||
446 | 446 | } |
447 | 447 | |
448 | 448 | /** |
449 | - * Set the center of the gmap |
|
450 | - **/ |
|
449 | + * Set the center of the gmap |
|
450 | + **/ |
|
451 | 451 | public function setLatLongCenter($center) { |
452 | 452 | $this->latLongCenter = $center; |
453 | 453 | return $this; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @return void |
204 | 204 | */ |
205 | 205 | |
206 | - public function __construct($googleMapKey='') { |
|
206 | + public function __construct($googleMapKey = '') { |
|
207 | 207 | $this->googleMapKey = $googleMapKey; |
208 | 208 | } |
209 | 209 | |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | * @return void |
263 | 263 | */ |
264 | 264 | |
265 | - public function setClusterer($useClusterer, $gridSize=50, $maxZoom=17, |
|
266 | - $clustererLibraryPath='/mappable/javascript/google/markerclusterer.js') { |
|
265 | + public function setClusterer($useClusterer, $gridSize = 50, $maxZoom = 17, |
|
266 | + $clustererLibraryPath = '/mappable/javascript/google/markerclusterer.js') { |
|
267 | 267 | $this->useClusterer = $useClusterer; |
268 | 268 | $this->gridSize = $gridSize; |
269 | 269 | $this->maxZoom = $maxZoom; |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | * @return void |
559 | 559 | */ |
560 | 560 | |
561 | - public function addMarkerByCoords($lat, $lng, $html='', $category='', $icon='') { |
|
561 | + public function addMarkerByCoords($lat, $lng, $html = '', $category = '', $icon = '') { |
|
562 | 562 | $m = array( |
563 | 563 | 'latitude' => $lat, |
564 | 564 | 'longitude' => $lng, |
@@ -582,9 +582,9 @@ discard block |
||
582 | 582 | * @return void |
583 | 583 | */ |
584 | 584 | |
585 | - public function addMarkerByAddress($address, $content='', $category='', $icon='') { |
|
585 | + public function addMarkerByAddress($address, $content = '', $category = '', $icon = '') { |
|
586 | 586 | $point = $this->geocoding($address); |
587 | - if ($point!==null) { |
|
587 | + if ($point !== null) { |
|
588 | 588 | $this->addMarkerByCoords($point[2], $point[3], $content, $category, $icon); |
589 | 589 | } else { |
590 | 590 | // throw new Exception('Adress not found : '.$address); |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | * @return void |
603 | 603 | */ |
604 | 604 | |
605 | - public function addArrayMarkerByCoords($coordtab, $category='', $icon='') { |
|
605 | + public function addArrayMarkerByCoords($coordtab, $category = '', $icon = '') { |
|
606 | 606 | foreach ($coordtab as $coord) { |
607 | 607 | $this->addMarkerByCoords($coord[0], $coord[1], $coord[2], $category, $icon); |
608 | 608 | } |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | * @return void |
685 | 685 | */ |
686 | 686 | |
687 | - public function addArrayMarkerByAddress($coordtab, $category='', $icon='') { |
|
687 | + public function addArrayMarkerByAddress($coordtab, $category = '', $icon = '') { |
|
688 | 688 | foreach ($coordtab as $coord) { |
689 | 689 | $this->addMarkerByAddress($coord[0], $coord[1], $category, $icon); |
690 | 690 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | * @return void |
702 | 702 | */ |
703 | 703 | |
704 | - public function addDirection($from, $to, $idpanel='') { |
|
704 | + public function addDirection($from, $to, $idpanel = '') { |
|
705 | 705 | $this->contentMarker .= 'addDirection("'.$from.'","'.$to.'","'.$idpanel.'");'; |
706 | 706 | } |
707 | 707 | |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | $linesJson = stripslashes($this->jsonRemoveUnicodeSequences($this->lines)); |
766 | 766 | $kmlJson = stripslashes($this->jsonRemoveUnicodeSequences($this->kmlFiles)); |
767 | 767 | } else { |
768 | - $jsonMarkers = stripslashes(json_encode($this->markers,JSON_UNESCAPED_UNICODE)); |
|
769 | - $linesJson = stripslashes(json_encode($this->lines,JSON_UNESCAPED_UNICODE)); |
|
770 | - $kmlJson = stripslashes(json_encode($this->kmlFiles,JSON_UNESCAPED_UNICODE)); |
|
768 | + $jsonMarkers = stripslashes(json_encode($this->markers, JSON_UNESCAPED_UNICODE)); |
|
769 | + $linesJson = stripslashes(json_encode($this->lines, JSON_UNESCAPED_UNICODE)); |
|
770 | + $kmlJson = stripslashes(json_encode($this->kmlFiles, JSON_UNESCAPED_UNICODE)); |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | |
@@ -777,8 +777,8 @@ discard block |
||
777 | 777 | $this->latLongCenter : $this->geocoding($this->center); |
778 | 778 | |
779 | 779 | // coordinates for centre depending on which method used |
780 | - if ($geocodeCentre[0]=="200") { // success |
|
781 | - $latlngCentre = array('lat'=>$geocodeCentre[2],'lng' => $geocodeCentre[3]); |
|
780 | + if ($geocodeCentre[0] == "200") { // success |
|
781 | + $latlngCentre = array('lat'=>$geocodeCentre[2], 'lng' => $geocodeCentre[3]); |
|
782 | 782 | } else { // Paris |
783 | 783 | $latlngCentre = array('lat'=>48.8792, 'lng' => 2.34778); |
784 | 784 | } |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | return $result; |
871 | 871 | } |
872 | 872 | |
873 | - function processTemplateHTML($templateName, $templateVariables = null ) { |
|
873 | + function processTemplateHTML($templateName, $templateVariables = null) { |
|
874 | 874 | if (!$templateVariables) { |
875 | 875 | $templateVariables = new ArrayList(); |
876 | 876 | } |
@@ -184,7 +184,7 @@ |
||
184 | 184 | |
185 | 185 | /** |
186 | 186 | * Access the map editing field for the purpose of adding guide points |
187 | - * @return [LatLongField] instance of location editing field |
|
187 | + * @return FormField instance of location editing field |
|
188 | 188 | */ |
189 | 189 | public function getMapField() { |
190 | 190 | if (!isset($this->mapField)) { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | 'MapPinIcon' => 'Image' |
19 | 19 | ); |
20 | 20 | |
21 | - static $defaults = array ( |
|
21 | + static $defaults = array( |
|
22 | 22 | 'Lat' =>0, |
23 | 23 | 'Lon' => 0, |
24 | 24 | 'Zoom' => 4, |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | // add any KML map layers |
147 | 147 | if (Object::has_extension($this->owner->ClassName, 'MapLayerExtension')) { |
148 | - foreach($this->owner->MapLayers() as $layer) { |
|
148 | + foreach ($this->owner->MapLayers() as $layer) { |
|
149 | 149 | $map->addKML($layer->KmlFile()->getAbsoluteURL()); |
150 | 150 | // we have a layer, so turn on autozoom |
151 | 151 | $autozoom = true; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // add points of interest taking into account the default icon of the layer as an override |
157 | 157 | if (Object::has_extension($this->owner->ClassName, 'PointsOfInterestLayerExtension')) { |
158 | - foreach($this->owner->PointsOfInterestLayers() as $layer) { |
|
158 | + foreach ($this->owner->PointsOfInterestLayers() as $layer) { |
|
159 | 159 | $layericon = $layer->DefaultIcon(); |
160 | 160 | if ($layericon->ID === 0) { |
161 | 161 | $layericon = null; |
@@ -79,6 +79,9 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | |
82 | + /** |
|
83 | + * @param boolean $new_map_already_rendered |
|
84 | + */ |
|
82 | 85 | public static function set_map_already_rendered($new_map_already_rendered) { |
83 | 86 | self::$map_already_rendered = $new_map_already_rendered; |
84 | 87 | } |
@@ -154,7 +157,7 @@ discard block |
||
154 | 157 | /** |
155 | 158 | * Get a new GoogleMapAPI object and load it with the default settings |
156 | 159 | * |
157 | - * @return GoogleMapAPI |
|
160 | + * @return MapAPI |
|
158 | 161 | */ |
159 | 162 | public static function instance() |
160 | 163 | { |
@@ -216,7 +219,6 @@ discard block |
||
216 | 219 | * and places all of the items in a {@link SS_List} |
217 | 220 | * e.g. {@link DataList} or {@link ArrayList} on the map |
218 | 221 | * |
219 | - * @param SS_List $set |
|
220 | 222 | * @return MapAPI |
221 | 223 | */ |
222 | 224 | public static function get_map(SS_List $list, $optionalinfowindowtemplatevalues) { |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static $map_height = '400px'; |
25 | 25 | |
26 | - /** @var int Icon width of the gmarker **/ |
|
27 | - public static $iconWidth = 24; |
|
26 | + /** @var int Icon width of the gmarker **/ |
|
27 | + public static $iconWidth = 24; |
|
28 | 28 | |
29 | - /** @var int Icon height of the gmarker **/ |
|
30 | - public static $iconHeight = 24; |
|
29 | + /** @var int Icon height of the gmarker **/ |
|
30 | + public static $iconHeight = 24; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var int Prefix for the div ID of the map |
@@ -99,57 +99,57 @@ discard block |
||
99 | 99 | self::$map_height = $height; |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * Set the type of the gmap |
|
104 | - * |
|
105 | - * @param string $mapType (can be 'google.maps.MapTypeId.ROADMAP', 'G_SATELLITE_MAP', |
|
106 | - * 'G_HYBRID_MAP', 'G_PHYSICAL_MAP') |
|
107 | - * |
|
108 | - * @return void |
|
109 | - */ |
|
110 | - public function set_map_type($mapType) |
|
111 | - { |
|
112 | - self::$map_type = $mapType; |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * Set the with of the gmap infowindow (on marker clik) |
|
117 | - * |
|
118 | - * @param int $info_window_width GoogleMap info window width |
|
119 | - * |
|
120 | - * @return void |
|
121 | - */ |
|
122 | - public function set_info_window_width($info_window_width) |
|
123 | - { |
|
124 | - self::$info_window_width = $info_window_width; |
|
125 | - } |
|
126 | - |
|
127 | - /** |
|
128 | - * Set the center of the gmap (an address) |
|
129 | - * |
|
130 | - * @param string $center GoogleMap center (an address) |
|
131 | - * |
|
132 | - * @return void |
|
133 | - */ |
|
134 | - public function set_center($center) |
|
135 | - { |
|
136 | - self::$center = $center; |
|
137 | - } |
|
138 | - |
|
139 | - /** |
|
140 | - * Set the size of the icon markers |
|
141 | - * |
|
142 | - * @param int $iconWidth GoogleMap marker icon width |
|
143 | - * @param int $iconHeight GoogleMap marker icon height |
|
144 | - * |
|
145 | - * @return void |
|
146 | - */ |
|
147 | - |
|
148 | - public function set_icon_size($iconWidth,$iconHeight) |
|
149 | - { |
|
150 | - self::$iconWidth = $iconWidth; |
|
151 | - self::$iconHeight = $iconHeight; |
|
152 | - } |
|
102 | + /** |
|
103 | + * Set the type of the gmap |
|
104 | + * |
|
105 | + * @param string $mapType (can be 'google.maps.MapTypeId.ROADMAP', 'G_SATELLITE_MAP', |
|
106 | + * 'G_HYBRID_MAP', 'G_PHYSICAL_MAP') |
|
107 | + * |
|
108 | + * @return void |
|
109 | + */ |
|
110 | + public function set_map_type($mapType) |
|
111 | + { |
|
112 | + self::$map_type = $mapType; |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * Set the with of the gmap infowindow (on marker clik) |
|
117 | + * |
|
118 | + * @param int $info_window_width GoogleMap info window width |
|
119 | + * |
|
120 | + * @return void |
|
121 | + */ |
|
122 | + public function set_info_window_width($info_window_width) |
|
123 | + { |
|
124 | + self::$info_window_width = $info_window_width; |
|
125 | + } |
|
126 | + |
|
127 | + /** |
|
128 | + * Set the center of the gmap (an address) |
|
129 | + * |
|
130 | + * @param string $center GoogleMap center (an address) |
|
131 | + * |
|
132 | + * @return void |
|
133 | + */ |
|
134 | + public function set_center($center) |
|
135 | + { |
|
136 | + self::$center = $center; |
|
137 | + } |
|
138 | + |
|
139 | + /** |
|
140 | + * Set the size of the icon markers |
|
141 | + * |
|
142 | + * @param int $iconWidth GoogleMap marker icon width |
|
143 | + * @param int $iconHeight GoogleMap marker icon height |
|
144 | + * |
|
145 | + * @return void |
|
146 | + */ |
|
147 | + |
|
148 | + public function set_icon_size($iconWidth,$iconHeight) |
|
149 | + { |
|
150 | + self::$iconWidth = $iconWidth; |
|
151 | + self::$iconHeight = $iconHeight; |
|
152 | + } |
|
153 | 153 | |
154 | 154 | /** |
155 | 155 | * Get a new GoogleMapAPI object and load it with the default settings |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | $gmap->setDisplayDirectionFields(self::$direction_fields); |
192 | 192 | $gmap->setSize(self::$map_width, self::$map_height); |
193 | 193 | $gmap->setDefaultHideMarker(self::$hide_marker); |
194 | - $gmap->setMapType(self::$map_type); |
|
195 | - $gmap->setCenter(self::$center); |
|
196 | - $gmap->setIconSize(self::$iconWidth, self::$iconHeight); |
|
197 | - $gmap->setIncludeDownloadJavascript(self::$map_already_rendered); |
|
198 | - $gmap->setAllowFullScreen(self::$allow_full_screen); |
|
194 | + $gmap->setMapType(self::$map_type); |
|
195 | + $gmap->setCenter(self::$center); |
|
196 | + $gmap->setIconSize(self::$iconWidth, self::$iconHeight); |
|
197 | + $gmap->setIncludeDownloadJavascript(self::$map_already_rendered); |
|
198 | + $gmap->setAllowFullScreen(self::$allow_full_screen); |
|
199 | 199 | return $gmap; |
200 | 200 | } |
201 | 201 |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @return void |
146 | 146 | */ |
147 | 147 | |
148 | - public function set_icon_size($iconWidth,$iconHeight) |
|
148 | + public function set_icon_size($iconWidth, $iconHeight) |
|
149 | 149 | { |
150 | 150 | self::$iconWidth = $iconWidth; |
151 | 151 | self::$iconHeight = $iconHeight; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @return string |
208 | 208 | */ |
209 | 209 | public static function sanitize($content) { |
210 | - return addslashes(str_replace(array("\n","\r", "\t"), '' ,$content)); |
|
210 | + return addslashes(str_replace(array("\n", "\r", "\t"), '', $content)); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public static function get_map(SS_List $list, $optionalinfowindowtemplatevalues) { |
223 | 223 | $gmap = self::instance(); |
224 | - if($list) { |
|
224 | + if ($list) { |
|
225 | 225 | foreach ($list as $mappable) { |
226 | 226 | if (self::ChooseToAddDataobject($mappable)) { |
227 | 227 | $gmap->addMarkerAsObject($mappable, $optionalinfowindowtemplatevalues); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | private static function ChooseToAddDataobject(DataObject $do) { |
243 | 243 | $isMappable = $do->is_a('Mappable'); |
244 | 244 | |
245 | - foreach($do->getExtensionInstances() as $extension) { |
|
245 | + foreach ($do->getExtensionInstances() as $extension) { |
|
246 | 246 | $isMappable = $isMappable || $extension instanceof Mappable; |
247 | 247 | } |
248 | 248 | |
@@ -250,6 +250,6 @@ discard block |
||
250 | 250 | ? $do->MapPinEdited |
251 | 251 | : true; |
252 | 252 | |
253 | - return $isMappable && $filterMapPinEdited ; |
|
253 | + return $isMappable && $filterMapPinEdited; |
|
254 | 254 | } |
255 | 255 | } |
@@ -8,15 +8,15 @@ |
||
8 | 8 | |
9 | 9 | public static function parse_googlestreetview($arguments, $caption = null, $parser = null) { |
10 | 10 | // each of latitude, longitude and heading are required at a bare minimum |
11 | - if(!isset($arguments['latitude'])){ |
|
11 | + if (!isset($arguments['latitude'])) { |
|
12 | 12 | return ''; |
13 | 13 | } |
14 | 14 | |
15 | - if(!isset($arguments['longitude'])){ |
|
15 | + if (!isset($arguments['longitude'])) { |
|
16 | 16 | return ''; |
17 | 17 | } |
18 | 18 | |
19 | - if(!isset($arguments['heading'])){ |
|
19 | + if (!isset($arguments['heading'])) { |
|
20 | 20 | return ''; |
21 | 21 | } |
22 | 22 |
@@ -7,11 +7,11 @@ |
||
7 | 7 | |
8 | 8 | public static function parse_googlemap($arguments, $caption = null, $parser = null) { |
9 | 9 | // each of latitude and longitude are required at a bare minimum |
10 | - if(!isset($arguments['latitude'])){ |
|
10 | + if (!isset($arguments['latitude'])) { |
|
11 | 11 | return ''; |
12 | 12 | } |
13 | 13 | |
14 | - if(!isset($arguments['longitude'])){ |
|
14 | + if (!isset($arguments['longitude'])) { |
|
15 | 15 | return ''; |
16 | 16 | } |
17 | 17 |
@@ -78,38 +78,38 @@ |
||
78 | 78 | |
79 | 79 | Requirements::javascript(MAPPABLE_MODULE_PATH.'/javascript/mapField.js'); |
80 | 80 | $attributes = array( |
81 | - 'class' => 'editableMap', |
|
82 | - 'id' => 'GoogleMap', |
|
83 | - 'data-LatFieldName' => $this->latField, |
|
81 | + 'class' => 'editableMap', |
|
82 | + 'id' => 'GoogleMap', |
|
83 | + 'data-LatFieldName' => $this->latField, |
|
84 | 84 | 'data-LonFieldName' => $this->longField, |
85 | 85 | 'data-ZoomFieldName' => $this->zoomField, |
86 | 86 | 'data-UseMapBounds' => false |
87 | - ); |
|
87 | + ); |
|
88 | 88 | |
89 | - Requirements::css('mappable/css/mapField.css'); |
|
90 | - $guidePointsJSON = ''; |
|
91 | - if (isset($this->guidePoints)) { |
|
92 | - $latlongps = array(); |
|
89 | + Requirements::css('mappable/css/mapField.css'); |
|
90 | + $guidePointsJSON = ''; |
|
91 | + if (isset($this->guidePoints)) { |
|
92 | + $latlongps = array(); |
|
93 | 93 | |
94 | 94 | foreach ($this->guidePoints as $guidepoint) { |
95 | 95 | array_push($latlongps, $guidepoint); |
96 | 96 | } |
97 | 97 | |
98 | - $guidePointsJSON = json_encode($latlongps); |
|
99 | - // convert the mappable guidepoints to lat lon |
|
98 | + $guidePointsJSON = json_encode($latlongps); |
|
99 | + // convert the mappable guidepoints to lat lon |
|
100 | 100 | |
101 | - $attributes['data-GuidePoints'] = $guidePointsJSON; |
|
101 | + $attributes['data-GuidePoints'] = $guidePointsJSON; |
|
102 | 102 | |
103 | - // we only wish to change the bounds to those of all the points iff |
|
104 | - // the item currently has no location |
|
105 | - $attributes['data-useMapBounds'] = true; |
|
106 | - } |
|
107 | - $content = '<div class="editableMapWrapper">' . $this->createTag( |
|
108 | - "div", |
|
109 | - $attributes |
|
110 | - ) . '</div>'; |
|
103 | + // we only wish to change the bounds to those of all the points iff |
|
104 | + // the item currently has no location |
|
105 | + $attributes['data-useMapBounds'] = true; |
|
106 | + } |
|
107 | + $content = '<div class="editableMapWrapper">' . $this->createTag( |
|
108 | + "div", |
|
109 | + $attributes |
|
110 | + ) . '</div>'; |
|
111 | 111 | |
112 | - $this->FieldList()->push(new LiteralField('locationEditor', $content)); |
|
112 | + $this->FieldList()->push(new LiteralField('locationEditor', $content)); |
|
113 | 113 | |
114 | 114 | $content2 = '<div id="mapSearch"> |
115 | 115 | <input name="location_search" id="location_search" size=80/> |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | class LatLongField extends FieldGroup { |
4 | 4 | |
5 | - static $allowed_actions = array ( |
|
5 | + static $allowed_actions = array( |
|
6 | 6 | 'geocode' |
7 | 7 | ); |
8 | 8 | |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | // the item currently has no location |
105 | 105 | $attributes['data-useMapBounds'] = true; |
106 | 106 | } |
107 | - $content = '<div class="editableMapWrapper">' . $this->createTag( |
|
107 | + $content = '<div class="editableMapWrapper">'.$this->createTag( |
|
108 | 108 | "div", |
109 | 109 | $attributes |
110 | - ) . '</div>'; |
|
110 | + ).'</div>'; |
|
111 | 111 | |
112 | 112 | $this->FieldList()->push(new LiteralField('locationEditor', $content)); |
113 | 113 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $gmap = MapUtil::get_map($this->owner, $this->MarkerTemplateValues); |
28 | 28 | $w = $width ? $width : MapUtil::$map_width; |
29 | 29 | $h = $height ? $height : MapUtil::$map_height; |
30 | - $gmap->setSize($w,$h); |
|
30 | + $gmap->setSize($w, $h); |
|
31 | 31 | return $gmap; |
32 | 32 | } |
33 | 33 |
@@ -15,19 +15,19 @@ discard block |
||
15 | 15 | // legacy handling for old parameters: $title, $heading, ... |
16 | 16 | // instead of new handling: $name, $title, $heading, ... |
17 | 17 | $args = func_get_args(); |
18 | - if(!isset($args[1]) || is_numeric($args[1])) { |
|
18 | + if (!isset($args[1]) || is_numeric($args[1])) { |
|
19 | 19 | $title = (isset($args[0])) ? $args[0] : null; |
20 | 20 | // Use "HeaderField(title)" as the default field name for a HeaderField; |
21 | 21 | // if it's just set to title then we risk causing accidental duplicate-field creation. |
22 | 22 | |
23 | 23 | // this means i18nized fields won't be easily accessible through fieldByName() |
24 | - $name = 'MapField' . $title; |
|
24 | + $name = 'MapField'.$title; |
|
25 | 25 | $headingLevel = (isset($args[1])) ? $args[1] : null; |
26 | 26 | $allowHTML = (isset($args[2])) ? $args[2] : null; |
27 | 27 | $form = (isset($args[3])) ? $args[3] : null; |
28 | 28 | } |
29 | 29 | |
30 | - if($headingLevel) $this->headingLevel = $headingLevel; |
|
30 | + if ($headingLevel) $this->headingLevel = $headingLevel; |
|
31 | 31 | $this->allowHTML = $allowHTML; |
32 | 32 | parent::__construct($name, $title, null, $allowHTML, $form); |
33 | 33 | } |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | |
53 | 53 | Requirements::css('mappable/css/mapField.css'); |
54 | 54 | |
55 | - return '<div class="editableMap">' . $this->createTag( |
|
55 | + return '<div class="editableMap">'.$this->createTag( |
|
56 | 56 | "div", |
57 | 57 | $attributes |
58 | - ) . '</div>'; |
|
58 | + ).'</div>'; |
|
59 | 59 | } |
60 | 60 | } |
@@ -27,7 +27,9 @@ |
||
27 | 27 | $form = (isset($args[3])) ? $args[3] : null; |
28 | 28 | } |
29 | 29 | |
30 | - if($headingLevel) $this->headingLevel = $headingLevel; |
|
30 | + if($headingLevel) { |
|
31 | + $this->headingLevel = $headingLevel; |
|
32 | + } |
|
31 | 33 | $this->allowHTML = $allowHTML; |
32 | 34 | parent::__construct($name, $title, null, $allowHTML, $form); |
33 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $gmap = MapUtil::get_map(new ArrayList(array($this->owner)), $this->MarkerTemplateValues); |
41 | 41 | $w = $width ? $width : MapUtil::$map_width; |
42 | 42 | $h = $height ? $height : MapUtil::$map_height; |
43 | - $gmap->setSize($w,$h); |
|
43 | + $gmap->setSize($w, $h); |
|
44 | 44 | $gmap->setZoom($zoom); |
45 | 45 | $gmap->setEnableAutomaticCenterZoom(false); |
46 | 46 | if ($this->owner->MapPinEdited) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $urlparts['markers'] = "icon:$pin|$lat,$lng"; |
90 | 90 | } |
91 | 91 | |
92 | - $src = htmlentities($apiurl . '?' . http_build_query($urlparts)); |
|
92 | + $src = htmlentities($apiurl.'?'.http_build_query($urlparts)); |
|
93 | 93 | return '<img src="'.$src.'" width="'.$w.'" height="'.$h.'" alt="'.$this->owner->Title.'" />'; |
94 | 94 | } |
95 | 95 |