@@ -343,8 +343,9 @@ discard block |
||
343 | 343 | public function checkMapCache() { |
344 | 344 | $this->mapCacheID = md5 ( $this->serializeParams () ); |
345 | 345 | $filename = $this->mapCacheIDToFilename (); |
346 | - if (file_exists ( $filename )) |
|
347 | - return true; |
|
346 | + if (file_exists ( $filename )) { |
|
347 | + return true; |
|
348 | + } |
|
348 | 349 | } |
349 | 350 | public function serializeParams() { |
350 | 351 | return join ( "&", array ( |
@@ -398,8 +399,9 @@ discard block |
||
398 | 399 | * @param string $url |
399 | 400 | */ |
400 | 401 | public function fetchTile($url) { |
401 | - if ($this->useTileCache && ($cached = $this->checkTileCache ( $url ))) |
|
402 | - return $cached; |
|
402 | + if ($this->useTileCache && ($cached = $this->checkTileCache ( $url ))) { |
|
403 | + return $cached; |
|
404 | + } |
|
403 | 405 | |
404 | 406 | $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; ' . PHP_OS . ')'; |
405 | 407 | if (function_exists ( "curl_init" )) { |
@@ -467,7 +469,9 @@ discard block |
||
467 | 469 | * drawing colour |
468 | 470 | */ |
469 | 471 | private function drawGeometry($geom, $colour) { |
470 | - if (empty($geom)) return; |
|
472 | + if (empty($geom)) { |
|
473 | + return; |
|
474 | + } |
|
471 | 475 | |
472 | 476 | switch ($geom->geometryType ()) { |
473 | 477 | case 'GeometryCollection' : |
@@ -605,14 +609,18 @@ discard block |
||
605 | 609 | public function makeMap() { |
606 | 610 | $this->initCoords (); |
607 | 611 | $this->createBaseMap (); |
608 | - if (! empty ( $this->markers )) |
|
609 | - $this->placeMarkers (); |
|
610 | - if (file_exists ( $this->kmlFileName )) |
|
611 | - $this->drawKML (); |
|
612 | - if (file_exists ( $this->gpxFileName )) |
|
613 | - $this->drawGPX (); |
|
614 | - if (file_exists ( $this->geojsonFileName )) |
|
615 | - $this->drawGeojson (); |
|
612 | + if (! empty ( $this->markers )) { |
|
613 | + $this->placeMarkers (); |
|
614 | + } |
|
615 | + if (file_exists ( $this->kmlFileName )) { |
|
616 | + $this->drawKML (); |
|
617 | + } |
|
618 | + if (file_exists ( $this->gpxFileName )) { |
|
619 | + $this->drawGPX (); |
|
620 | + } |
|
621 | + if (file_exists ( $this->geojsonFileName )) { |
|
622 | + $this->drawGeojson (); |
|
623 | + } |
|
616 | 624 | |
617 | 625 | $this->drawCopyright (); |
618 | 626 | } |
@@ -14,10 +14,12 @@ discard block |
||
14 | 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | */ |
17 | -if (! defined ( 'DOKU_INC' )) |
|
17 | +if (! defined ( 'DOKU_INC' )) { |
|
18 | 18 | define ( 'DOKU_INC', realpath ( dirname ( __FILE__ ) . '/../../' ) . '/' ); |
19 | -if (! defined ( 'DOKU_PLUGIN' )) |
|
19 | +} |
|
20 | +if (! defined ( 'DOKU_PLUGIN' )) { |
|
20 | 21 | define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' ); |
22 | +} |
|
21 | 23 | require_once (DOKU_PLUGIN . 'syntax.php'); |
22 | 24 | |
23 | 25 | /** |
@@ -582,8 +584,9 @@ discard block |
||
582 | 584 | $imgUrl .= "?ma=" . $bbox ['minlat'] . "%2C" . $bbox ['minlon'] . "%2C" . $bbox ['maxlat'] . "%2C" . $bbox ['maxlon']; |
583 | 585 | $imgUrl .= "&dcl=1"; |
584 | 586 | } |
585 | - if (strpos ( $imgUrl, "?" ) === false) |
|
586 | - $imgUrl .= "?"; |
|
587 | + if (strpos ( $imgUrl, "?" ) === false) { |
|
588 | + $imgUrl .= "?"; |
|
589 | + } |
|
587 | 590 | |
588 | 591 | //$imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "," . str_replace ( "px", "", $gmap ['height'] ); |
589 | 592 | $imgUrl .= "&ms=" . str_replace ( "px", "", $gmap ['width'] ) . "%2C" . str_replace ( "px", "", $gmap ['height'] ); |
@@ -14,8 +14,12 @@ discard block |
||
14 | 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | */ |
17 | -if (!defined('DOKU_INC')) die(); |
|
18 | -if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
17 | +if (!defined('DOKU_INC')) { |
|
18 | + die(); |
|
19 | +} |
|
20 | +if (!defined('DOKU_PLUGIN')) { |
|
21 | + define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
22 | +} |
|
19 | 23 | require_once DOKU_PLUGIN.'openlayersmap/StaticMap.php'; |
20 | 24 | /** |
21 | 25 | * DokuWiki Plugin openlayersmap (staticmap Helper Component). |
@@ -77,13 +81,19 @@ discard block |
||
77 | 81 | |
78 | 82 | // normalize zoom |
79 | 83 | $zoom = $zoom?intval($zoom):0; |
80 | - if($zoom > 18) $zoom = 18; |
|
84 | + if($zoom > 18) { |
|
85 | + $zoom = 18; |
|
86 | + } |
|
81 | 87 | // normalize WxH |
82 | 88 | list($width, $height) = explode('x',$size); |
83 | 89 | $width = intval($width); |
84 | - if($width > $this->maxWidth) $width = $this->maxWidth; |
|
90 | + if($width > $this->maxWidth) { |
|
91 | + $width = $this->maxWidth; |
|
92 | + } |
|
85 | 93 | $height = intval($height); |
86 | - if($height > $this->maxHeight) $height = $this->maxHeight; |
|
94 | + if($height > $this->maxHeight) { |
|
95 | + $height = $this->maxHeight; |
|
96 | + } |
|
87 | 97 | |
88 | 98 | // cleanup/validate gpx/kml |
89 | 99 | $kml = $this->mediaIdToPath($kml); |
@@ -14,8 +14,12 @@ discard block |
||
14 | 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | */ |
17 | -if (!defined('DOKU_INC')) die(); |
|
18 | -if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
17 | +if (!defined('DOKU_INC')) { |
|
18 | + die(); |
|
19 | +} |
|
20 | +if (!defined('DOKU_PLUGIN')) { |
|
21 | + define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
22 | +} |
|
19 | 23 | require_once DOKU_PLUGIN.'admin.php'; |
20 | 24 | /** |
21 | 25 | * DokuWiki Plugin openlayersmap (Admin Component). |
@@ -45,14 +49,20 @@ discard block |
||
45 | 49 | */ |
46 | 50 | public function handle() { |
47 | 51 | global $conf; |
48 | - if(!isset($_REQUEST['continue']) || !checkSecurityToken()) return; |
|
52 | + if(!isset($_REQUEST['continue']) || !checkSecurityToken()) { |
|
53 | + return; |
|
54 | + } |
|
49 | 55 | if(isset($_REQUEST['purgetiles'])){ |
50 | 56 | $path = $conf['cachedir'].'/olmaptiles'; |
51 | - if ($this->rrmdir($path)) msg($this->getLang('admin_purged_tiles'),0); |
|
57 | + if ($this->rrmdir($path)) { |
|
58 | + msg($this->getLang('admin_purged_tiles'),0); |
|
59 | + } |
|
52 | 60 | } |
53 | 61 | if(isset($_REQUEST['purgemaps'])){ |
54 | 62 | $path = $conf['mediadir'].'/olmapmaps'; |
55 | - if ($this->rrmdir($path)) msg($this->getLang('admin_purged_maps'),0); |
|
63 | + if ($this->rrmdir($path)) { |
|
64 | + msg($this->getLang('admin_purged_maps'),0); |
|
65 | + } |
|
56 | 66 | } |
57 | 67 | } |
58 | 68 |
@@ -15,8 +15,12 @@ |
||
15 | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | 16 | */ |
17 | 17 | |
18 | -if (!defined('DOKU_INC')) die(); |
|
19 | -if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); |
|
18 | +if (!defined('DOKU_INC')) { |
|
19 | + die(); |
|
20 | +} |
|
21 | +if (!defined('DOKU_PLUGIN')) { |
|
22 | + define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); |
|
23 | +} |
|
20 | 24 | require_once (DOKU_PLUGIN . 'action.php'); |
21 | 25 | /** |
22 | 26 | * Plugin OL Maps: Allow Display of a OpenLayers Map in a wiki page. |