@@ -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 | |
@@ -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 | } |
@@ -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 | |
@@ -717,7 +717,7 @@ |
||
| 717 | 717 | $this->latLongCenter : $this->geocoding($this->center); |
| 718 | 718 | |
| 719 | 719 | // coordinates for centre depending on which method used |
| 720 | - if (isset($geocodeCentre['geocoded'] )) { |
|
| 720 | + if (isset($geocodeCentre['geocoded'])) { |
|
| 721 | 721 | $latlngCentre = array( |
| 722 | 722 | 'lat' => $geocodeCentre['lat'], |
| 723 | 723 | 'lng' => $geocodeCentre['lon'] |
@@ -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, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | // add any KML map layers |
| 156 | 156 | if (Object::has_extension($this->owner->ClassName, 'MapLayerExtension')) { |
| 157 | - foreach($this->owner->MapLayers() as $layer) { |
|
| 157 | + foreach ($this->owner->MapLayers() as $layer) { |
|
| 158 | 158 | $map->addKML($layer->KmlFile()->getAbsoluteURL()); |
| 159 | 159 | // we have a layer, so turn on autozoom |
| 160 | 160 | $autozoom = true; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $this->assertContains('data-useclusterer=1', $html); |
| 34 | 34 | |
| 35 | 35 | $map = $this->getMap(); |
| 36 | - $map->setClusterer(true, 60,14); |
|
| 36 | + $map->setClusterer(true, 60, 14); |
|
| 37 | 37 | $html = $map->forTemplate(); |
| 38 | 38 | $this->assertContains('data-clusterergridsize=60', $html); |
| 39 | 39 | $this->assertContains('data-clusterermaxzoom=14', $html); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | public function testGetContent() { |
| 334 | 334 | $map = $this->getMap(); |
| 335 | - $filepath = 'file://' . Director::baseFolder() |
|
| 335 | + $filepath = 'file://'.Director::baseFolder() |
|
| 336 | 336 | . '/mappable/tests/kml/example.kml'; |
| 337 | 337 | $content = $map->getContent($filepath); |
| 338 | 338 | $textHash = hash('ripemd160', $content); |
@@ -467,14 +467,14 @@ discard block |
||
| 467 | 467 | public function testAddLine() { |
| 468 | 468 | $map = $this->getMap(); |
| 469 | 469 | $map->addLine( |
| 470 | - array(13,101), |
|
| 470 | + array(13, 101), |
|
| 471 | 471 | array(13.2, 101.4), |
| 472 | 472 | '#F32' |
| 473 | 473 | ); |
| 474 | 474 | |
| 475 | 475 | $map->addLine( |
| 476 | 476 | array(13.2, 101.4), |
| 477 | - array(14.2,99.8) |
|
| 477 | + array(14.2, 99.8) |
|
| 478 | 478 | ); |
| 479 | 479 | |
| 480 | 480 | $html = $map->forTemplate(); |