@@ -14,11 +14,13 @@ 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 | die (); |
19 | +} |
|
19 | 20 | |
20 | -if (!defined('DOKU_PLUGIN')) |
|
21 | +if (!defined('DOKU_PLUGIN')) { |
|
21 | 22 | define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); |
23 | +} |
|
22 | 24 | |
23 | 25 | require_once (DOKU_PLUGIN . 'syntax.php'); |
24 | 26 | /** |
@@ -115,8 +117,9 @@ discard block |
||
115 | 117 | * @see DokuWiki_Syntax_Plugin::render() |
116 | 118 | */ |
117 | 119 | public function render($mode, Doku_Renderer $renderer, $data) { |
118 | - if ($data === false) |
|
119 | - return false; |
|
120 | + if ($data === false) { |
|
121 | + return false; |
|
122 | + } |
|
120 | 123 | list ($lat, $lon, $alt, $geohash, $region, $placename, $country, $showlocation, $style) = $data; |
121 | 124 | $ddlat = $lat; |
122 | 125 | $ddlon = $lon; |
@@ -170,8 +173,9 @@ discard block |
||
170 | 173 | $renderer->meta ['geo'] ['alt'] = $alt; |
171 | 174 | return true; |
172 | 175 | } elseif ($mode == 'odt') { |
173 | - if (!empty ($alt)) |
|
174 | - $alt = ', ' . $alt . 'm'; |
|
176 | + if (!empty ($alt)) { |
|
177 | + $alt = ', ' . $alt . 'm'; |
|
178 | + } |
|
175 | 179 | $renderer->p_open(); |
176 | 180 | $renderer->_odtAddImage(DOKU_PLUGIN . 'geotag/images/geotag.png', null, null, 'left', ''); |
177 | 181 | $renderer->doc .= '<text:span>' . $this->getLang('geotag_desc') . ' ' . $placename . ': </text:span>'; |
@@ -14,11 +14,13 @@ 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 | die (); |
19 | +} |
|
19 | 20 | |
20 | -if (!defined('DOKU_PLUGIN')) |
|
21 | +if (!defined('DOKU_PLUGIN')) { |
|
21 | 22 | define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); |
23 | +} |
|
22 | 24 | require_once (DOKU_PLUGIN . 'action.php'); |
23 | 25 | |
24 | 26 | /** |
@@ -144,16 +146,26 @@ discard block |
||
144 | 146 | // $data[1] – ns: The colon separated namespace path minus the trailing page name. (false if root ns) |
145 | 147 | // $data[2] – page_name: The wiki page name. |
146 | 148 | // $data[3] – rev: The page revision, false for current wiki pages. |
147 | - if (!$this->getConf('geotag_pinggeourl')) |
|
148 | - return false; // config says don't ping |
|
149 | - if ($event->data [3]) |
|
150 | - return false; // old revision saved |
|
151 | - if (!$event->data [0] [1]) |
|
152 | - return false; // file is empty |
|
153 | - if (@file_exists($event->data [0] [0])) |
|
154 | - return false; // file not new |
|
155 | - if (p_get_metadata($ID, 'geo', true)) |
|
156 | - return false; // no geo metadata available, ping is useless |
|
149 | + if (!$this->getConf('geotag_pinggeourl')) { |
|
150 | + return false; |
|
151 | + } |
|
152 | + // config says don't ping |
|
153 | + if ($event->data [3]) { |
|
154 | + return false; |
|
155 | + } |
|
156 | + // old revision saved |
|
157 | + if (!$event->data [0] [1]) { |
|
158 | + return false; |
|
159 | + } |
|
160 | + // file is empty |
|
161 | + if (@file_exists($event->data [0] [0])) { |
|
162 | + return false; |
|
163 | + } |
|
164 | + // file not new |
|
165 | + if (p_get_metadata($ID, 'geo', true)) { |
|
166 | + return false; |
|
167 | + } |
|
168 | + // no geo metadata available, ping is useless |
|
157 | 169 | |
158 | 170 | $url = 'http://geourl.org/ping/?p=' . wl($ID, '', true); |
159 | 171 | $http = new DokuHTTPClient(); |
@@ -21,12 +21,12 @@ |
||
21 | 21 | * @license BSD license |
22 | 22 | * @author Mark C. Prins <[email protected]> |
23 | 23 | */ |
24 | -$meta ['geotag_pinggeourl'] = array ('onoff'); |
|
25 | -$meta ['geotag_location_prefix'] = array ('string'); |
|
26 | -$meta ['geotag_showlocation'] = array ('onoff'); |
|
27 | -$meta ['geotag_hide'] = array ('onoff' ); |
|
28 | -$meta ['geotag_prevent_microformat_render'] = array ('onoff' ); |
|
29 | -$meta ['toolbar_icon'] = array ('onoff' ); |
|
30 | -$meta ['geotag_showsearch'] = array ('onoff' ); |
|
31 | -$meta ['displayformat'] = array ('multichoice', |
|
32 | - '_choices' => array ('DD','DMS') ); |
|
24 | +$meta ['geotag_pinggeourl'] = array('onoff'); |
|
25 | +$meta ['geotag_location_prefix'] = array('string'); |
|
26 | +$meta ['geotag_showlocation'] = array('onoff'); |
|
27 | +$meta ['geotag_hide'] = array('onoff'); |
|
28 | +$meta ['geotag_prevent_microformat_render'] = array('onoff'); |
|
29 | +$meta ['toolbar_icon'] = array('onoff'); |
|
30 | +$meta ['geotag_showsearch'] = array('onoff'); |
|
31 | +$meta ['displayformat'] = array('multichoice', |
|
32 | + '_choices' => array('DD', 'DMS')); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * Simple test to make sure the plugin.info.txt is in correct format |
30 | 30 | */ |
31 | 31 | public function test_plugininfo() { |
32 | - $file = __DIR__.'/../plugin.info.txt'; |
|
32 | + $file = __DIR__ . '/../plugin.info.txt'; |
|
33 | 33 | $this->assertFileExists($file); |
34 | 34 | |
35 | 35 | $info = confToHash($file); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | global $conf; |
34 | 34 | $conf['allowdebug'] = 1; |
35 | 35 | |
36 | - TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/data/'); |
|
36 | + TestUtils::rcopy(TMP_DIR, dirname(__FILE__) . '/data/'); |
|
37 | 37 | |
38 | 38 | dbglog("\nset up class syntax_plugin_geotag_test"); |
39 | 39 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | //idx_addPage('link', $verbose, $force); |
60 | 60 | //idx_addPage('geotag_syntax', $verbose, $force); |
61 | 61 | if ($conf['allowdebug']) { |
62 | - touch(DOKU_TMP_DATA.'cache/debug.log'); |
|
62 | + touch(DOKU_TMP_DATA . 'cache/debug.log'); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | // try to get the debug log after running the test, print and clear |
71 | 71 | if ($conf['allowdebug']) { |
72 | 72 | print "\n"; |
73 | - readfile(DOKU_TMP_DATA.'cache/debug.log'); |
|
74 | - unlink(DOKU_TMP_DATA.'cache/debug.log'); |
|
73 | + readfile(DOKU_TMP_DATA . 'cache/debug.log'); |
|
74 | + unlink(DOKU_TMP_DATA . 'cache/debug.log'); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |