@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | |
51 | 51 | $verbose = false; |
52 | 52 | $force = false; |
53 | - foreach($data as $val) { |
|
53 | + foreach ($data as $val) { |
|
54 | 54 | idx_addPage($val['id'], $verbose, $force); |
55 | 55 | } |
56 | - if($conf['allowdebug']) { |
|
56 | + if ($conf['allowdebug']) { |
|
57 | 57 | touch(DOKU_TMP_DATA . 'cache/debug.log'); |
58 | 58 | } |
59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | global $conf; |
65 | 65 | // try to get the debug log after running the test, print and clear |
66 | - if($conf['allowdebug']) { |
|
66 | + if ($conf['allowdebug']) { |
|
67 | 67 | print "\n"; |
68 | 68 | readfile(DOKU_TMP_DATA . 'cache/debug.log'); |
69 | 69 | unlink(DOKU_TMP_DATA . 'cache/debug.log'); |
@@ -26,5 +26,5 @@ |
||
26 | 26 | $lang['geotag_hide'] = 'Verstecken Geotag (css)'; |
27 | 27 | $lang['geotag_prevent_microformat_render'] = 'Verhindern Rendering Geotag Mikroformat'; |
28 | 28 | $lang['toolbar_icon'] = 'Toolbar-Symbol anzeigen'; |
29 | -$lang['geotag_showsearch'] = 'Geotag verknüpfen an Suchen in der Nähe (spatialhelper plugin erforderlich)'; |
|
29 | +$lang['geotag_showsearch'] = 'Geotag verknüpfen an Suchen in der Nähe (spatialhelper plugin erforderlich)'; |
|
30 | 30 | $lang['displayformat'] = 'Koordinaten Anzeigeformat; Dezimalgrad oder Grad, Minuten, Sekunden '; |
@@ -27,4 +27,4 @@ |
||
27 | 27 | $lang['geotag_prevent_microformat_render'] = 'Voorkom geotag microformat rendering'; |
28 | 28 | $lang['toolbar_icon'] = 'Toon toolbar icon'; |
29 | 29 | $lang['geotag_showsearch'] = 'Link geotag als zoekactie (spatialhelper plugin benodigd)'; |
30 | -$lang['displayformat'] = 'Coördinaten weergave formaat; decimale graden of graden, minuten, seconden'; |
|
30 | +$lang['displayformat'] = 'Coördinaten weergave formaat; decimale graden of graden, minuten, seconden'; |
@@ -22,9 +22,9 @@ |
||
22 | 22 | * @author Aleksej Kozlov <[email protected]> |
23 | 23 | */ |
24 | 24 | $lang['geotag_location_prefix'] = 'Текст, по умолчанию показываемый перед геотегом'; |
25 | -$lang['geotag_showlocation'] = 'Показывать название местоположения в геотеге (вместо текста по умолчанию)'; |
|
25 | +$lang['geotag_showlocation'] = 'Показывать название местоположения в геотеге (вместо текста по умолчанию)'; |
|
26 | 26 | $lang['geotag_hide'] = 'Прятать геотег (средствами css)'; |
27 | 27 | $lang['geotag_prevent_microformat_render'] = 'Запретить рендеринг микроформата геотега'; |
28 | 28 | $lang['toolbar_icon'] = 'Показывать иконку'; |
29 | -$lang['geotag_showsearch'] = 'Геотег является ссылкой на страницу поиска около точки (нужен плагин spatialhelper)'; |
|
30 | -$lang['displayformat'] = 'Формат отображения координат: DD - градусы с дробной частью, DMS - градусы, минуты, секунды'; |
|
29 | +$lang['geotag_showsearch'] = 'Геотег является ссылкой на страницу поиска около точки (нужен плагин spatialhelper)'; |
|
30 | +$lang['displayformat'] = 'Формат отображения координат: DD - градусы с дробной частью, DMS - градусы, минуты, секунды'; |
@@ -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"; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function register(Doku_Event_Handler $controller) { |
33 | 33 | $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'handleMetaheaderOutput'); |
34 | - if($this->getConf('toolbar_icon')) { |
|
34 | + if ($this->getConf('toolbar_icon')) { |
|
35 | 35 | $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insertButton', array()); |
36 | 36 | } |
37 | 37 | $controller->register_hook('PLUGIN_POPULARITY_DATA_SETUP', 'AFTER', $this, 'popularity'); |
@@ -58,20 +58,20 @@ discard block |
||
58 | 58 | $placename = $geotags ['placename'] ?? NULL; |
59 | 59 | $geohash = $geotags ['geohash'] ?? NULL; |
60 | 60 | |
61 | - if(!empty ($region)) { |
|
61 | + if (!empty ($region)) { |
|
62 | 62 | $event->data ['meta'] [] = array( |
63 | 63 | 'name' => 'geo.region', |
64 | 64 | 'content' => $region |
65 | 65 | ); |
66 | 66 | } |
67 | - if(!empty ($placename)) { |
|
67 | + if (!empty ($placename)) { |
|
68 | 68 | $event->data ['meta'] [] = array( |
69 | 69 | 'name' => 'geo.placename', |
70 | 70 | 'content' => $placename |
71 | 71 | ); |
72 | 72 | } |
73 | - if(!(empty ($lat) && empty ($lon))) { |
|
74 | - if(!empty ($alt)) { |
|
73 | + if (!(empty ($lat) && empty ($lon))) { |
|
74 | + if (!empty ($alt)) { |
|
75 | 75 | $event->data ['meta'] [] = array( |
76 | 76 | 'name' => 'geo.position', |
77 | 77 | 'content' => $lat . ';' . $lon . ';' . $alt |
@@ -83,20 +83,20 @@ discard block |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | } |
86 | - if(!empty ($country)) { |
|
86 | + if (!empty ($country)) { |
|
87 | 87 | $event->data ['meta'] [] = array( |
88 | 88 | 'name' => 'geo.country', |
89 | 89 | 'content' => $country |
90 | 90 | ); |
91 | 91 | } |
92 | - if(!(empty ($lat) && empty ($lon))) { |
|
92 | + if (!(empty ($lat) && empty ($lon))) { |
|
93 | 93 | $event->data ['meta'] [] = array( |
94 | 94 | 'name' => "ICBM", |
95 | 95 | 'content' => $lat . ', ' . $lon |
96 | 96 | ); |
97 | 97 | // icbm is generally useless without a DC.title, |
98 | 98 | // so we copy that from title unless it's empty... |
99 | - if(!(empty ($title))) { |
|
99 | + if (!(empty ($title))) { |
|
100 | 100 | /* |
101 | 101 | * don't specify the DC namespace as this is incomplete; it should be done at the |
102 | 102 | * template level as it also needs a 'profile' attribute on the head/container, |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ); |
111 | 111 | } |
112 | 112 | } |
113 | - if(!empty ($geohash)) { |
|
113 | + if (!empty ($geohash)) { |
|
114 | 114 | $event->data ['meta'] [] = array( |
115 | 115 | 'name' => 'geo.geohash', |
116 | 116 | 'content' => $geohash |