@@ -74,21 +74,21 @@ discard block |
||
74 | 74 | preg_match("(hide|unhide)", $tags, $hide); |
75 | 75 | |
76 | 76 | $showlocation = $this->getConf('geotag_location_prefix'); |
77 | - if($this->getConf('geotag_showlocation')) { |
|
77 | + if ($this->getConf('geotag_showlocation')) { |
|
78 | 78 | $showlocation = trim(substr($placename [0], 10)); |
79 | - if(strlen($showlocation) < 1) { |
|
79 | + if (strlen($showlocation) < 1) { |
|
80 | 80 | $showlocation = $this->getConf('geotag_location_prefix'); |
81 | 81 | } |
82 | 82 | } |
83 | 83 | // read config for system setting |
84 | 84 | $style = ''; |
85 | - if($this->getConf('geotag_hide')) { |
|
85 | + if ($this->getConf('geotag_hide')) { |
|
86 | 86 | $style = ' style="display: none;"'; |
87 | 87 | } |
88 | 88 | // override config for the current tag |
89 | - if(array_key_exists(0, $hide) && trim($hide [0]) == 'hide') { |
|
89 | + if (array_key_exists(0, $hide) && trim($hide [0]) == 'hide') { |
|
90 | 90 | $style = ' style="display: none;"'; |
91 | - } elseif(array_key_exists(0, $hide) && trim($hide [0]) == 'unhide') { |
|
91 | + } elseif (array_key_exists(0, $hide) && trim($hide [0]) == 'unhide') { |
|
92 | 92 | $style = ''; |
93 | 93 | } |
94 | 94 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @param float $lon |
114 | 114 | */ |
115 | 115 | private function geohash($lat, $lon) { |
116 | - if(!$geophp = plugin_load('helper', 'geophp')) { |
|
116 | + if (!$geophp = plugin_load('helper', 'geophp')) { |
|
117 | 117 | dbglog($geophp, 'syntax_plugin_geotag_geotag::geohash: geophp plugin is not available.'); |
118 | 118 | return ""; |
119 | 119 | } |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | * @see DokuWiki_Syntax_Plugin::render() |
129 | 129 | */ |
130 | 130 | public function render($mode, Doku_Renderer $renderer, $data) { |
131 | - if($data === false) { |
|
131 | + if ($data === false) { |
|
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | list ($lat, $lon, $alt, $geohash, $region, $placename, $country, $showlocation, $style) = $data; |
135 | 135 | $ddlat = $lat; |
136 | 136 | $ddlon = $lon; |
137 | - if($this->getConf('displayformat') === 'DMS') { |
|
137 | + if ($this->getConf('displayformat') === 'DMS') { |
|
138 | 138 | $lat = $this->convertLat($lat); |
139 | 139 | $lon = $this->convertLon($lon); |
140 | 140 | } else { |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | $lon .= 'º'; |
143 | 143 | } |
144 | 144 | |
145 | - if($mode == 'xhtml') { |
|
146 | - if($this->getConf('geotag_prevent_microformat_render')) { |
|
145 | + if ($mode == 'xhtml') { |
|
146 | + if ($this->getConf('geotag_prevent_microformat_render')) { |
|
147 | 147 | return true; |
148 | 148 | } |
149 | 149 | $searchPre = ''; |
150 | 150 | $searchPost = ''; |
151 | - if($this->getConf('geotag_showsearch')) { |
|
152 | - if($spHelper = &plugin_load('helper', 'spatialhelper_search')) { |
|
151 | + if ($this->getConf('geotag_showsearch')) { |
|
152 | + if ($spHelper = &plugin_load('helper', 'spatialhelper_search')) { |
|
153 | 153 | $title = $this->getLang('findnearby') . ' ' . $placename; |
154 | 154 | $url = wl( |
155 | 155 | getID(), array( |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | . $lat . '</span>;'; |
174 | 174 | $renderer->doc .= '<span class="p-longitude longitude" itemprop="longitude" data-longitude="' . $ddlon |
175 | 175 | . '">' . $lon . '</span>'; |
176 | - if(!empty ($alt)) { |
|
176 | + if (!empty ($alt)) { |
|
177 | 177 | $renderer->doc .= ', <span class="p-altitude altitude" itemprop="elevation" data-altitude="' . $alt |
178 | 178 | . '">' . $alt . 'm</span>'; |
179 | 179 | } |
180 | 180 | $renderer->doc .= '</span>' . $searchPost . '</div>' . DOKU_LF; |
181 | 181 | return true; |
182 | - } elseif($mode == 'metadata') { |
|
182 | + } elseif ($mode == 'metadata') { |
|
183 | 183 | // render metadata (our action plugin will put it in the page head) |
184 | 184 | $renderer->meta ['geo'] ['lat'] = $ddlat; |
185 | 185 | $renderer->meta ['geo'] ['lon'] = $ddlon; |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | $renderer->meta ['geo'] ['region'] = $region; |
188 | 188 | $renderer->meta ['geo'] ['country'] = $country; |
189 | 189 | $renderer->meta ['geo'] ['geohash'] = $geohash; |
190 | - if(!empty ($alt)) { |
|
190 | + if (!empty ($alt)) { |
|
191 | 191 | $renderer->meta ['geo'] ['alt'] = $alt; |
192 | 192 | } |
193 | 193 | return true; |
194 | - } elseif($mode == 'odt') { |
|
195 | - if(!empty ($alt)) { |
|
194 | + } elseif ($mode == 'odt') { |
|
195 | + if (!empty ($alt)) { |
|
196 | 196 | $alt = ', ' . $alt . 'm'; |
197 | 197 | } |
198 | 198 | $renderer->p_open(); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @todo move this into a shared library |
216 | 216 | */ |
217 | 217 | private function convertLat($decimaldegrees) { |
218 | - if(strpos($decimaldegrees, '-') !== false) { |
|
218 | + if (strpos($decimaldegrees, '-') !== false) { |
|
219 | 219 | $latPos = "S"; |
220 | 220 | } else { |
221 | 221 | $latPos = "N"; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $secs = ($decimaldegrees - $dms) * 3600; |
237 | 237 | $min = floor($secs / 60); |
238 | 238 | $sec = round($secs - ($min * 60), 3); |
239 | - $dms .= 'º' . $min . '\'' . $sec . '"'; |
|
239 | + $dms .= 'º' . $min . '\'' . $sec . '"'; |
|
240 | 240 | return $dms; |
241 | 241 | } |
242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * @todo move this into a shared library |
249 | 249 | */ |
250 | 250 | private function convertLon($decimaldegrees) { |
251 | - if(strpos($decimaldegrees, '-') !== false) { |
|
251 | + if (strpos($decimaldegrees, '-') !== false) { |
|
252 | 252 | $lonPos = "W"; |
253 | 253 | } else { |
254 | 254 | $lonPos = "E"; |