Passed
Pull Request — master (#10)
by Mark
08:11
created
conf/metadata.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -22,72 +22,72 @@
 block discarded – undo
22 22
  */
23 23
 
24 24
 $meta['enableOSM']                = array(
25
-    'onoff'
25
+	'onoff'
26 26
 );
27 27
 $meta['enableStamen']             = array(
28
-    'onoff'
28
+	'onoff'
29 29
 );
30 30
 $meta['enableGoogle']             = array(
31
-    'onoff'
31
+	'onoff'
32 32
 );
33 33
 $meta['googleAPIkey']             = array(
34
-    'string'
34
+	'string'
35 35
 );
36 36
 $meta['enableBing']               = array(
37
-    'onoff'
37
+	'onoff'
38 38
 );
39 39
 $meta['bingAPIKey']               = array(
40
-    'string'
40
+	'string'
41 41
 );
42 42
 $meta['tfApiKey']                 = array(
43
-    'string'
43
+	'string'
44 44
 );
45 45
 $meta['iconUrlOverload']          = array(
46
-    'string'
46
+	'string'
47 47
 );
48 48
 $meta['enableA11y']               = array(
49
-    'onoff'
49
+	'onoff'
50 50
 );
51 51
 $meta['optionStaticMapGenerator'] = array(
52
-    'multichoice', '_choices' => array('local', 'remote')
52
+	'multichoice', '_choices' => array('local', 'remote')
53 53
 );
54 54
 $meta['autoZoomMap']              = array(
55
-    'onoff'
55
+	'onoff'
56 56
 );
57 57
 $meta ['displayformat']           = array(
58
-    'multichoice', '_choices' => array('DD', 'DMS')
58
+	'multichoice', '_choices' => array('DD', 'DMS')
59 59
 );
60 60
 
61 61
 $meta ['default_width']         = array(
62
-    'string'
62
+	'string'
63 63
 );
64 64
 $meta ['default_height']        = array(
65
-    'string'
65
+	'string'
66 66
 );
67 67
 $meta ['default_zoom']          = array(
68
-    'string'
68
+	'string'
69 69
 );
70 70
 $meta ['default_autozoom']      = array(
71
-    'onoff'
71
+	'onoff'
72 72
 );
73 73
 $meta ['default_statusbar']     = array(
74
-    'onoff'
74
+	'onoff'
75 75
 );
76 76
 $meta ['default_toolbar']       = array(
77
-    'onoff'
77
+	'onoff'
78 78
 );
79 79
 $meta ['default_controls']      = array(
80
-    'onoff'
80
+	'onoff'
81 81
 );
82 82
 $meta ['default_poihoverstyle'] = array(
83
-    'onoff'
83
+	'onoff'
84 84
 );
85 85
 $meta ['default_kmlfile']       = array(
86
-    'string'
86
+	'string'
87 87
 );
88 88
 $meta ['default_gpxfile']       = array(
89
-    'string'
89
+	'string'
90 90
 );
91 91
 $meta ['default_geojsonfile']   = array(
92
-    'string'
92
+	'string'
93 93
 );
Please login to merge, or discard this patch.
icons/index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@
 block discarded – undo
42 42
 </head>
43 43
 <body>
44 44
 <div class="box"><?php
45
-    foreach(glob('*.png') as $img) {
46
-        echo '<img src="' . $img . '" alt="' . $img . '" title="' . $img . '" /> ';
47
-    }
48
-    ?></div>
45
+	foreach(glob('*.png') as $img) {
46
+		echo '<img src="' . $img . '" alt="' . $img . '" title="' . $img . '" /> ';
47
+	}
48
+	?></div>
49 49
 </body>
50 50
 </html>
Please login to merge, or discard this patch.
_test/general.test.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -24,42 +24,42 @@
 block discarded – undo
24 24
  */
25 25
 class general_plugin_openlayersmap_test extends DokuWikiTest {
26 26
 
27
-    protected $pluginsEnabled = array('openlayersmap', 'geophp');
27
+	protected $pluginsEnabled = array('openlayersmap', 'geophp');
28 28
 
29
-    /**
30
-     * Simple test to make sure the plugin.info.txt is in correct format.
31
-     */
32
-    final public function test_plugininfo(): void {
33
-        $file = __DIR__ . '/../plugin.info.txt';
34
-        self::assertFileExists($file);
29
+	/**
30
+	 * Simple test to make sure the plugin.info.txt is in correct format.
31
+	 */
32
+	final public function test_plugininfo(): void {
33
+		$file = __DIR__ . '/../plugin.info.txt';
34
+		self::assertFileExists($file);
35 35
 
36
-        $info = confToHash($file);
36
+		$info = confToHash($file);
37 37
 
38
-        self::assertArrayHasKey('base', $info);
39
-        self::assertArrayHasKey('author', $info);
40
-        self::assertArrayHasKey('email', $info);
41
-        self::assertArrayHasKey('date', $info);
42
-        self::assertArrayHasKey('name', $info);
43
-        self::assertArrayHasKey('desc', $info);
44
-        self::assertArrayHasKey('url', $info);
38
+		self::assertArrayHasKey('base', $info);
39
+		self::assertArrayHasKey('author', $info);
40
+		self::assertArrayHasKey('email', $info);
41
+		self::assertArrayHasKey('date', $info);
42
+		self::assertArrayHasKey('name', $info);
43
+		self::assertArrayHasKey('desc', $info);
44
+		self::assertArrayHasKey('url', $info);
45 45
 
46
-        self::assertEquals('openlayersmap', $info['base']);
47
-        self::assertRegExp('/^https?:\/\//', $info['url']);
48
-        self::assertTrue(mail_isvalid($info['email']));
49
-        self::assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
50
-        self::assertTrue(false !== strtotime($info['date']));
51
-    }
46
+		self::assertEquals('openlayersmap', $info['base']);
47
+		self::assertRegExp('/^https?:\/\//', $info['url']);
48
+		self::assertTrue(mail_isvalid($info['email']));
49
+		self::assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
50
+		self::assertTrue(false !== strtotime($info['date']));
51
+	}
52 52
 
53
-    /**
54
-     * test if plugin is loaded.
55
-     */
56
-    final public function test_plugin_openlayersmap_isloaded(): void {
57
-        global $plugin_controller;
58
-        self::assertContains(
59
-            'geophp', $plugin_controller->getList(), "geophp plugin is loaded"
60
-        );
61
-        self::assertContains(
62
-            'openlayersmap', $plugin_controller->getList(), "openlayersmap plugin is loaded"
63
-        );
64
-    }
53
+	/**
54
+	 * test if plugin is loaded.
55
+	 */
56
+	final public function test_plugin_openlayersmap_isloaded(): void {
57
+		global $plugin_controller;
58
+		self::assertContains(
59
+			'geophp', $plugin_controller->getList(), "geophp plugin is loaded"
60
+		);
61
+		self::assertContains(
62
+			'openlayersmap', $plugin_controller->getList(), "openlayersmap plugin is loaded"
63
+		);
64
+	}
65 65
 }
Please login to merge, or discard this patch.
admin/purge.php 1 patch
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -24,101 +24,101 @@
 block discarded – undo
24 24
  * @author Mark Prins
25 25
  */
26 26
 class admin_plugin_openlayersmap_purge extends DokuWiki_Admin_Plugin {
27
-    /**
28
-     * (non-PHPdoc)
29
-     * @see DokuWiki_Admin_Plugin::getMenuSort()
30
-     */
31
-    public function getMenuSort(): int {
32
-        return 800;
33
-    }
27
+	/**
28
+	 * (non-PHPdoc)
29
+	 * @see DokuWiki_Admin_Plugin::getMenuSort()
30
+	 */
31
+	public function getMenuSort(): int {
32
+		return 800;
33
+	}
34 34
 
35
-    public function getMenuIcon(): string {
36
-        $plugin = $this->getPluginName();
37
-        return DOKU_PLUGIN . $plugin . '/admin/purge.svg';
38
-    }
35
+	public function getMenuIcon(): string {
36
+		$plugin = $this->getPluginName();
37
+		return DOKU_PLUGIN . $plugin . '/admin/purge.svg';
38
+	}
39 39
 
40
-    /**
41
-     * (non-PHPdoc)
42
-     * @see DokuWiki_Admin_Plugin::handle()
43
-     */
44
-    public function handle(): void {
45
-        global $conf;
46
-        if(!isset($_REQUEST['continue']) || !checkSecurityToken()) {
47
-            return;
48
-        }
49
-        if(isset($_REQUEST['purgetiles'])) {
50
-            $path = $conf['cachedir'] . '/olmaptiles';
51
-            if($this->rrmdir($path)) {
52
-                msg($this->getLang('admin_purged_tiles'), 0);
53
-            }
54
-        }
55
-        if(isset($_REQUEST['purgemaps'])) {
56
-            $path = $conf['mediadir'] . '/olmapmaps';
57
-            if($this->rrmdir($path)) {
58
-                msg($this->getLang('admin_purged_maps'), 0);
59
-            }
60
-        }
61
-    }
40
+	/**
41
+	 * (non-PHPdoc)
42
+	 * @see DokuWiki_Admin_Plugin::handle()
43
+	 */
44
+	public function handle(): void {
45
+		global $conf;
46
+		if(!isset($_REQUEST['continue']) || !checkSecurityToken()) {
47
+			return;
48
+		}
49
+		if(isset($_REQUEST['purgetiles'])) {
50
+			$path = $conf['cachedir'] . '/olmaptiles';
51
+			if($this->rrmdir($path)) {
52
+				msg($this->getLang('admin_purged_tiles'), 0);
53
+			}
54
+		}
55
+		if(isset($_REQUEST['purgemaps'])) {
56
+			$path = $conf['mediadir'] . '/olmapmaps';
57
+			if($this->rrmdir($path)) {
58
+				msg($this->getLang('admin_purged_maps'), 0);
59
+			}
60
+		}
61
+	}
62 62
 
63
-    /**
64
-     * Recursively delete the directory.
65
-     * @param string $sDir directory path
66
-     * @return boolean true when succesful
67
-     */
68
-    private function rrmdir(string $sDir): bool {
69
-        if(is_dir($sDir)) {
70
-            dbglog($sDir, 'admin_plugin_openlayersmap_purge::rrmdir: recursively removing path: ');
71
-            $sDir = rtrim($sDir, '/');
72
-            $oDir = dir($sDir);
73
-            while(($sFile = $oDir->read()) !== false) {
74
-                if($sFile !== '.' && $sFile !== '..') {
75
-                    (!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ?
76
-                        $this->rrmdir("$sDir/$sFile") : unlink("$sDir/$sFile");
77
-                }
78
-            }
79
-            $oDir->close();
80
-            rmdir($sDir);
81
-            return true;
82
-        }
83
-        return false;
84
-    }
63
+	/**
64
+	 * Recursively delete the directory.
65
+	 * @param string $sDir directory path
66
+	 * @return boolean true when succesful
67
+	 */
68
+	private function rrmdir(string $sDir): bool {
69
+		if(is_dir($sDir)) {
70
+			dbglog($sDir, 'admin_plugin_openlayersmap_purge::rrmdir: recursively removing path: ');
71
+			$sDir = rtrim($sDir, '/');
72
+			$oDir = dir($sDir);
73
+			while(($sFile = $oDir->read()) !== false) {
74
+				if($sFile !== '.' && $sFile !== '..') {
75
+					(!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ?
76
+						$this->rrmdir("$sDir/$sFile") : unlink("$sDir/$sFile");
77
+				}
78
+			}
79
+			$oDir->close();
80
+			rmdir($sDir);
81
+			return true;
82
+		}
83
+		return false;
84
+	}
85 85
 
86
-    /**
87
-     * (non-PHPdoc)
88
-     * @see DokuWiki_Admin_Plugin::html()
89
-     */
90
-    public function html(): void {
91
-        echo $this->locale_xhtml('admin_intro');
92
-        $form = new Doku_Form(array('id' => 'olmap_purgeform', 'method' => 'post'));
93
-        $form->addHidden('continue', 'go');
86
+	/**
87
+	 * (non-PHPdoc)
88
+	 * @see DokuWiki_Admin_Plugin::html()
89
+	 */
90
+	public function html(): void {
91
+		echo $this->locale_xhtml('admin_intro');
92
+		$form = new Doku_Form(array('id' => 'olmap_purgeform', 'method' => 'post'));
93
+		$form->addHidden('continue', 'go');
94 94
 
95
-        $form->startFieldset($this->getLang('admin_tiles'));
96
-        $form->addElement('<p>');
97
-        $form->addElement(
98
-            '<input id="purgetiles" name="purgetiles" type="checkbox" value="1" class="checkbox" />'
99
-        );
100
-        $form->addElement(
101
-            '<label for="purgetiles" class="label">' . $this->getLang('admin_purge_tiles')
102
-            . '</label>'
103
-        );
104
-        $form->addElement('</p>');
105
-        $form->endFieldset();
95
+		$form->startFieldset($this->getLang('admin_tiles'));
96
+		$form->addElement('<p>');
97
+		$form->addElement(
98
+			'<input id="purgetiles" name="purgetiles" type="checkbox" value="1" class="checkbox" />'
99
+		);
100
+		$form->addElement(
101
+			'<label for="purgetiles" class="label">' . $this->getLang('admin_purge_tiles')
102
+			. '</label>'
103
+		);
104
+		$form->addElement('</p>');
105
+		$form->endFieldset();
106 106
 
107
-        $form->startFieldset($this->getLang('admin_maps'));
108
-        $form->addElement('<p>');
109
-        $form->addElement('<input id="purgemaps" name="purgemaps" type="checkbox" value="1" class="checkbox" />');
110
-        $form->addElement(
111
-            '<label for="purgemaps" class="label">' . $this->getLang('admin_purge_maps') . '</label>'
112
-        );
113
-        $form->addElement('</p>');
114
-        $form->endFieldset();
107
+		$form->startFieldset($this->getLang('admin_maps'));
108
+		$form->addElement('<p>');
109
+		$form->addElement('<input id="purgemaps" name="purgemaps" type="checkbox" value="1" class="checkbox" />');
110
+		$form->addElement(
111
+			'<label for="purgemaps" class="label">' . $this->getLang('admin_purge_maps') . '</label>'
112
+		);
113
+		$form->addElement('</p>');
114
+		$form->endFieldset();
115 115
 
116
-        $form->addElement(
117
-            form_makeButton(
118
-                'submit', 'admin', $this->getLang('admin_submit'),
119
-                array('accesskey' => 'p', 'title' => $this->getLang('admin_submit'))
120
-            )
121
-        );
122
-        $form->printForm();
123
-    }
116
+		$form->addElement(
117
+			form_makeButton(
118
+				'submit', 'admin', $this->getLang('admin_submit'),
119
+				array('accesskey' => 'p', 'title' => $this->getLang('admin_submit'))
120
+			)
121
+		);
122
+		$form->printForm();
123
+	}
124 124
 }
Please login to merge, or discard this patch.
helper/staticmap.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -24,125 +24,125 @@
 block discarded – undo
24 24
  * @author Mark Prins
25 25
  */
26 26
 class helper_plugin_openlayersmap_staticmap extends DokuWiki_Plugin {
27
-    /** maximum width of the resulting image. */
28
-    private $maxWidth = 1024;
29
-    /** maximum heigth of the resulting image. */
30
-    private $maxHeight = 1024;
27
+	/** maximum width of the resulting image. */
28
+	private $maxWidth = 1024;
29
+	/** maximum heigth of the resulting image. */
30
+	private $maxHeight = 1024;
31 31
 
32
-    /**
33
-     * Provide metadata of the public methods of this class.
34
-     *
35
-     * @return array Information to all provided methods.
36
-     */
37
-    public function getMethods(): array {
38
-        $result   = array();
39
-        $result[] = array(
40
-            'name'   => 'getMap',
41
-            'desc'   => 'returns url to the image',
42
-            'params' => array(
43
-                'lat'     => 'float',
44
-                'lon'     => 'float',
45
-                'zoom'    => 'integer',
46
-                'size'    => 'string',
47
-                'maptype' => 'string',
48
-                'markers' => 'string',
49
-                'gpx'     => 'string',
50
-                'kml'     => 'string',
51
-                'geojson' => 'string',
52
-                'apikey'  => 'string'
53
-            ),
54
-            'return' => array('image' => 'string'),
55
-        );
56
-        return $result;
57
-    }
32
+	/**
33
+	 * Provide metadata of the public methods of this class.
34
+	 *
35
+	 * @return array Information to all provided methods.
36
+	 */
37
+	public function getMethods(): array {
38
+		$result   = array();
39
+		$result[] = array(
40
+			'name'   => 'getMap',
41
+			'desc'   => 'returns url to the image',
42
+			'params' => array(
43
+				'lat'     => 'float',
44
+				'lon'     => 'float',
45
+				'zoom'    => 'integer',
46
+				'size'    => 'string',
47
+				'maptype' => 'string',
48
+				'markers' => 'string',
49
+				'gpx'     => 'string',
50
+				'kml'     => 'string',
51
+				'geojson' => 'string',
52
+				'apikey'  => 'string'
53
+			),
54
+			'return' => array('image' => 'string'),
55
+		);
56
+		return $result;
57
+	}
58 58
 
59
-    /**
60
-     * Create the map.
61
-     *
62
-     * @param float  $lat     the latitude of the map's center, eg. 40.714728
63
-     * @param float  $lon     the longitude of the map's center, eg -73.998672
64
-     * @param int    $zoom    the zoom level in the tile cache, eg. 14
65
-     * @param string $size    the size in WxH px, eg. 512x512
66
-     * @param string $maptype the maptype, eg. cycle
67
-     * @param array  $markers associative array of markers, array('lat'=>$lat,'lon'=>$lon,'type'=>$iconStyle),
68
-     *                        eg. array('lat'=>40.702147,'lon'=>-74.015794,'type'=>lightblue1);
69
-     * @param string $gpx     media link
70
-     * @param string $kml     media link
71
-     * @param string $geojson media link
72
-     * @param string $apikey  optional API key eg. for Thunderforest maps
73
-     *
74
-     * @return string
75
-     */
76
-    public function getMap(
77
-        float $lat,
78
-        float $lon,
79
-        int $zoom,
80
-        string $size,
81
-        string $maptype,
82
-        array $markers,
83
-        string $gpx,
84
-        string $kml,
85
-        string $geojson,
86
-        string $apikey = ''
87
-    ): string {
88
-        global $conf;
89
-        // dbglog($markers,'helper_plugin_openlayersmap_staticmap::getMap: markers :');
59
+	/**
60
+	 * Create the map.
61
+	 *
62
+	 * @param float  $lat     the latitude of the map's center, eg. 40.714728
63
+	 * @param float  $lon     the longitude of the map's center, eg -73.998672
64
+	 * @param int    $zoom    the zoom level in the tile cache, eg. 14
65
+	 * @param string $size    the size in WxH px, eg. 512x512
66
+	 * @param string $maptype the maptype, eg. cycle
67
+	 * @param array  $markers associative array of markers, array('lat'=>$lat,'lon'=>$lon,'type'=>$iconStyle),
68
+	 *                        eg. array('lat'=>40.702147,'lon'=>-74.015794,'type'=>lightblue1);
69
+	 * @param string $gpx     media link
70
+	 * @param string $kml     media link
71
+	 * @param string $geojson media link
72
+	 * @param string $apikey  optional API key eg. for Thunderforest maps
73
+	 *
74
+	 * @return string
75
+	 */
76
+	public function getMap(
77
+		float $lat,
78
+		float $lon,
79
+		int $zoom,
80
+		string $size,
81
+		string $maptype,
82
+		array $markers,
83
+		string $gpx,
84
+		string $kml,
85
+		string $geojson,
86
+		string $apikey = ''
87
+	): string {
88
+		global $conf;
89
+		// dbglog($markers,'helper_plugin_openlayersmap_staticmap::getMap: markers :');
90 90
 
91
-        // normalize zoom
92
-        $zoom = $zoom ?: 0;
93
-        if($zoom > 18) {
94
-            $zoom = 18;
95
-        }
96
-        // normalize WxH
97
-        list($width, $height) = explode('x', $size);
98
-        $width = (int) $width;
99
-        if($width > $this->maxWidth) {
100
-            $width = $this->maxWidth;
101
-        }
102
-        $height = (int) $height;
103
-        if($height > $this->maxHeight) {
104
-            $height = $this->maxHeight;
105
-        }
91
+		// normalize zoom
92
+		$zoom = $zoom ?: 0;
93
+		if($zoom > 18) {
94
+			$zoom = 18;
95
+		}
96
+		// normalize WxH
97
+		list($width, $height) = explode('x', $size);
98
+		$width = (int) $width;
99
+		if($width > $this->maxWidth) {
100
+			$width = $this->maxWidth;
101
+		}
102
+		$height = (int) $height;
103
+		if($height > $this->maxHeight) {
104
+			$height = $this->maxHeight;
105
+		}
106 106
 
107
-        // cleanup/validate gpx/kml
108
-        $kml = $this->mediaIdToPath($kml);
109
-        // dbglog($kml,'helper_plugin_openlayersmap_staticmap::getMap: kml file:');
110
-        $gpx = $this->mediaIdToPath($gpx);
111
-        // dbglog($gpx,'helper_plugin_openlayersmap_staticmap::getMap: gpx file:');
112
-        $geojson = $this->mediaIdToPath($geojson);
107
+		// cleanup/validate gpx/kml
108
+		$kml = $this->mediaIdToPath($kml);
109
+		// dbglog($kml,'helper_plugin_openlayersmap_staticmap::getMap: kml file:');
110
+		$gpx = $this->mediaIdToPath($gpx);
111
+		// dbglog($gpx,'helper_plugin_openlayersmap_staticmap::getMap: gpx file:');
112
+		$geojson = $this->mediaIdToPath($geojson);
113 113
 
114
-        // create map
115
-        require_once DOKU_PLUGIN . 'openlayersmap/StaticMap.php';
116
-        $map = new StaticMap(
117
-            $lat, $lon, $zoom, $width, $height, $maptype,
118
-            $markers, $gpx, $kml, $geojson, $conf['mediadir'], $conf['cachedir'],
119
-            $this->getConf('autoZoomMap'), $apikey
120
-        );
114
+		// create map
115
+		require_once DOKU_PLUGIN . 'openlayersmap/StaticMap.php';
116
+		$map = new StaticMap(
117
+			$lat, $lon, $zoom, $width, $height, $maptype,
118
+			$markers, $gpx, $kml, $geojson, $conf['mediadir'], $conf['cachedir'],
119
+			$this->getConf('autoZoomMap'), $apikey
120
+		);
121 121
 
122
-        // return the media id url
123
-        // $mediaId = str_replace('/', ':', $map->getMap());
124
-        // if($this->startsWith($mediaId,':')) {
125
-        //     $mediaId = substr($mediaId, 1);
126
-        // }
127
-        // return $mediaId;
128
-        return str_replace('/', ':', $map->getMap());
129
-    }
122
+		// return the media id url
123
+		// $mediaId = str_replace('/', ':', $map->getMap());
124
+		// if($this->startsWith($mediaId,':')) {
125
+		//     $mediaId = substr($mediaId, 1);
126
+		// }
127
+		// return $mediaId;
128
+		return str_replace('/', ':', $map->getMap());
129
+	}
130 130
 
131
-    /**
132
-     * Constructs the path to a file.
133
-     * @param string $id the DW media id
134
-     * @return string the path to the file
135
-     */
136
-    private function mediaIdToPath(string $id): string {
137
-        global $conf;
138
-        if(empty($id)) {
139
-            return "";
140
-        }
141
-        $id = str_replace(array("[[", "]]"), "", $id);
142
-        if((strpos($id, ':') === 0)) {
143
-            $id = substr($id, 1);
144
-        }
145
-        $id = str_replace(":", "/", $id);
146
-        return $conf['mediadir'] . '/' . $id;
147
-    }
131
+	/**
132
+	 * Constructs the path to a file.
133
+	 * @param string $id the DW media id
134
+	 * @return string the path to the file
135
+	 */
136
+	private function mediaIdToPath(string $id): string {
137
+		global $conf;
138
+		if(empty($id)) {
139
+			return "";
140
+		}
141
+		$id = str_replace(array("[[", "]]"), "", $id);
142
+		if((strpos($id, ':') === 0)) {
143
+			$id = substr($id, 1);
144
+		}
145
+		$id = str_replace(":", "/", $id);
146
+		return $conf['mediadir'] . '/' . $id;
147
+	}
148 148
 }
Please login to merge, or discard this patch.
action.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -24,43 +24,43 @@
 block discarded – undo
24 24
  */
25 25
 class action_plugin_openlayersmap extends DokuWiki_Action_Plugin {
26 26
 
27
-    /**
28
-     * plugin should use this method to register its handlers with the DokuWiki's event controller
29
-     *
30
-     * @param    $controller DokuWiki's event controller object. Also available as global $EVENT_HANDLER
31
-     */
32
-    public function register(Doku_Event_Handler $controller) {
33
-        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insertButton', array());
34
-        $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'insertCSSSniffer');
35
-    }
27
+	/**
28
+	 * plugin should use this method to register its handlers with the DokuWiki's event controller
29
+	 *
30
+	 * @param    $controller DokuWiki's event controller object. Also available as global $EVENT_HANDLER
31
+	 */
32
+	public function register(Doku_Event_Handler $controller) {
33
+		$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insertButton', array());
34
+		$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'insertCSSSniffer');
35
+	}
36 36
 
37
-    /**
38
-     * Inserts the toolbar button.
39
-     * @param Doku_Event $event the DokuWiki event
40
-     */
41
-    public function insertButton(Doku_Event $event, $param) {
42
-        $strOpen       = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" ';
43
-        $strOpen       .= 'lon="5.1" zoom="12" statusbar="1" controls="1" poihoverstyle="0" ';
44
-        $strOpen       .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n';
45
-        $strOpen       .= '~~ Plugin olmap help.\n';
46
-        $strOpen       .= '~~ Required in the above tag are values for: id (unique on this page), width, heigth.\n';
47
-        $strOpen       .= '~~ Also you will want to enter zoomlevel and lat, lon values that make sense for where you';
48
-        $strOpen       .= '~~ want the map to start.\n\n';
49
-        $strOpen       .= '~~ Below is an example of a POI, you can add as many as you want. ';
50
-        $strOpen       .= '~~ More examples: https://dokuwiki.org/plugin:openlayersmap \n';
51
-        $event->data[] = array(
52
-            'type'   => 'format',
53
-            'title'  => $this->getLang('openlayersmap'),
54
-            'icon'   => '../../plugins/openlayersmap/toolbar/map.png',
55
-            'open'   => $strOpen,
56
-            'sample' => '50.0117,5.1287,-90,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\\\ external link: 
37
+	/**
38
+	 * Inserts the toolbar button.
39
+	 * @param Doku_Event $event the DokuWiki event
40
+	 */
41
+	public function insertButton(Doku_Event $event, $param) {
42
+		$strOpen       = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" ';
43
+		$strOpen       .= 'lon="5.1" zoom="12" statusbar="1" controls="1" poihoverstyle="0" ';
44
+		$strOpen       .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n';
45
+		$strOpen       .= '~~ Plugin olmap help.\n';
46
+		$strOpen       .= '~~ Required in the above tag are values for: id (unique on this page), width, heigth.\n';
47
+		$strOpen       .= '~~ Also you will want to enter zoomlevel and lat, lon values that make sense for where you';
48
+		$strOpen       .= '~~ want the map to start.\n\n';
49
+		$strOpen       .= '~~ Below is an example of a POI, you can add as many as you want. ';
50
+		$strOpen       .= '~~ More examples: https://dokuwiki.org/plugin:openlayersmap \n';
51
+		$event->data[] = array(
52
+			'type'   => 'format',
53
+			'title'  => $this->getLang('openlayersmap'),
54
+			'icon'   => '../../plugins/openlayersmap/toolbar/map.png',
55
+			'open'   => $strOpen,
56
+			'sample' => '50.0117,5.1287,-90,.8,marker-green.png,Pont de Barbouillons; Daverdisse \\\\ external link: 
57 57
                         [[https://test.com|test.com]] \\\\ internal link: [[::start]]\\\\ **DW Formatting** \n',
58
-            'close'  => '</olmap>\n',
59
-        );
60
-    }
58
+			'close'  => '</olmap>\n',
59
+		);
60
+	}
61 61
 
62
-    /** add a snippet of javascript into the head to do a css operation we can check for later on.*/
63
-    public function insertCSSSniffer(Doku_Event $event, $param) {
64
-        $event->data["script"][] = array("_data" => "document.documentElement.className += ' olCSSsupported';");
65
-    }
62
+	/** add a snippet of javascript into the head to do a css operation we can check for later on.*/
63
+	public function insertCSSSniffer(Doku_Event $event, $param) {
64
+		$event->data["script"][] = array("_data" => "document.documentElement.className += ' olCSSsupported';");
65
+	}
66 66
 }
Please login to merge, or discard this patch.
syntax/osmlayer.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -22,110 +22,110 @@
 block discarded – undo
22 22
  */
23 23
 class syntax_plugin_openlayersmap_osmlayer extends DokuWiki_Syntax_Plugin
24 24
 {
25
-    private $dflt = array(
26
-        'id'          => 'olmap',
27
-        'name'        => '',
28
-        'url'         => '',
29
-        'opacity'     => 0.8,
30
-        'attribution' => '',
31
-        'visible'     => false,
32
-        'cors'        => null
33
-    );
25
+	private $dflt = array(
26
+		'id'          => 'olmap',
27
+		'name'        => '',
28
+		'url'         => '',
29
+		'opacity'     => 0.8,
30
+		'attribution' => '',
31
+		'visible'     => false,
32
+		'cors'        => null
33
+	);
34 34
 
35
-    /**
36
-     * (non-PHPdoc)
37
-     *
38
-     * @see DokuWiki_Syntax_Plugin::getPType()
39
-     */
40
-    public function getPType(): string
41
-    {
42
-        return 'block';
43
-    }
35
+	/**
36
+	 * (non-PHPdoc)
37
+	 *
38
+	 * @see DokuWiki_Syntax_Plugin::getPType()
39
+	 */
40
+	public function getPType(): string
41
+	{
42
+		return 'block';
43
+	}
44 44
 
45
-    /**
46
-     * (non-PHPdoc)
47
-     *
48
-     * @see DokuWiki_Syntax_Plugin::getType()
49
-     */
50
-    public function getType(): string
51
-    {
52
-        // return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
53
-        return 'baseonly';
54
-    }
45
+	/**
46
+	 * (non-PHPdoc)
47
+	 *
48
+	 * @see DokuWiki_Syntax_Plugin::getType()
49
+	 */
50
+	public function getType(): string
51
+	{
52
+		// return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
53
+		return 'baseonly';
54
+	}
55 55
 
56
-    /**
57
-     * (non-PHPdoc)
58
-     *
59
-     * @see Doku_Parser_Mode::getSort()
60
-     */
61
-    public function getSort(): int
62
-    {
63
-        return 902;
64
-    }
56
+	/**
57
+	 * (non-PHPdoc)
58
+	 *
59
+	 * @see Doku_Parser_Mode::getSort()
60
+	 */
61
+	public function getSort(): int
62
+	{
63
+		return 902;
64
+	}
65 65
 
66
-    /**
67
-     * Connect to our special pattern.
68
-     *
69
-     * @see Doku_Parser_Mode::connectTo()
70
-     */
71
-    public function connectTo($mode): void
72
-    {
73
-        // look for: <olmap_osmlayer id="olmap" name="sport" url="http://tiles.openseamap.org/sport/${z}/${x}/${y}.png"
74
-        // visible="false" opacity=0.6 attribution="Some attribution"></olmap_osmlayer>
75
-        $this->Lexer->addSpecialPattern(
76
-            '<olmap_osmlayer ?[^>\n]*>.*?</olmap_osmlayer>',
77
-            $mode,
78
-            'plugin_openlayersmap_osmlayer'
79
-        );
80
-    }
66
+	/**
67
+	 * Connect to our special pattern.
68
+	 *
69
+	 * @see Doku_Parser_Mode::connectTo()
70
+	 */
71
+	public function connectTo($mode): void
72
+	{
73
+		// look for: <olmap_osmlayer id="olmap" name="sport" url="http://tiles.openseamap.org/sport/${z}/${x}/${y}.png"
74
+		// visible="false" opacity=0.6 attribution="Some attribution"></olmap_osmlayer>
75
+		$this->Lexer->addSpecialPattern(
76
+			'<olmap_osmlayer ?[^>\n]*>.*?</olmap_osmlayer>',
77
+			$mode,
78
+			'plugin_openlayersmap_osmlayer'
79
+		);
80
+	}
81 81
 
82
-    /**
83
-     * (non-PHPdoc)
84
-     *
85
-     * @see DokuWiki_Syntax_Plugin::handle()
86
-     */
87
-    public function handle($match, $state, $pos, Doku_Handler $handler): array
88
-    {
89
-        $param = array();
90
-        $data  = $this->dflt;
82
+	/**
83
+	 * (non-PHPdoc)
84
+	 *
85
+	 * @see DokuWiki_Syntax_Plugin::handle()
86
+	 */
87
+	public function handle($match, $state, $pos, Doku_Handler $handler): array
88
+	{
89
+		$param = array();
90
+		$data  = $this->dflt;
91 91
 
92
-        preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
92
+		preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
93 93
 
94
-        foreach ($param as $kvpair) {
95
-            list ($matched, $key, $val) = $kvpair;
96
-            if (isset ($data [$key])) {
97
-                $key         = strtolower($key);
98
-                $data [$key] = $val;
99
-            }
100
-        }
101
-        // dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:');
102
-        return $data;
103
-    }
94
+		foreach ($param as $kvpair) {
95
+			list ($matched, $key, $val) = $kvpair;
96
+			if (isset ($data [$key])) {
97
+				$key         = strtolower($key);
98
+				$data [$key] = $val;
99
+			}
100
+		}
101
+		// dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:');
102
+		return $data;
103
+	}
104 104
 
105
-    /**
106
-     * (non-PHPdoc)
107
-     *
108
-     * @see DokuWiki_Syntax_Plugin::render()
109
-     */
110
-    public function render($format, Doku_Renderer $renderer, $data): bool
111
-    {
112
-        if ($format !== 'xhtml') {
113
-            return false;
114
-        }
105
+	/**
106
+	 * (non-PHPdoc)
107
+	 *
108
+	 * @see DokuWiki_Syntax_Plugin::render()
109
+	 */
110
+	public function render($format, Doku_Renderer $renderer, $data): bool
111
+	{
112
+		if ($format !== 'xhtml') {
113
+			return false;
114
+		}
115 115
 
116
-        // incremented for each olmap_osmlayer tag in the page source
117
-        static $overlaynumber = 0;
116
+		// incremented for each olmap_osmlayer tag in the page source
117
+		static $overlaynumber = 0;
118 118
 
119
-        list ($id, $url, $name, $visible) = $data;
120
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
121
-        $str           = '{';
122
-        foreach ($data as $key => $val) {
123
-            $str .= "'" . $key . "' : '" . $val . "',";
124
-        }
125
-        $str           .= '"type":"osm"}';
126
-        $renderer->doc .= base64_encode("olMapOverlays['osm" . $overlaynumber . "'] = " . $str . ";")
127
-            . '"></script>';
128
-        $overlaynumber++;
129
-        return true;
130
-    }
119
+		list ($id, $url, $name, $visible) = $data;
120
+		$renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
121
+		$str           = '{';
122
+		foreach ($data as $key => $val) {
123
+			$str .= "'" . $key . "' : '" . $val . "',";
124
+		}
125
+		$str           .= '"type":"osm"}';
126
+		$renderer->doc .= base64_encode("olMapOverlays['osm" . $overlaynumber . "'] = " . $str . ";")
127
+			. '"></script>';
128
+		$overlaynumber++;
129
+		return true;
130
+	}
131 131
 }
Please login to merge, or discard this patch.
syntax/agslayer.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -22,114 +22,114 @@
 block discarded – undo
22 22
  */
23 23
 class syntax_plugin_openlayersmap_agslayer extends DokuWiki_Syntax_Plugin
24 24
 {
25
-    private $dflt = array(
26
-        'id'          => 'olmap',
27
-        'name'        => '',
28
-        'url'         => '',
29
-        'opacity'     => 0.8,
30
-        'attribution' => '',
31
-        'visible'     => false,
32
-        'layers'      => '',
33
-        'format'      => 'png',
34
-        'transparent' => 'true'
35
-    );
25
+	private $dflt = array(
26
+		'id'          => 'olmap',
27
+		'name'        => '',
28
+		'url'         => '',
29
+		'opacity'     => 0.8,
30
+		'attribution' => '',
31
+		'visible'     => false,
32
+		'layers'      => '',
33
+		'format'      => 'png',
34
+		'transparent' => 'true'
35
+	);
36 36
 
37
-    /**
38
-     * (non-PHPdoc)
39
-     *
40
-     * @see DokuWiki_Syntax_Plugin::getPType()
41
-     */
42
-    public function getPType(): string
43
-    {
44
-        return 'block';
45
-    }
37
+	/**
38
+	 * (non-PHPdoc)
39
+	 *
40
+	 * @see DokuWiki_Syntax_Plugin::getPType()
41
+	 */
42
+	public function getPType(): string
43
+	{
44
+		return 'block';
45
+	}
46 46
 
47
-    /**
48
-     * (non-PHPdoc)
49
-     *
50
-     * @see DokuWiki_Syntax_Plugin::getType()
51
-     */
52
-    public function getType(): string
53
-    {
54
-        // return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
55
-        return 'baseonly';
56
-    }
47
+	/**
48
+	 * (non-PHPdoc)
49
+	 *
50
+	 * @see DokuWiki_Syntax_Plugin::getType()
51
+	 */
52
+	public function getType(): string
53
+	{
54
+		// return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
55
+		return 'baseonly';
56
+	}
57 57
 
58
-    /**
59
-     * (non-PHPdoc)
60
-     *
61
-     * @see Doku_Parser_Mode::getSort()
62
-     */
63
-    public function getSort(): int
64
-    {
65
-        return 904;
66
-    }
58
+	/**
59
+	 * (non-PHPdoc)
60
+	 *
61
+	 * @see Doku_Parser_Mode::getSort()
62
+	 */
63
+	public function getSort(): int
64
+	{
65
+		return 904;
66
+	}
67 67
 
68
-    /**
69
-     * Connect to our special pattern.
70
-     *
71
-     * @see Doku_Parser_Mode::connectTo()
72
-     */
73
-    public function connectTo($mode): void
74
-    {
75
-        // look for: <olmap_agslayer id="olmap" name="cloud"
76
-        // url="http://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer/export"
77
-        // attribution="wallonie.be" visible="true" layers="show:0,1,2,3,4,7"></olmap_agslayer>
78
-        // sample:
79
-        // http://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer/export?LAYERS=show%3A0%2C1%2C2%2C3%2C4%2C7&TRANSPARENT=true&FORMAT=png&BBOX=643294.029959%2C6467184.088252%2C645740.014863%2C6469630.073157&SIZE=256%2C256&F=html&BBOXSR=3857&IMAGESR=3857
80
-        $this->Lexer->addSpecialPattern(
81
-            '<olmap_agslayer ?[^>\n]*>.*?</olmap_agslayer>',
82
-            $mode,
83
-            'plugin_openlayersmap_agslayer'
84
-        );
85
-    }
68
+	/**
69
+	 * Connect to our special pattern.
70
+	 *
71
+	 * @see Doku_Parser_Mode::connectTo()
72
+	 */
73
+	public function connectTo($mode): void
74
+	{
75
+		// look for: <olmap_agslayer id="olmap" name="cloud"
76
+		// url="http://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer/export"
77
+		// attribution="wallonie.be" visible="true" layers="show:0,1,2,3,4,7"></olmap_agslayer>
78
+		// sample:
79
+		// http://geoservices2.wallonie.be/arcgis/rest/services/APP_KAYAK/KAYAK/MapServer/export?LAYERS=show%3A0%2C1%2C2%2C3%2C4%2C7&TRANSPARENT=true&FORMAT=png&BBOX=643294.029959%2C6467184.088252%2C645740.014863%2C6469630.073157&SIZE=256%2C256&F=html&BBOXSR=3857&IMAGESR=3857
80
+		$this->Lexer->addSpecialPattern(
81
+			'<olmap_agslayer ?[^>\n]*>.*?</olmap_agslayer>',
82
+			$mode,
83
+			'plugin_openlayersmap_agslayer'
84
+		);
85
+	}
86 86
 
87
-    /**
88
-     * (non-PHPdoc)
89
-     *
90
-     * @see DokuWiki_Syntax_Plugin::handle()
91
-     */
92
-    public function handle($match, $state, $pos, Doku_Handler $handler): array
93
-    {
94
-        $param = array();
95
-        $data  = $this->dflt;
87
+	/**
88
+	 * (non-PHPdoc)
89
+	 *
90
+	 * @see DokuWiki_Syntax_Plugin::handle()
91
+	 */
92
+	public function handle($match, $state, $pos, Doku_Handler $handler): array
93
+	{
94
+		$param = array();
95
+		$data  = $this->dflt;
96 96
 
97
-        preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
97
+		preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
98 98
 
99
-        foreach ($param as $kvpair) {
100
-            list ($matched, $key, $val) = $kvpair;
101
-            if (isset ($data [$key])) {
102
-                $key         = strtolower($key);
103
-                $data [$key] = $val;
104
-            }
105
-        }
106
-        return $data;
107
-    }
99
+		foreach ($param as $kvpair) {
100
+			list ($matched, $key, $val) = $kvpair;
101
+			if (isset ($data [$key])) {
102
+				$key         = strtolower($key);
103
+				$data [$key] = $val;
104
+			}
105
+		}
106
+		return $data;
107
+	}
108 108
 
109
-    /**
110
-     * (non-PHPdoc)
111
-     *
112
-     * @see DokuWiki_Syntax_Plugin::render()
113
-     */
114
-    public function render($format, Doku_Renderer $renderer, $data): bool
115
-    {
116
-        if ($format !== 'xhtml') {
117
-            return false;
118
-        }
109
+	/**
110
+	 * (non-PHPdoc)
111
+	 *
112
+	 * @see DokuWiki_Syntax_Plugin::render()
113
+	 */
114
+	public function render($format, Doku_Renderer $renderer, $data): bool
115
+	{
116
+		if ($format !== 'xhtml') {
117
+			return false;
118
+		}
119 119
 
120
-        // incremented for each olmap_agslayer tag in the page source
121
-        static $overlaynumber = 0;
120
+		// incremented for each olmap_agslayer tag in the page source
121
+		static $overlaynumber = 0;
122 122
 
123
-        list ($id, $url, $name, $visible) = $data;
124
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
125
-        $str           = '{';
126
-        foreach ($data as $key => $val) {
127
-            $str .= "'" . $key . "' : '" . $val . "',";
128
-        }
129
-        $str           .= "'type':'ags'}";
130
-        $renderer->doc .= base64_encode("olMapOverlays['ags" . $overlaynumber . "'] = " . $str . ";")
131
-            . '"></script>';
132
-        $overlaynumber++;
133
-        return true;
134
-    }
123
+		list ($id, $url, $name, $visible) = $data;
124
+		$renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
125
+		$str           = '{';
126
+		foreach ($data as $key => $val) {
127
+			$str .= "'" . $key . "' : '" . $val . "',";
128
+		}
129
+		$str           .= "'type':'ags'}";
130
+		$renderer->doc .= base64_encode("olMapOverlays['ags" . $overlaynumber . "'] = " . $str . ";")
131
+			. '"></script>';
132
+		$overlaynumber++;
133
+		return true;
134
+	}
135 135
 }
Please login to merge, or discard this patch.
syntax/wmslayer.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -22,113 +22,113 @@
 block discarded – undo
22 22
  */
23 23
 class syntax_plugin_openlayersmap_wmslayer extends DokuWiki_Syntax_Plugin
24 24
 {
25
-    private $dflt = array(
26
-        'id'          => 'olmap',
27
-        'name'        => '',
28
-        'url'         => '',
29
-        'opacity'     => 0.8,
30
-        'attribution' => '',
31
-        'visible'     => false,
32
-        'layers'      => '',
33
-        'version'     => '1.3.0',
34
-        'format'      => 'image/png',
35
-        'transparent' => 'true'
36
-    );
25
+	private $dflt = array(
26
+		'id'          => 'olmap',
27
+		'name'        => '',
28
+		'url'         => '',
29
+		'opacity'     => 0.8,
30
+		'attribution' => '',
31
+		'visible'     => false,
32
+		'layers'      => '',
33
+		'version'     => '1.3.0',
34
+		'format'      => 'image/png',
35
+		'transparent' => 'true'
36
+	);
37 37
 
38
-    /**
39
-     * (non-PHPdoc)
40
-     *
41
-     * @see DokuWiki_Syntax_Plugin::getPType()
42
-     */
43
-    public function getPType(): string
44
-    {
45
-        return 'block';
46
-    }
38
+	/**
39
+	 * (non-PHPdoc)
40
+	 *
41
+	 * @see DokuWiki_Syntax_Plugin::getPType()
42
+	 */
43
+	public function getPType(): string
44
+	{
45
+		return 'block';
46
+	}
47 47
 
48
-    /**
49
-     * (non-PHPdoc)
50
-     *
51
-     * @see DokuWiki_Syntax_Plugin::getType()
52
-     */
53
-    public function getType(): string
54
-    {
55
-        // return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
56
-        return 'baseonly';
57
-    }
48
+	/**
49
+	 * (non-PHPdoc)
50
+	 *
51
+	 * @see DokuWiki_Syntax_Plugin::getType()
52
+	 */
53
+	public function getType(): string
54
+	{
55
+		// return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
56
+		return 'baseonly';
57
+	}
58 58
 
59
-    /**
60
-     * (non-PHPdoc)
61
-     *
62
-     * @see Doku_Parser_Mode::getSort()
63
-     */
64
-    public function getSort(): int
65
-    {
66
-        return 902;
67
-    }
59
+	/**
60
+	 * (non-PHPdoc)
61
+	 *
62
+	 * @see Doku_Parser_Mode::getSort()
63
+	 */
64
+	public function getSort(): int
65
+	{
66
+		return 902;
67
+	}
68 68
 
69
-    /**
70
-     * Connect to our special pattern.
71
-     *
72
-     * @see Doku_Parser_Mode::connectTo()
73
-     */
74
-    public function connectTo($mode): void
75
-    {
76
-        // look for: <olmap_wmslayer id="olmap" name="cloud" url="http://openweathermap.org/t/tile.cgi?SERVICE=WMS"
77
-        // attribution="OpenWeatherMap" visible="true" layers="GLBETA_PR"></olmap_wmslayer>
78
-        $this->Lexer->addSpecialPattern(
79
-            '<olmap_wmslayer ?[^>\n]*>.*?</olmap_wmslayer>',
80
-            $mode,
81
-            'plugin_openlayersmap_wmslayer'
82
-        );
83
-    }
69
+	/**
70
+	 * Connect to our special pattern.
71
+	 *
72
+	 * @see Doku_Parser_Mode::connectTo()
73
+	 */
74
+	public function connectTo($mode): void
75
+	{
76
+		// look for: <olmap_wmslayer id="olmap" name="cloud" url="http://openweathermap.org/t/tile.cgi?SERVICE=WMS"
77
+		// attribution="OpenWeatherMap" visible="true" layers="GLBETA_PR"></olmap_wmslayer>
78
+		$this->Lexer->addSpecialPattern(
79
+			'<olmap_wmslayer ?[^>\n]*>.*?</olmap_wmslayer>',
80
+			$mode,
81
+			'plugin_openlayersmap_wmslayer'
82
+		);
83
+	}
84 84
 
85
-    /**
86
-     * (non-PHPdoc)
87
-     *
88
-     * @see DokuWiki_Syntax_Plugin::handle()
89
-     */
90
-    public function handle($match, $state, $pos, Doku_Handler $handler): array
91
-    {
92
-        $param = array();
93
-        $data  = $this->dflt;
85
+	/**
86
+	 * (non-PHPdoc)
87
+	 *
88
+	 * @see DokuWiki_Syntax_Plugin::handle()
89
+	 */
90
+	public function handle($match, $state, $pos, Doku_Handler $handler): array
91
+	{
92
+		$param = array();
93
+		$data  = $this->dflt;
94 94
 
95
-        preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
95
+		preg_match_all('/(\w*)="(.*?)"/us', $match, $param, PREG_SET_ORDER);
96 96
 
97
-        foreach ($param as $kvpair) {
98
-            list ($matched, $key, $val) = $kvpair;
99
-            if (isset ($data [$key])) {
100
-                $key         = strtolower($key);
101
-                $data [$key] = $val;
102
-            }
103
-        }
104
-        // dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:');
105
-        return $data;
106
-    }
97
+		foreach ($param as $kvpair) {
98
+			list ($matched, $key, $val) = $kvpair;
99
+			if (isset ($data [$key])) {
100
+				$key         = strtolower($key);
101
+				$data [$key] = $val;
102
+			}
103
+		}
104
+		// dbglog($data,'syntax_plugin_overlayer::handle: parsed data is:');
105
+		return $data;
106
+	}
107 107
 
108
-    /**
109
-     * (non-PHPdoc)
110
-     *
111
-     * @see DokuWiki_Syntax_Plugin::render()
112
-     */
113
-    public function render($format, Doku_Renderer $renderer, $data): bool
114
-    {
115
-        if ($format !== 'xhtml') {
116
-            return false;
117
-        }
108
+	/**
109
+	 * (non-PHPdoc)
110
+	 *
111
+	 * @see DokuWiki_Syntax_Plugin::render()
112
+	 */
113
+	public function render($format, Doku_Renderer $renderer, $data): bool
114
+	{
115
+		if ($format !== 'xhtml') {
116
+			return false;
117
+		}
118 118
 
119
-        // incremented for each olmap_wmslayer tag in the page source
120
-        static $overlaynumber = 0;
119
+		// incremented for each olmap_wmslayer tag in the page source
120
+		static $overlaynumber = 0;
121 121
 
122
-        list ($id, $url, $name, $visible) = $data;
123
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
124
-        $str           = '{';
125
-        foreach ($data as $key => $val) {
126
-            $str .= "'" . $key . "' : '" . $val . "',";
127
-        }
128
-        $str           .= "'type':'wms'}";
129
-        $renderer->doc .= base64_encode("olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";")
130
-            . '"></script>';
131
-        $overlaynumber++;
132
-        return true;
133
-    }
122
+		list ($id, $url, $name, $visible) = $data;
123
+		$renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
124
+		$str           = '{';
125
+		foreach ($data as $key => $val) {
126
+			$str .= "'" . $key . "' : '" . $val . "',";
127
+		}
128
+		$str           .= "'type':'wms'}";
129
+		$renderer->doc .= base64_encode("olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";")
130
+			. '"></script>';
131
+		$overlaynumber++;
132
+		return true;
133
+	}
134 134
 }
135 135
\ No newline at end of file
Please login to merge, or discard this patch.