Completed
Branch master (7d1945)
by Mark
02:26
created
admin/purge.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,12 @@
 block discarded – undo
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
-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 . 'admin.php';
22 24
 /**
23 25
  * DokuWiki Plugin spatialhelper (Admin Component).
Please login to merge, or discard this patch.
_test/general.test.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -23,40 +23,40 @@
 block discarded – undo
23 23
  */
24 24
 class general_plugin_spatialhelper_test extends DokuWikiTest {
25 25
 
26
-    protected $pluginsEnabled = array('spatialhelper');
26
+	protected $pluginsEnabled = array('spatialhelper');
27 27
 
28
-    /**
29
-     * Simple test to make sure the plugin.info.txt is in correct format.
30
-     */
31
-    public function test_plugininfo() {
32
-        $file = __DIR__ . '/../plugin.info.txt';
33
-        $this->assertFileExists($file);
28
+	/**
29
+	 * Simple test to make sure the plugin.info.txt is in correct format.
30
+	 */
31
+	public function test_plugininfo() {
32
+		$file = __DIR__ . '/../plugin.info.txt';
33
+		$this->assertFileExists($file);
34 34
 
35
-        $info = confToHash($file);
35
+		$info = confToHash($file);
36 36
 
37
-        $this->assertArrayHasKey('base', $info);
38
-        $this->assertArrayHasKey('author', $info);
39
-        $this->assertArrayHasKey('email', $info);
40
-        $this->assertArrayHasKey('date', $info);
41
-        $this->assertArrayHasKey('name', $info);
42
-        $this->assertArrayHasKey('desc', $info);
43
-        $this->assertArrayHasKey('url', $info);
37
+		$this->assertArrayHasKey('base', $info);
38
+		$this->assertArrayHasKey('author', $info);
39
+		$this->assertArrayHasKey('email', $info);
40
+		$this->assertArrayHasKey('date', $info);
41
+		$this->assertArrayHasKey('name', $info);
42
+		$this->assertArrayHasKey('desc', $info);
43
+		$this->assertArrayHasKey('url', $info);
44 44
 
45
-        $this->assertEquals('spatialhelper', $info['base']);
46
-        $this->assertRegExp('/^https?:\/\//', $info['url']);
47
-        $this->assertTrue(mail_isvalid($info['email']));
48
-        $this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
49
-        $this->assertTrue(false !== strtotime($info['date']));
50
-    }
45
+		$this->assertEquals('spatialhelper', $info['base']);
46
+		$this->assertRegExp('/^https?:\/\//', $info['url']);
47
+		$this->assertTrue(mail_isvalid($info['email']));
48
+		$this->assertRegExp('/^\d\d\d\d-\d\d-\d\d$/', $info['date']);
49
+		$this->assertTrue(false !== strtotime($info['date']));
50
+	}
51 51
 
52
-    /**
53
-     * test if plugin is loaded.
54
-     */
55
-    public function test_plugin_spatialhelper_isloaded() {
56
-        global $plugin_controller;
57
-        $this->assertTrue(
58
-                    in_array('spatialhelper', $plugin_controller->getList()),
59
-                    "spatialhelper plugin is loaded"
60
-                            );
61
-    }
52
+	/**
53
+	 * test if plugin is loaded.
54
+	 */
55
+	public function test_plugin_spatialhelper_isloaded() {
56
+		global $plugin_controller;
57
+		$this->assertTrue(
58
+					in_array('spatialhelper', $plugin_controller->getList()),
59
+					"spatialhelper plugin is loaded"
60
+							);
61
+	}
62 62
 }
Please login to merge, or discard this patch.
helper/search.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,12 @@
 block discarded – undo
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
-if (! defined ( 'DOKU_PLUGIN' ))
19
+}
20
+if (! defined ( 'DOKU_PLUGIN' )) {
20 21
 	define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' );
22
+}
21 23
 
22 24
 /**
23 25
  * DokuWiki Plugin spatialhelper (Search component).
Please login to merge, or discard this patch.
helper/index.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@  discard block
 block discarded – undo
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 21
 /**
21 22
  * DokuWiki Plugin spatialhelper (index component).
@@ -75,8 +76,12 @@  discard block
 block discarded – undo
75 76
 	 */
76 77
 	function updateSpatialIndex($id) {
77 78
 		$geotags = p_get_metadata ( $id, 'geo' );
78
-		if (empty ( $geotags )) return false;
79
-		if (empty ($geotags ['lon']) || empty ($geotags ['lat'])) return false;
79
+		if (empty ( $geotags )) {
80
+			return false;
81
+		}
82
+		if (empty ($geotags ['lon']) || empty ($geotags ['lat'])) {
83
+			return false;
84
+		}
80 85
 		// dbglog ( $geotags, "Geo metadata found for page $id" );
81 86
 		$geometry = new Point ( $geotags ['lon'], $geotags ['lat'] );
82 87
 		$geohash = $geometry->out ( 'geohash' );
@@ -112,8 +117,9 @@  discard block
 block discarded – undo
112 117
 	function deleteFromIndex($id) {
113 118
 		// check the index for document
114 119
 		$knownHashes = $this->findHashesForId ( $id, $this->spatial_idx );
115
-		if (empty ( $knownHashes ))
116
-			return;
120
+		if (empty ( $knownHashes )) {
121
+					return;
122
+		}
117 123
 
118 124
 			// TODO shortcut, need to make sure there is only one element, if not the index is corrupt
119 125
 		$knownHash = $knownHashes [0];
@@ -153,8 +159,9 @@  discard block
 block discarded – undo
153 159
 		$media = array ();
154 160
 		search ( $media, $conf ['mediadir'], 'search_media', array () );
155 161
 		foreach ( $media as $medium ) {
156
-			if ($medium ['isimg'])
157
-				$this->indexImage ( $medium );
162
+			if ($medium ['isimg']) {
163
+							$this->indexImage ( $medium );
164
+			}
158 165
 		}
159 166
 		return true;
160 167
 	}
Please login to merge, or discard this patch.
helper/sitemap.php 1 patch
Braces   +18 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,12 +14,15 @@  discard block
 block discarded – undo
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
-if (! defined('DOKU_PLUGIN'))
19
+}
20
+if (! defined('DOKU_PLUGIN')) {
20 21
 	define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
21
-if (! defined('DOKU_LF'))
22
+}
23
+if (! defined('DOKU_LF')) {
22 24
 	define('DOKU_LF', "\n");
25
+}
23 26
 
24 27
 /**
25 28
  * DokuWiki Plugin spatialhelper (sitemap Component).
@@ -109,10 +112,12 @@  discard block
 block discarded – undo
109 112
 				// for document item in the index
110 113
 				if (strpos($id, 'media__', 0) !== 0) {
111 114
 					// public and non-hidden pages only
112
-					if (isHiddenPage($id))
113
-						continue;
114
-					if (auth_aclcheck($id, '', '') < AUTH_READ)
115
-						continue;
115
+					if (isHiddenPage($id)) {
116
+											continue;
117
+					}
118
+					if (auth_aclcheck($id, '', '') < AUTH_READ) {
119
+											continue;
120
+					}
116 121
 
117 122
 					$meta = p_get_metadata($id);
118 123
 
@@ -178,10 +183,12 @@  discard block
 block discarded – undo
178 183
 				// for document item in the index
179 184
 				if (strpos($id, 'media__', 0) !== 0) {
180 185
 					// public and non-hidden pages only
181
-					if (isHiddenPage($id))
182
-						continue;
183
-					if (auth_aclcheck($id, '', '') < AUTH_READ)
184
-						continue;
186
+					if (isHiddenPage($id)) {
187
+											continue;
188
+					}
189
+					if (auth_aclcheck($id, '', '') < AUTH_READ) {
190
+											continue;
191
+					}
185 192
 
186 193
 					$meta = p_get_metadata($id);
187 194
 
Please login to merge, or discard this patch.
syntax/findnearby.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,10 +14,12 @@  discard block
 block discarded – undo
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' ))
18
-	die ();
19
-if (! defined ( 'DOKU_PLUGIN' ))
20
-	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
+}
21 23
 require_once (DOKU_PLUGIN . 'syntax.php');
22 24
 
23 25
 /**
@@ -97,8 +99,9 @@  discard block
 block discarded – undo
97 99
 	 * @see DokuWiki_Syntax_Plugin::render()
98 100
 	 */
99 101
 	public function render($mode, Doku_Renderer $renderer, $data) {
100
-		if ($data === false)
101
-			return false;
102
+		if ($data === false) {
103
+					return false;
104
+		}
102 105
 
103 106
 		if ($mode == 'xhtml') {
104 107
 			$renderer->doc .= '<a href="' . wl ( getID (), $data [1] ) . '" class="findnearby">' . hsc( $data [0] ) . '</a>';
Please login to merge, or discard this patch.
action.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,12 +14,15 @@  discard block
 block discarded – undo
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' ))
18
-	die ();
19
-if (! defined ( 'DOKU_PLUGIN' ))
20
-	define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' );
21
-if (! defined ( 'DOKU_LF' ))
22
-	define ( 'DOKU_LF', "\n" );
17
+if (! defined ( 'DOKU_INC' )) {
18
+	die ();
19
+}
20
+if (! defined ( 'DOKU_PLUGIN' )) {
21
+	define ( 'DOKU_PLUGIN', DOKU_INC . 'lib/plugins/' );
22
+}
23
+if (! defined ( 'DOKU_LF' )) {
24
+	define ( 'DOKU_LF', "\n" );
25
+}
23 26
 require_once (DOKU_PLUGIN . 'action.php');
24 27
 
25 28
 /**
@@ -166,8 +169,9 @@  discard block
 block discarded – undo
166 169
 	 *        	not used
167 170
 	 */
168 171
 	function handle_action_act_preprocess(Doku_Event $event, $param) {
169
-		if ($event->data != 'findnearby')
170
-			return;
172
+		if ($event->data != 'findnearby') {
173
+					return;
174
+		}
171 175
 		$event->preventDefault ();
172 176
 	}
173 177
 
@@ -181,8 +185,9 @@  discard block
 block discarded – undo
181 185
 	 *        	'format'=> HTML | JSON
182 186
 	 */
183 187
 	function _findnearby(Doku_Event &$event, $param) {
184
-		if ($event->data != 'findnearby')
185
-			return;
188
+		if ($event->data != 'findnearby') {
189
+					return;
190
+		}
186 191
 		$event->preventDefault ();
187 192
 
188 193
 		global $INPUT;
Please login to merge, or discard this patch.