Test Failed
Pull Request — master (#450)
by Kiran
19:15
created
geodirectory-admin/google-api-php-client/src/Google/IO/Abstract.php 2 patches
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
   const UNKNOWN_CODE = 0;
29 29
   const FORM_URLENCODED = 'application/x-www-form-urlencoded';
30 30
   private static $CONNECTION_ESTABLISHED_HEADERS = array(
31
-    "HTTP/1.0 200 Connection established\r\n\r\n",
32
-    "HTTP/1.1 200 Connection established\r\n\r\n",
31
+	"HTTP/1.0 200 Connection established\r\n\r\n",
32
+	"HTTP/1.1 200 Connection established\r\n\r\n",
33 33
   );
34 34
   private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null);
35 35
   private static $HOP_BY_HOP = array(
36
-    'connection' => true,
37
-    'keep-alive' => true,
38
-    'proxy-authenticate' => true,
39
-    'proxy-authorization' => true,
40
-    'te' => true,
41
-    'trailers' => true,
42
-    'transfer-encoding' => true,
43
-    'upgrade' => true
36
+	'connection' => true,
37
+	'keep-alive' => true,
38
+	'proxy-authenticate' => true,
39
+	'proxy-authorization' => true,
40
+	'te' => true,
41
+	'trailers' => true,
42
+	'transfer-encoding' => true,
43
+	'upgrade' => true
44 44
   );
45 45
 
46 46
 
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
   public function __construct(Google_Client $client)
51 51
   {
52
-    $this->client = $client;
53
-    $timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds');
54
-    if ($timeout > 0) {
55
-      $this->setTimeout($timeout);
56
-    }
52
+	$this->client = $client;
53
+	$timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds');
54
+	if ($timeout > 0) {
55
+	  $this->setTimeout($timeout);
56
+	}
57 57
   }
58 58
 
59 59
   /**
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
    */
103 103
   public function setCachedRequest(Google_Http_Request $request)
104 104
   {
105
-    // Determine if the request is cacheable.
106
-    if (Google_Http_CacheParser::isResponseCacheable($request)) {
107
-      $this->client->getCache()->set($request->getCacheKey(), $request);
108
-      return true;
109
-    }
105
+	// Determine if the request is cacheable.
106
+	if (Google_Http_CacheParser::isResponseCacheable($request)) {
107
+	  $this->client->getCache()->set($request->getCacheKey(), $request);
108
+	  return true;
109
+	}
110 110
 
111
-    return false;
111
+	return false;
112 112
   }
113 113
 
114 114
   /**
@@ -121,37 +121,37 @@  discard block
 block discarded – undo
121 121
    */
122 122
   public function makeRequest(Google_Http_Request $request)
123 123
   {
124
-    // First, check to see if we have a valid cached version.
125
-    $cached = $this->getCachedRequest($request);
126
-    if ($cached !== false && $cached instanceof Google_Http_Request) {
127
-      if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
128
-        return $cached;
129
-      }
130
-    }
131
-
132
-    if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) {
133
-      $request = $this->processEntityRequest($request);
134
-    }
135
-
136
-    list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request);
137
-
138
-    if ($respHttpCode == 304 && $cached) {
139
-      // If the server responded NOT_MODIFIED, return the cached request.
140
-      $this->updateCachedRequest($cached, $responseHeaders);
141
-      return $cached;
142
-    }
143
-
144
-    if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) {
145
-      $responseHeaders['date'] = date("r");
146
-    }
147
-
148
-    $request->setResponseHttpCode($respHttpCode);
149
-    $request->setResponseHeaders($responseHeaders);
150
-    $request->setResponseBody($responseData);
151
-    // Store the request in cache (the function checks to see if the request
152
-    // can actually be cached)
153
-    $this->setCachedRequest($request);
154
-    return $request;
124
+	// First, check to see if we have a valid cached version.
125
+	$cached = $this->getCachedRequest($request);
126
+	if ($cached !== false && $cached instanceof Google_Http_Request) {
127
+	  if (!$this->checkMustRevalidateCachedRequest($cached, $request)) {
128
+		return $cached;
129
+	  }
130
+	}
131
+
132
+	if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) {
133
+	  $request = $this->processEntityRequest($request);
134
+	}
135
+
136
+	list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request);
137
+
138
+	if ($respHttpCode == 304 && $cached) {
139
+	  // If the server responded NOT_MODIFIED, return the cached request.
140
+	  $this->updateCachedRequest($cached, $responseHeaders);
141
+	  return $cached;
142
+	}
143
+
144
+	if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) {
145
+	  $responseHeaders['date'] = date("r");
146
+	}
147
+
148
+	$request->setResponseHttpCode($respHttpCode);
149
+	$request->setResponseHeaders($responseHeaders);
150
+	$request->setResponseBody($responseData);
151
+	// Store the request in cache (the function checks to see if the request
152
+	// can actually be cached)
153
+	$this->setCachedRequest($request);
154
+	return $request;
155 155
   }
156 156
 
157 157
   /**
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
    */
163 163
   public function getCachedRequest(Google_Http_Request $request)
164 164
   {
165
-    if (false === Google_Http_CacheParser::isRequestCacheable($request)) {
166
-      return false;
167
-    }
165
+	if (false === Google_Http_CacheParser::isRequestCacheable($request)) {
166
+	  return false;
167
+	}
168 168
 
169
-    return $this->client->getCache()->get($request->getCacheKey());
169
+	return $this->client->getCache()->get($request->getCacheKey());
170 170
   }
171 171
 
172 172
   /**
@@ -177,28 +177,28 @@  discard block
 block discarded – undo
177 177
    */
178 178
   public function processEntityRequest(Google_Http_Request $request)
179 179
   {
180
-    $postBody = $request->getPostBody();
181
-    $contentType = $request->getRequestHeader("content-type");
182
-
183
-    // Set the default content-type as application/x-www-form-urlencoded.
184
-    if (false == $contentType) {
185
-      $contentType = self::FORM_URLENCODED;
186
-      $request->setRequestHeaders(array('content-type' => $contentType));
187
-    }
188
-
189
-    // Force the payload to match the content-type asserted in the header.
190
-    if ($contentType == self::FORM_URLENCODED && is_array($postBody)) {
191
-      $postBody = http_build_query($postBody, '', '&');
192
-      $request->setPostBody($postBody);
193
-    }
194
-
195
-    // Make sure the content-length header is set.
196
-    if (!$postBody || is_string($postBody)) {
197
-      $postsLength = strlen($postBody);
198
-      $request->setRequestHeaders(array('content-length' => $postsLength));
199
-    }
200
-
201
-    return $request;
180
+	$postBody = $request->getPostBody();
181
+	$contentType = $request->getRequestHeader("content-type");
182
+
183
+	// Set the default content-type as application/x-www-form-urlencoded.
184
+	if (false == $contentType) {
185
+	  $contentType = self::FORM_URLENCODED;
186
+	  $request->setRequestHeaders(array('content-type' => $contentType));
187
+	}
188
+
189
+	// Force the payload to match the content-type asserted in the header.
190
+	if ($contentType == self::FORM_URLENCODED && is_array($postBody)) {
191
+	  $postBody = http_build_query($postBody, '', '&');
192
+	  $request->setPostBody($postBody);
193
+	}
194
+
195
+	// Make sure the content-length header is set.
196
+	if (!$postBody || is_string($postBody)) {
197
+	  $postsLength = strlen($postBody);
198
+	  $request->setRequestHeaders(array('content-length' => $postsLength));
199
+	}
200
+
201
+	return $request;
202 202
   }
203 203
 
204 204
   /**
@@ -211,21 +211,21 @@  discard block
 block discarded – undo
211 211
    */
212 212
   protected function checkMustRevalidateCachedRequest($cached, $request)
213 213
   {
214
-    if (Google_Http_CacheParser::mustRevalidate($cached)) {
215
-      $addHeaders = array();
216
-      if ($cached->getResponseHeader('etag')) {
217
-        // [13.3.4] If an entity tag has been provided by the origin server,
218
-        // we must use that entity tag in any cache-conditional request.
219
-        $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag');
220
-      } elseif ($cached->getResponseHeader('date')) {
221
-        $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date');
222
-      }
223
-
224
-      $request->setRequestHeaders($addHeaders);
225
-      return true;
226
-    } else {
227
-      return false;
228
-    }
214
+	if (Google_Http_CacheParser::mustRevalidate($cached)) {
215
+	  $addHeaders = array();
216
+	  if ($cached->getResponseHeader('etag')) {
217
+		// [13.3.4] If an entity tag has been provided by the origin server,
218
+		// we must use that entity tag in any cache-conditional request.
219
+		$addHeaders['If-None-Match'] = $cached->getResponseHeader('etag');
220
+	  } elseif ($cached->getResponseHeader('date')) {
221
+		$addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date');
222
+	  }
223
+
224
+	  $request->setRequestHeaders($addHeaders);
225
+	  return true;
226
+	} else {
227
+	  return false;
228
+	}
229 229
   }
230 230
 
231 231
   /**
@@ -235,19 +235,19 @@  discard block
 block discarded – undo
235 235
    */
236 236
   protected function updateCachedRequest($cached, $responseHeaders)
237 237
   {
238
-    $hopByHop = self::$HOP_BY_HOP;
239
-    if (!empty($responseHeaders['connection'])) {
240
-      $connectionHeaders = array_map(
241
-          'strtolower',
242
-          array_filter(
243
-              array_map('trim', explode(',', $responseHeaders['connection']))
244
-          )
245
-      );
246
-      $hopByHop += array_fill_keys($connectionHeaders, true);
247
-    }
248
-
249
-    $endToEnd = array_diff_key($responseHeaders, $hopByHop);
250
-    $cached->setResponseHeaders($endToEnd);
238
+	$hopByHop = self::$HOP_BY_HOP;
239
+	if (!empty($responseHeaders['connection'])) {
240
+	  $connectionHeaders = array_map(
241
+		  'strtolower',
242
+		  array_filter(
243
+			  array_map('trim', explode(',', $responseHeaders['connection']))
244
+		  )
245
+	  );
246
+	  $hopByHop += array_fill_keys($connectionHeaders, true);
247
+	}
248
+
249
+	$endToEnd = array_diff_key($responseHeaders, $hopByHop);
250
+	$cached->setResponseHeaders($endToEnd);
251 251
   }
252 252
 
253 253
   /**
@@ -259,33 +259,33 @@  discard block
 block discarded – undo
259 259
    */
260 260
   public function parseHttpResponse($respData, $headerSize)
261 261
   {
262
-    // check proxy header
263
-    foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
264
-      if (stripos($respData, $established_header) !== false) {
265
-        // existed, remove it
266
-        $respData = str_ireplace($established_header, '', $respData);
267
-        // Subtract the proxy header size unless the cURL bug prior to 7.30.0
268
-        // is present which prevented the proxy header size from being taken into
269
-        // account.
270
-        if (!$this->needsQuirk()) {
271
-          $headerSize -= strlen($established_header);
272
-        }
273
-        break;
274
-      }
275
-    }
276
-
277
-    if ($headerSize) {
278
-      $responseBody = substr($respData, $headerSize);
279
-      $responseHeaders = substr($respData, 0, $headerSize);
280
-    } else {
281
-      $responseSegments = explode("\r\n\r\n", $respData, 2);
282
-      $responseHeaders = $responseSegments[0];
283
-      $responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
284
-                                                    null;
285
-    }
286
-
287
-    $responseHeaders = $this->getHttpResponseHeaders($responseHeaders);
288
-    return array($responseHeaders, $responseBody);
262
+	// check proxy header
263
+	foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) {
264
+	  if (stripos($respData, $established_header) !== false) {
265
+		// existed, remove it
266
+		$respData = str_ireplace($established_header, '', $respData);
267
+		// Subtract the proxy header size unless the cURL bug prior to 7.30.0
268
+		// is present which prevented the proxy header size from being taken into
269
+		// account.
270
+		if (!$this->needsQuirk()) {
271
+		  $headerSize -= strlen($established_header);
272
+		}
273
+		break;
274
+	  }
275
+	}
276
+
277
+	if ($headerSize) {
278
+	  $responseBody = substr($respData, $headerSize);
279
+	  $responseHeaders = substr($respData, 0, $headerSize);
280
+	} else {
281
+	  $responseSegments = explode("\r\n\r\n", $respData, 2);
282
+	  $responseHeaders = $responseSegments[0];
283
+	  $responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
284
+													null;
285
+	}
286
+
287
+	$responseHeaders = $this->getHttpResponseHeaders($responseHeaders);
288
+	return array($responseHeaders, $responseBody);
289 289
   }
290 290
 
291 291
   /**
@@ -295,45 +295,45 @@  discard block
 block discarded – undo
295 295
    */
296 296
   public function getHttpResponseHeaders($rawHeaders)
297 297
   {
298
-    if (is_array($rawHeaders)) {
299
-      return $this->parseArrayHeaders($rawHeaders);
300
-    } else {
301
-      return $this->parseStringHeaders($rawHeaders);
302
-    }
298
+	if (is_array($rawHeaders)) {
299
+	  return $this->parseArrayHeaders($rawHeaders);
300
+	} else {
301
+	  return $this->parseStringHeaders($rawHeaders);
302
+	}
303 303
   }
304 304
 
305 305
   private function parseStringHeaders($rawHeaders)
306 306
   {
307
-    $headers = array();
308
-    $responseHeaderLines = explode("\r\n", $rawHeaders);
309
-    foreach ($responseHeaderLines as $headerLine) {
310
-      if ($headerLine && strpos($headerLine, ':') !== false) {
311
-        list($header, $value) = explode(': ', $headerLine, 2);
312
-        $header = strtolower($header);
313
-        if (isset($headers[$header])) {
314
-          $headers[$header] .= "\n" . $value;
315
-        } else {
316
-          $headers[$header] = $value;
317
-        }
318
-      }
319
-    }
320
-    return $headers;
307
+	$headers = array();
308
+	$responseHeaderLines = explode("\r\n", $rawHeaders);
309
+	foreach ($responseHeaderLines as $headerLine) {
310
+	  if ($headerLine && strpos($headerLine, ':') !== false) {
311
+		list($header, $value) = explode(': ', $headerLine, 2);
312
+		$header = strtolower($header);
313
+		if (isset($headers[$header])) {
314
+		  $headers[$header] .= "\n" . $value;
315
+		} else {
316
+		  $headers[$header] = $value;
317
+		}
318
+	  }
319
+	}
320
+	return $headers;
321 321
   }
322 322
 
323 323
   private function parseArrayHeaders($rawHeaders)
324 324
   {
325
-    $header_count = count($rawHeaders);
326
-    $headers = array();
327
-
328
-    for ($i = 0; $i < $header_count; $i++) {
329
-      $header = $rawHeaders[$i];
330
-      // Times will have colons in - so we just want the first match.
331
-      $header_parts = explode(': ', $header, 2);
332
-      if (count($header_parts) == 2) {
333
-        $headers[strtolower($header_parts[0])] = $header_parts[1];
334
-      }
335
-    }
336
-
337
-    return $headers;
325
+	$header_count = count($rawHeaders);
326
+	$headers = array();
327
+
328
+	for ($i = 0; $i < $header_count; $i++) {
329
+	  $header = $rawHeaders[$i];
330
+	  // Times will have colons in - so we just want the first match.
331
+	  $header_parts = explode(': ', $header, 2);
332
+	  if (count($header_parts) == 2) {
333
+		$headers[strtolower($header_parts[0])] = $header_parts[1];
334
+	  }
335
+	}
336
+
337
+	return $headers;
338 338
   }
339 339
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 
22 22
 if (!class_exists('Google_Client')) {
23
-  require_once dirname(__FILE__) . '/../autoload.php';
23
+  require_once dirname(__FILE__).'/../autoload.php';
24 24
 }
25 25
 
26 26
 abstract class Google_IO_Abstract
@@ -280,8 +280,7 @@  discard block
 block discarded – undo
280 280
     } else {
281 281
       $responseSegments = explode("\r\n\r\n", $respData, 2);
282 282
       $responseHeaders = $responseSegments[0];
283
-      $responseBody = isset($responseSegments[1]) ? $responseSegments[1] :
284
-                                                    null;
283
+      $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : null;
285 284
     }
286 285
 
287 286
     $responseHeaders = $this->getHttpResponseHeaders($responseHeaders);
@@ -311,7 +310,7 @@  discard block
 block discarded – undo
311 310
         list($header, $value) = explode(': ', $headerLine, 2);
312 311
         $header = strtolower($header);
313 312
         if (isset($headers[$header])) {
314
-          $headers[$header] .= "\n" . $value;
313
+          $headers[$header] .= "\n".$value;
315 314
         } else {
316 315
           $headers[$header] = $value;
317 316
         }
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Twenty_Seventeen.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-add_filter('post_thumbnail_html','geodir_2017_remove_header',10,5);
5
-function geodir_2017_remove_header($html, $post_ID, $post_thumbnail_id, $size, $attr){
6
-	if($size=='twentyseventeen-featured-image'){
4
+add_filter('post_thumbnail_html', 'geodir_2017_remove_header', 10, 5);
5
+function geodir_2017_remove_header($html, $post_ID, $post_thumbnail_id, $size, $attr) {
6
+	if ($size == 'twentyseventeen-featured-image') {
7 7
 
8
-		if(geodir_is_page('detail') || geodir_is_page('add-listing')){
9
-			$html = '';// nothing up top
8
+		if (geodir_is_page('detail') || geodir_is_page('add-listing')) {
9
+			$html = ''; // nothing up top
10 10
 		}
11 11
 
12 12
 	}
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
 
64 64
 }
65 65
 
66
-function geodir_twentyseventeen_body_classes($classes){
66
+function geodir_twentyseventeen_body_classes($classes) {
67 67
 
68
-	if(geodir_is_page('add-listing')
68
+	if (geodir_is_page('add-listing')
69 69
 	   || geodir_is_page('preview')
70 70
 	   || geodir_is_page('home')
71 71
 	   || geodir_is_page('location')
72 72
 	   || geodir_is_page('listing')
73 73
 	   || geodir_is_page('search')
74 74
 	   || geodir_is_page('author')
75
-	){
75
+	) {
76 76
 		$classes[] = 'has-sidebar';
77 77
 	}
78 78
 	return $classes;
79 79
 }
80
-add_filter( 'body_class', 'geodir_twentyseventeen_body_classes' );
80
+add_filter('body_class', 'geodir_twentyseventeen_body_classes');
81 81
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,17 +46,13 @@
 block discarded – undo
46 46
 
47 47
 	if (is_page_geodir_home() || geodir_is_page('location')) {
48 48
 		add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_home_top', 8);
49
-	}
50
-	elseif (geodir_is_page('listing')) {
49
+	} elseif (geodir_is_page('listing')) {
51 50
 		add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_listings_top', 8);
52
-	}
53
-	elseif (geodir_is_page('detail')) {
51
+	} elseif (geodir_is_page('detail')) {
54 52
 		add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_detail_top', 8);
55
-	}
56
-	elseif (geodir_is_page('search')) {
53
+	} elseif (geodir_is_page('search')) {
57 54
 		add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_search_top', 8);
58
-	}
59
-	elseif (geodir_is_page('author')) {
55
+	} elseif (geodir_is_page('author')) {
60 56
 		add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_author_top', 8);
61 57
 	}
62 58
 
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/create_field.php 3 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -16,100 +16,100 @@
 block discarded – undo
16 16
 
17 17
 $field_ids = array();
18 18
 if (!empty($_REQUEST['licontainer']) && is_array($_REQUEST['licontainer'])) {
19
-    foreach ($_REQUEST['licontainer'] as $lic_id) {
20
-        $field_ids[] = sanitize_text_field($lic_id);
21
-    }
19
+	foreach ($_REQUEST['licontainer'] as $lic_id) {
20
+		$field_ids[] = sanitize_text_field($lic_id);
21
+	}
22 22
 }
23 23
 
24 24
 /* ------- check nonce field ------- */
25 25
 if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
26
-    echo godir_set_field_order($field_ids);
26
+	echo godir_set_field_order($field_ids);
27 27
 }
28 28
 
29 29
 if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
30
-    $response = godir_set_sort_field_order($field_ids);
31
-    if (is_array($response)) {
32
-        wp_send_json($response);
33
-    } else {
34
-        echo $response;
35
-    }
30
+	$response = godir_set_sort_field_order($field_ids);
31
+	if (is_array($response)) {
32
+		wp_send_json($response);
33
+	} else {
34
+		echo $response;
35
+	}
36 36
 }
37 37
 
38 38
 /* ---- Show field form in admin ---- */
39 39
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
40
-    geodir_custom_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
40
+	geodir_custom_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
41 41
 }
42 42
 
43 43
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
44
-    geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
44
+	geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
45 45
 }
46 46
 
47 47
 /* ---- Delete field ---- */
48 48
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
49
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
50
-        return;
49
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
50
+		return;
51 51
     
52
-    echo geodir_custom_field_delete($field_id);
52
+	echo geodir_custom_field_delete($field_id);
53 53
 }
54 54
 
55 55
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
56
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
57
-        return;
56
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
57
+		return;
58 58
     
59
-    echo geodir_custom_sort_field_delete($field_id);
59
+	echo geodir_custom_sort_field_delete($field_id);
60 60
 }
61 61
 
62 62
 /* ---- Save field  ---- */
63 63
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
64
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
65
-        return;
66
-
67
-    foreach ($_REQUEST as $pkey => $pval) {
68
-        if (is_array($_REQUEST[$pkey]) || $pkey=='default_value') {
69
-            $tags = 'skip_field';
70
-        } else {
71
-            $tags = '';
72
-        }
73
-
74
-        if ($tags != 'skip_field') {
75
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
76
-        }
77
-    }
78
-
79
-    $return = geodir_custom_field_save($_REQUEST);
80
-
81
-    if (is_int($return)) {
82
-        $lastid = $return;
83
-        geodir_custom_field_adminhtml($field_type, $lastid, 'submit',$field_type_key);
84
-    } else {
85
-        echo $return;
86
-    }
64
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
65
+		return;
66
+
67
+	foreach ($_REQUEST as $pkey => $pval) {
68
+		if (is_array($_REQUEST[$pkey]) || $pkey=='default_value') {
69
+			$tags = 'skip_field';
70
+		} else {
71
+			$tags = '';
72
+		}
73
+
74
+		if ($tags != 'skip_field') {
75
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
76
+		}
77
+	}
78
+
79
+	$return = geodir_custom_field_save($_REQUEST);
80
+
81
+	if (is_int($return)) {
82
+		$lastid = $return;
83
+		geodir_custom_field_adminhtml($field_type, $lastid, 'submit',$field_type_key);
84
+	} else {
85
+		echo $return;
86
+	}
87 87
 }
88 88
 
89 89
 /* ---- Save sort field  ---- */
90 90
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
91
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
92
-        return;
93
-
94
-    foreach ($_REQUEST as $pkey => $pval) {
95
-        if (is_array($_REQUEST[$pkey])) {
96
-            $tags = 'skip_field';
97
-        } else {
98
-            $tags = '';
99
-        }
100
-
101
-        if ($tags != 'skip_field') {
102
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
103
-        }
104
-    }
105
-
106
-    $return = geodir_custom_sort_field_save($_REQUEST);
107
-
108
-    if (is_int($return)) {
109
-        $lastid = $return;
110
-        $default = false;
111
-        geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default);
112
-    } else {
113
-        echo $return;
114
-    }
91
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
92
+		return;
93
+
94
+	foreach ($_REQUEST as $pkey => $pval) {
95
+		if (is_array($_REQUEST[$pkey])) {
96
+			$tags = 'skip_field';
97
+		} else {
98
+			$tags = '';
99
+		}
100
+
101
+		if ($tags != 'skip_field') {
102
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
103
+		}
104
+	}
105
+
106
+	$return = geodir_custom_sort_field_save($_REQUEST);
107
+
108
+	if (is_int($return)) {
109
+		$lastid = $return;
110
+		$default = false;
111
+		geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default);
112
+	} else {
113
+		echo $return;
114
+	}
115 115
 }
116 116
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 
38 38
 /* ---- Show field form in admin ---- */
39 39
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
40
-    geodir_custom_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
40
+    geodir_custom_field_adminhtml($field_type, $field_id, $field_action, $field_type_key);
41 41
 }
42 42
 
43 43
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
44
-    geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action,$field_type_key);
44
+    geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action, $field_type_key);
45 45
 }
46 46
 
47 47
 /* ---- Delete field ---- */
48 48
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
49
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
49
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
50 50
         return;
51 51
     
52 52
     echo geodir_custom_field_delete($field_id);
53 53
 }
54 54
 
55 55
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
56
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
56
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
57 57
         return;
58 58
     
59 59
     echo geodir_custom_sort_field_delete($field_id);
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 
62 62
 /* ---- Save field  ---- */
63 63
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
64
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
64
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
65 65
         return;
66 66
 
67 67
     foreach ($_REQUEST as $pkey => $pval) {
68
-        if (is_array($_REQUEST[$pkey]) || $pkey=='default_value') {
68
+        if (is_array($_REQUEST[$pkey]) || $pkey == 'default_value') {
69 69
             $tags = 'skip_field';
70 70
         } else {
71 71
             $tags = '';
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     if (is_int($return)) {
82 82
         $lastid = $return;
83
-        geodir_custom_field_adminhtml($field_type, $lastid, 'submit',$field_type_key);
83
+        geodir_custom_field_adminhtml($field_type, $lastid, 'submit', $field_type_key);
84 84
     } else {
85 85
         echo $return;
86 86
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
 /* ---- Save sort field  ---- */
90 90
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
91
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
91
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_'.$field_id))
92 92
         return;
93 93
 
94 94
     foreach ($_REQUEST as $pkey => $pval) {
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,23 +46,26 @@  discard block
 block discarded – undo
46 46
 
47 47
 /* ---- Delete field ---- */
48 48
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
49
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
50
-        return;
49
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) {
50
+            return;
51
+    }
51 52
     
52 53
     echo geodir_custom_field_delete($field_id);
53 54
 }
54 55
 
55 56
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
56
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
57
-        return;
57
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) {
58
+            return;
59
+    }
58 60
     
59 61
     echo geodir_custom_sort_field_delete($field_id);
60 62
 }
61 63
 
62 64
 /* ---- Save field  ---- */
63 65
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
64
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
65
-        return;
66
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) {
67
+            return;
68
+    }
66 69
 
67 70
     foreach ($_REQUEST as $pkey => $pval) {
68 71
         if (is_array($_REQUEST[$pkey]) || $pkey=='default_value') {
@@ -88,8 +91,9 @@  discard block
 block discarded – undo
88 91
 
89 92
 /* ---- Save sort field  ---- */
90 93
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
91
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
92
-        return;
94
+    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) {
95
+            return;
96
+    }
93 97
 
94 98
     foreach ($_REQUEST as $pkey => $pval) {
95 99
         if (is_array($_REQUEST[$pkey])) {
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_template_tags.php 3 patches
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -225,10 +225,11 @@  discard block
 block discarded – undo
225 225
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
226 226
                 <?php }
227 227
 
228
-                if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
229
-                    $show_entire_cat_panel = "none";
230
-                else
231
-                    $show_entire_cat_panel = "''";
228
+                if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters']) {
229
+                                    $show_entire_cat_panel = "none";
230
+                } else {
231
+                                    $show_entire_cat_panel = "''";
232
+                }
232 233
                 ?>
233 234
 
234 235
                 <?php if ($geodir_map_options['enable_map_direction']) { ?>
@@ -302,8 +303,9 @@  discard block
 block discarded – undo
302 303
 				}
303 304
 				
304 305
 				$geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
305
-				if (empty($geodir_default_map_search_pt))
306
-					$geodir_default_map_search_pt = 'gd_place';
306
+				if (empty($geodir_default_map_search_pt)) {
307
+									$geodir_default_map_search_pt = 'gd_place';
308
+				}
307 309
 
308 310
                 global $gd_session;
309 311
                 $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype');
Please login to merge, or discard this patch.
Indentation   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -67,80 +67,80 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function geodir_draw_map($map_args = array())
69 69
 {
70
-    global $map_canvas_arr;
71
-    $map_canvas_name = (!empty($map_args) && $map_args['map_canvas_name'] != '') ? $map_args['map_canvas_name'] : 'home_map_canvas';
72
-    $map_class_name = (!empty($map_args) && isset($map_args['map_class_name'])) ? $map_args['map_class_name'] : '';
73
-
74
-    $default_location = geodir_get_default_location();
75
-
76
-    $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
77
-    $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
78
-    $map_default_zoom = 12;
79
-    // map options default values
80
-    $width = 950;
81
-    $height = 450;
82
-    $child_collapse = '0';
83
-    $sticky = '';
84
-    $enable_cat_filters = false;
85
-    $enable_text_search = false;
86
-    $enable_post_type_filters = false;
87
-    $enable_location_filters = false;
88
-    $enable_jason_on_load = false;
89
-    $enable_map_direction = false;
90
-    $enable_marker_cluster = false;
91
-    $enable_map_resize_button = false;
92
-    $maptype = 'ROADMAP';
93
-
94
-    $geodir_map_options = array(
95
-        'width' => $width,
96
-        'height' => $height,
97
-        'child_collapse' => $child_collapse,
98
-        'sticky' => $sticky,
99
-        'enable_map_resize_button' => $enable_map_resize_button,
100
-        'enable_cat_filters' => $enable_cat_filters,
101
-        'enable_text_search' => $enable_text_search,
102
-        'enable_post_type_filters' => $enable_post_type_filters,
103
-        'enable_location_filters' => $enable_location_filters,
104
-        'enable_jason_on_load' => $enable_jason_on_load,
105
-        'enable_map_direction' => $enable_map_direction,
106
-        'enable_marker_cluster' => $enable_marker_cluster,
107
-        'ajax_url' => geodir_get_ajax_url(),
108
-        'map_canvas_name' => $map_canvas_name,
109
-        'inputText' => __('Title or Keyword', 'geodirectory'),
110
-        'latitude' => $map_default_lat,
111
-        'longitude' => $map_default_lng,
112
-        'zoom' => $map_default_zoom,
113
-        'scrollwheel' => true,
114
-        'streetViewControl' => true,
115
-        'fullscreenControl' => false,
116
-        'maptype' => $maptype,
117
-        'showPreview' => '0',
118
-        'maxZoom' => 21,
119
-        'autozoom' => true,
120
-        'bubble_size' => 'small',
121
-        'token' => '68f48005e256696074e1da9bf9f67f06',
122
-        'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN')
123
-    );
124
-
125
-
126
-
127
-    if (!empty($map_args)) {
128
-        foreach ($map_args as $map_option_key => $map_option_value) {
129
-            $geodir_map_options[$map_option_key] = $map_option_value;
130
-        }
131
-    }
132
-
133
-    if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
134
-    } else {
135
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
136
-    }
137
-
138
-    if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
139
-    } else {
140
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
141
-    }
142
-
143
-    /**
70
+	global $map_canvas_arr;
71
+	$map_canvas_name = (!empty($map_args) && $map_args['map_canvas_name'] != '') ? $map_args['map_canvas_name'] : 'home_map_canvas';
72
+	$map_class_name = (!empty($map_args) && isset($map_args['map_class_name'])) ? $map_args['map_class_name'] : '';
73
+
74
+	$default_location = geodir_get_default_location();
75
+
76
+	$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
77
+	$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
78
+	$map_default_zoom = 12;
79
+	// map options default values
80
+	$width = 950;
81
+	$height = 450;
82
+	$child_collapse = '0';
83
+	$sticky = '';
84
+	$enable_cat_filters = false;
85
+	$enable_text_search = false;
86
+	$enable_post_type_filters = false;
87
+	$enable_location_filters = false;
88
+	$enable_jason_on_load = false;
89
+	$enable_map_direction = false;
90
+	$enable_marker_cluster = false;
91
+	$enable_map_resize_button = false;
92
+	$maptype = 'ROADMAP';
93
+
94
+	$geodir_map_options = array(
95
+		'width' => $width,
96
+		'height' => $height,
97
+		'child_collapse' => $child_collapse,
98
+		'sticky' => $sticky,
99
+		'enable_map_resize_button' => $enable_map_resize_button,
100
+		'enable_cat_filters' => $enable_cat_filters,
101
+		'enable_text_search' => $enable_text_search,
102
+		'enable_post_type_filters' => $enable_post_type_filters,
103
+		'enable_location_filters' => $enable_location_filters,
104
+		'enable_jason_on_load' => $enable_jason_on_load,
105
+		'enable_map_direction' => $enable_map_direction,
106
+		'enable_marker_cluster' => $enable_marker_cluster,
107
+		'ajax_url' => geodir_get_ajax_url(),
108
+		'map_canvas_name' => $map_canvas_name,
109
+		'inputText' => __('Title or Keyword', 'geodirectory'),
110
+		'latitude' => $map_default_lat,
111
+		'longitude' => $map_default_lng,
112
+		'zoom' => $map_default_zoom,
113
+		'scrollwheel' => true,
114
+		'streetViewControl' => true,
115
+		'fullscreenControl' => false,
116
+		'maptype' => $maptype,
117
+		'showPreview' => '0',
118
+		'maxZoom' => 21,
119
+		'autozoom' => true,
120
+		'bubble_size' => 'small',
121
+		'token' => '68f48005e256696074e1da9bf9f67f06',
122
+		'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN')
123
+	);
124
+
125
+
126
+
127
+	if (!empty($map_args)) {
128
+		foreach ($map_args as $map_option_key => $map_option_value) {
129
+			$geodir_map_options[$map_option_key] = $map_option_value;
130
+		}
131
+	}
132
+
133
+	if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
134
+	} else {
135
+		$geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
136
+	}
137
+
138
+	if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
139
+	} else {
140
+		$geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
141
+	}
142
+
143
+	/**
144 144
 	 * Filter the options to use in google map.
145 145
 	 *
146 146
 	 * @since 1.0.0
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	$geodir_map_options = apply_filters("geodir_map_options_{$map_canvas_name}", $geodir_map_options);
151 151
 
152
-    $map_canvas_arr[$map_canvas_name] = array();
152
+	$map_canvas_arr[$map_canvas_name] = array();
153 153
 
154
-    /**
154
+	/**
155 155
 	 * Filter the post types to display data on map.
156 156
 	 *
157 157
 	 * @since 1.0.0
@@ -169,20 +169,20 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
171 171
 
172
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
173
-        // Set default map options
172
+	if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
173
+		// Set default map options
174 174
 
175
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
175
+		wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
176 176
 
177
-        wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
177
+		wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
178 178
 
179
-        if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') {
180
-            $map_width = '100%';
181
-        } else {
182
-            $map_width = $geodir_map_options['width'];
183
-        }
179
+		if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') {
180
+			$map_width = '100%';
181
+		} else {
182
+			$map_width = $geodir_map_options['width'];
183
+		}
184 184
 
185
-        /**
185
+		/**
186 186
 		 * Filter the width of map.
187 187
 		 *
188 188
 		 * @since 1.0.0
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		 * @param int $map_width Width of map box, eg: gd_place.
191 191
 		 */
192 192
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
193
-        ?>
193
+		?>
194 194
         <div id="catcher_<?php echo $map_canvas_name;?>"></div>
195 195
         <div class="stick_trigger_container">
196 196
             <div class="trigger_sticky triggeroff_sticky"></div>
@@ -224,15 +224,15 @@  discard block
 block discarded – undo
224 224
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
225 225
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
226 226
                 <?php } else {
227
-                    ?>
227
+					?>
228 228
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
229 229
                 <?php }
230 230
 
231
-                if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
232
-                    $show_entire_cat_panel = "none";
233
-                else
234
-                    $show_entire_cat_panel = "''";
235
-                ?>
231
+				if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
232
+					$show_entire_cat_panel = "none";
233
+				else
234
+					$show_entire_cat_panel = "''";
235
+				?>
236 236
 
237 237
                 <?php if ($geodir_map_options['enable_map_direction']) { ?>
238 238
                     <div class="gd-input-group gd-get-directions">
@@ -295,8 +295,8 @@  discard block
 block discarded – undo
295 295
                         <select id="travel-units" onchange="calcRoute('<?php echo $map_canvas_name; ?>')">
296 296
                             <option value="miles"><?php _e('Miles', 'geodirectory'); ?></option>
297 297
                             <option <?php if (get_option('geodir_search_dist_1') == 'km') {
298
-                                echo 'selected="selected"';
299
-                            } ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option>
298
+								echo 'selected="selected"';
299
+							} ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option>
300 300
                         </select>
301 301
                     </div>
302 302
 
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 				if (empty($geodir_default_map_search_pt))
309 309
 					$geodir_default_map_search_pt = 'gd_place';
310 310
 
311
-                global $gd_session;
312
-                $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype');
311
+				global $gd_session;
312
+				$homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype');
313 313
 
314
-                if ($homemap_catlist_ptype) {
315
-                    $geodir_default_map_search_pt = $homemap_catlist_ptype;
316
-                }
314
+				if ($homemap_catlist_ptype) {
315
+					$geodir_default_map_search_pt = $homemap_catlist_ptype;
316
+				}
317 317
 
318 318
 				/**
319 319
 				 * Filter the post type to retrieve data for map
@@ -326,13 +326,13 @@  discard block
 block discarded – undo
326 326
 				?>
327 327
                 <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
328 328
                     <?php
329
-                    $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
330
-                    $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
329
+					$exclude_post_types = get_option('geodir_exclude_post_type_on_map');
330
+					$geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
331 331
 					$map_cat_class = '';
332 332
 					if ($geodir_map_options['enable_post_type_filters']) {
333 333
 						$map_cat_class = $geodir_available_pt_on_map > 1 ? ' map-cat-ptypes' : ' map-cat-floor';
334 334
 					}
335
-                    ?>
335
+					?>
336 336
                     <div
337 337
                         class="map-category-listing<?php echo $map_cat_class;?>">
338 338
                         <div class="gd-trigger gd-triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                                 <?php if ($geodir_map_options['child_collapse']) { $child_collapse = "1"; ?>
351 351
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
352 352
                                 <?php } else {$child_collapse = "0";
353
-                                    ?>
353
+									?>
354 354
                                     <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
355 355
                                 <?php } ?>
356 356
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
                 <!-- map-category-listings-->
373 373
 
374 374
                 <?php
375
-                if ($geodir_map_options['enable_location_filters']) {
376
-                    $country = get_query_var('gd_country');
375
+				if ($geodir_map_options['enable_location_filters']) {
376
+					$country = get_query_var('gd_country');
377 377
 					$region = get_query_var('gd_region');
378 378
 					$city = get_query_var('gd_city');
379
-                    $gd_neighbourhood = get_query_var('gd_neighbourhood');
379
+					$gd_neighbourhood = get_query_var('gd_neighbourhood');
380 380
                     
381
-                    //fix for location/me page
382
-                    $country = $country != 'me' ? $country : '';
381
+					//fix for location/me page
382
+					$country = $country != 'me' ? $country : '';
383 383
 					$region = $region != 'me' ? $region : '';
384 384
 					$city = $country != 'me' ? $city : '';
385
-                    $gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : '';
386
-                    ?>
385
+					$gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : '';
386
+					?>
387 387
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
388 388
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
389 389
                            value="<?php echo $country;?>"/>
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
395 395
                            value="<?php echo $gd_neighbourhood;?>"/>
396 396
                 <?php } else { //end of location filter
397
-                    ?>
397
+					?>
398 398
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
399 399
                 <?php }?>
400 400
 
@@ -405,16 +405,16 @@  discard block
 block discarded – undo
405 405
 
406 406
 
407 407
                 <?php if ($geodir_map_options['enable_post_type_filters']) {
408
-                    $post_types = geodir_get_posttypes('object');
409
-                    $all_post_types = geodir_get_posttypes('names');
410
-                    $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
411
-                    if (is_array($exclude_post_types)) {
412
-                        $map_post_types = array_diff($all_post_types, $exclude_post_types);
413
-                    } else {
414
-                        $map_post_types = $all_post_types;
415
-                    }
416
-                    if (count($map_post_types) > 1) {
417
-                        ?>
408
+					$post_types = geodir_get_posttypes('object');
409
+					$all_post_types = geodir_get_posttypes('names');
410
+					$exclude_post_types = get_option('geodir_exclude_post_type_on_map');
411
+					if (is_array($exclude_post_types)) {
412
+						$map_post_types = array_diff($all_post_types, $exclude_post_types);
413
+					} else {
414
+						$map_post_types = $all_post_types;
415
+					}
416
+					if (count($map_post_types) > 1) {
417
+						?>
418 418
                         <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
419 419
                              style="max-width:<?php echo $map_width;?>!important;">
420 420
 
@@ -424,13 +424,13 @@  discard block
 block discarded – undo
424 424
                                     <?php
425 425
 
426 426
 
427
-                                    foreach ($post_types as $post_type => $args) {
428
-                                        if (!in_array($post_type, $exclude_post_types)) {
429
-                                            $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
427
+									foreach ($post_types as $post_type => $args) {
428
+										if (!in_array($post_type, $exclude_post_types)) {
429
+											$class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
430 430
 											echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __($args->labels->name, 'geodirectory') . '</a></li>';
431
-                                        }
432
-                                    }
433
-                                    ?>
431
+										}
432
+									}
433
+									?>
434 434
                                 </ul>
435 435
                                 <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
436 436
                             </div><?php } ?>
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 
445 445
                         </div> <!-- map-places-listings-->
446 446
                     <?php }
447
-                } // end of post type filter if
448
-                ?>
447
+				} // end of post type filter if
448
+				?>
449 449
 
450 450
             </div>
451 451
         </div> <!--end of stick trigger container-->
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
         </script>
461 461
         <?php
462 462
 
463
-        if (strpos($geodir_map_options['height'], 'vh')) {
464
-            ?>
463
+		if (strpos($geodir_map_options['height'], 'vh')) {
464
+			?>
465 465
             <script>
466 466
                 (function () {
467 467
                     var screenH = jQuery(window).height();
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 
484 484
         <?php
485 485
 
486
-        } elseif (strpos($geodir_map_options['height'], 'px')) {
487
-            ?>
486
+		} elseif (strpos($geodir_map_options['height'], 'px')) {
487
+			?>
488 488
             <script>
489 489
                 (function () {
490 490
                     var screenH = jQuery(window).height();
@@ -499,20 +499,20 @@  discard block
 block discarded – undo
499 499
                 }());
500 500
             </script>
501 501
         <?php
502
-        }
502
+		}
503 503
 
504
-        /**
505
-         * Action that runs after all the map code has been output;
506
-         *
507
-         * @since 1.5.3
508
-         *
509
-         * @param array $geodir_map_options Array of map settings.
510
-         * @param string $map_canvas_name The canvas name and ID for the map.
511
-         */
512
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
504
+		/**
505
+		 * Action that runs after all the map code has been output;
506
+		 *
507
+		 * @since 1.5.3
508
+		 *
509
+		 * @param array $geodir_map_options Array of map settings.
510
+		 * @param string $map_canvas_name The canvas name and ID for the map.
511
+		 */
512
+		do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
513 513
 
514 514
 
515
-    endif; // Exclude posttypes if end
515
+	endif; // Exclude posttypes if end
516 516
 }
517 517
 
518 518
 /**
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -132,12 +132,12 @@  discard block
 block discarded – undo
132 132
 
133 133
     if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
134 134
     } else {
135
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
135
+        $geodir_map_options['height'] = $geodir_map_options['height'].'px';
136 136
     }
137 137
 
138 138
     if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
139 139
     } else {
140
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
140
+        $geodir_map_options['width'] = $geodir_map_options['width'].'px';
141 141
     }
142 142
 
143 143
     /**
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 	 */
170 170
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
171 171
 
172
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
172
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
173 173
         // Set default map options
174 174
 
175
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
175
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
176 176
 
177 177
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
178 178
 
@@ -191,41 +191,41 @@  discard block
 block discarded – undo
191 191
 		 */
192 192
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
193 193
         ?>
194
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
194
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
195 195
         <div class="stick_trigger_container">
196 196
             <div class="trigger_sticky triggeroff_sticky"></div>
197
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
198
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
199
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
197
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
198
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
199
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
200 200
 
201 201
                 <div class="map_background">
202 202
                     <div class="top_banner_section_in clearfix">
203
-                        <div class="<?php echo $map_canvas_name;?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name;?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fa fa-arrows-alt"></i></span></div>
204
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
205
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
206
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
203
+                        <div class="<?php echo $map_canvas_name; ?>_TopLeft TopLeft"><span class="triggermap" id="<?php echo $map_canvas_name; ?>_triggermap" <?php if (!$geodir_map_options['enable_map_resize_button']) { ?> <?php }?>><i class="fa fa-arrows-alt"></i></span></div>
204
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
205
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
206
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
207 207
                             <!-- new map start -->
208 208
                             <div class="iprelative">
209
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
210
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
211
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
212
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
209
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
210
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
211
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
212
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
213 213
                                 <!--<div id="home_map_counter"></div>        -->
214
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
214
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
215 215
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
216
-                                <div id="<?php echo $map_canvas_name;?>_map_notloaded"
216
+                                <div id="<?php echo $map_canvas_name; ?>_map_notloaded"
217 217
                                      class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
218 218
                             </div>
219 219
                             <!-- new map end -->
220 220
                         </div>
221
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
221
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
222 222
                     </div>
223 223
                 </div>
224 224
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
225
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
225
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
226 226
                 <?php } else {
227 227
                     ?>
228
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
228
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
229 229
                 <?php }
230 230
 
231 231
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                       <div class="gd-input-group-addon gd-directions-right gd-mylocation-go"><input type="button" value="<?php _e('Get Directions', 'geodirectory'); ?>" class="<?php echo $map_canvas_name; ?>_getdirection" id="directions" onclick="calcRoute('<?php echo $map_canvas_name; ?>')" /></div>
246 246
                     </div>
247 247
                     <script>
248
-                        <?php if(geodir_is_page('detail')){?>
248
+                        <?php if (geodir_is_page('detail')) {?>
249 249
                         jQuery(function () {
250 250
                             gd_initialize_ac();
251 251
                         });
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                                 // Create the autocomplete object, restricting the search
257 257
                                 // to geographical location types.
258 258
                                 autocomplete = new google.maps.places.Autocomplete(
259
-                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
259
+                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
260 260
                                     {types: ['geocode']});
261 261
                                 // When the user selects an address from the dropdown,
262 262
                                 // populate the address fields in the form.
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                                 
271 271
                                 if (window.gdMaps == 'osm') {
272 272
                                     window.setTimeout(function() {
273
-                                        calcRoute('<?php echo $map_canvas_name;?>');
273
+                                        calcRoute('<?php echo $map_canvas_name; ?>');
274 274
                                     }, 1000);
275 275
                                 }
276 276
                             }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 				 */
325 325
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
326 326
 				?>
327
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
327
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
328 328
                     <?php
329 329
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
330 330
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
 					}
335 335
                     ?>
336 336
                     <div
337
-                        class="map-category-listing<?php echo $map_cat_class;?>">
337
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
338 338
                         <div class="gd-trigger gd-triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
339
-                        <div id="<?php echo $map_canvas_name;?>_cat"
340
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
341
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
342
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
339
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
340
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
341
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
342
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
343 343
                             <input
344 344
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
345 345
                                 type="text"
@@ -351,11 +351,11 @@  discard block
 block discarded – undo
351 351
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
352 352
                                 <?php } else {$child_collapse = "0";
353 353
                                     ?>
354
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
354
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
355 355
                                 <?php } ?>
356 356
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
357 357
                                 <div class="geodir_toggle">
358
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
358
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
359 359
                                     <script>jQuery( document ).ready(function() {
360 360
                                             geodir_show_sub_cat_collapse_button();
361 361
                                         });</script>
@@ -384,21 +384,21 @@  discard block
 block discarded – undo
384 384
 					$city = $country != 'me' ? $city : '';
385 385
                     $gd_neighbourhood = $country != 'me' ? $gd_neighbourhood : '';
386 386
                     ?>
387
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
388
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
389
-                           value="<?php echo $country;?>"/>
390
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
391
-                           value="<?php echo $region;?>"/>
392
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
393
-                           value="<?php echo $city;?>"/>
394
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
395
-                           value="<?php echo $gd_neighbourhood;?>"/>
387
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
388
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
389
+                           value="<?php echo $country; ?>"/>
390
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
391
+                           value="<?php echo $region; ?>"/>
392
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
393
+                           value="<?php echo $city; ?>"/>
394
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
395
+                           value="<?php echo $gd_neighbourhood; ?>"/>
396 396
                 <?php } else { //end of location filter
397 397
                     ?>
398
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
398
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
399 399
                 <?php }?>
400 400
 
401
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
401
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
402 402
 
403 403
                 <input type="hidden" name="limitstart" value=""/>
404 404
 
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
                     }
416 416
                     if (count($map_post_types) > 1) {
417 417
                         ?>
418
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
419
-                             style="max-width:<?php echo $map_width;?>!important;">
418
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
419
+                             style="max-width:<?php echo $map_width; ?>!important;">
420 420
 
421 421
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
422 422
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                                     foreach ($post_types as $post_type => $args) {
428 428
                                         if (!in_array($post_type, $exclude_post_types)) {
429 429
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
430
-											echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __($args->labels->name, 'geodirectory') . '</a></li>';
430
+											echo '<li id="'.$post_type.'" '.$class.'><a href="javascript:void(0);" onclick="jQuery(\'#'.$map_canvas_name.'_posttype\').val(\''.$post_type.'\');build_map_ajax_search_param(\''.$map_canvas_name.'\', true)">'.__($args->labels->name, 'geodirectory').'</a></li>';
431 431
                                         }
432 432
                                     }
433 433
                                     ?>
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
         <script type="text/javascript">
453 453
 
454 454
             jQuery(document).ready(function () {
455
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
456
-                map_sticky('<?php echo $map_canvas_name;?>');
455
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
456
+                map_sticky('<?php echo $map_canvas_name; ?>');
457 457
             });
458 458
 
459 459
         </script>
@@ -464,18 +464,18 @@  discard block
 block discarded – undo
464 464
             <script>
465 465
                 (function () {
466 466
                     var screenH = jQuery(window).height();
467
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
467
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
468 468
 
469 469
                     var ptypeH = '';
470
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
471
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
470
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
471
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
472 472
                     }
473 473
 
474
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
475
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
476
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
477
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
478
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
474
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
475
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
476
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
477
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
478
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
479 479
 
480 480
                 }());
481 481
             </script>
@@ -487,13 +487,13 @@  discard block
 block discarded – undo
487 487
             <script>
488 488
                 (function () {
489 489
                     var screenH = jQuery(window).height();
490
-                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
490
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
491 491
                     var ptypeH = '';
492
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
493
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
492
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
493
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
494 494
                     }
495 495
 
496
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
496
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
497 497
 
498 498
                 }());
499 499
             </script>
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
          * @param array $geodir_map_options Array of map settings.
509 509
          * @param string $map_canvas_name The canvas name and ID for the map.
510 510
          */
511
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
511
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
512 512
 
513 513
 
514 514
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_on_add_listing_page.php 3 patches
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,9 +46,10 @@  discard block
 block discarded – undo
46 46
 $default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
47 47
 if (is_admin() && isset($_REQUEST['tab']) && $mapzoom == '') {
48 48
     $mapzoom = 4;
49
-    if (isset($_REQUEST['add_hood']))
50
-        $mapzoom = 10;
51
-}
49
+    if (isset($_REQUEST['add_hood'])) {
50
+            $mapzoom = 10;
51
+    }
52
+    }
52 53
 
53 54
 /**
54 55
  * Filter the auto change address fields values
@@ -737,8 +738,9 @@  discard block
 block discarded – undo
737 738
 </script>
738 739
 <?php
739 740
 $set_button_class = 'geodir_button';
740
-if (is_admin())
741
-    $set_button_class = 'button-primary';
741
+if (is_admin()) {
742
+    $set_button_class = 'button-primary';
743
+}
742 744
 ?>
743 745
 <input type="button" id="<?php echo $prefix; ?>set_address_button" class="<?php echo $set_button_class; ?>" value="<?php esc_attr_e($map_title, 'geodirectory'); ?>" style="float:none;"/>
744 746
 <div id="<?php echo $prefix; ?>d_mouseClick"></div>
Please login to merge, or discard this patch.
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -35,19 +35,19 @@  discard block
 block discarded – undo
35 35
 $defaultcity = isset($default_location->city) ? $default_location->city : '';
36 36
 $lat_lng_blank = false;
37 37
 if ($lat == '' && $lng == '') {
38
-    $lat_lng_blank = true;
39
-    $city = $defaultcity;
40
-    $region = isset($default_location->region) ? $default_location->region : '';
41
-    $country = isset($default_location->country) ? $default_location->country : '';
42
-    $lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
43
-    $lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
38
+	$lat_lng_blank = true;
39
+	$city = $defaultcity;
40
+	$region = isset($default_location->region) ? $default_location->region : '';
41
+	$country = isset($default_location->country) ? $default_location->country : '';
42
+	$lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
43
+	$lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
44 44
 }
45 45
 $default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
46 46
 $default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
47 47
 if (is_admin() && isset($_REQUEST['tab']) && $mapzoom == '') {
48
-    $mapzoom = 4;
49
-    if (isset($_REQUEST['add_hood']))
50
-        $mapzoom = 10;
48
+	$mapzoom = 4;
49
+	if (isset($_REQUEST['add_hood']))
50
+		$mapzoom = 10;
51 51
 }
52 52
 
53 53
 /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * Fires at the start of the add javascript on the add lsitings map.
69 69
 	 *
70 70
 	 * @since 1.0.0
71
-     * @param string $prefix The prefix for all elements.
71
+	 * @param string $prefix The prefix for all elements.
72 72
 	 */
73 73
 	do_action('geodir_add_listing_js_start', $prefix);
74 74
 	?>
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
             // fix for regions in GB
261 261
 
262 262
             $country_arr = <?php
263
-            /**
264
-             * Filter the regions array that uses administrative_area_level_2 instead of administrative_area_level_1.
265
-             *
266
-             * @since 1.6.16
267
-             */
268
-            echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
263
+			/**
264
+			 * Filter the regions array that uses administrative_area_level_2 instead of administrative_area_level_1.
265
+			 *
266
+			 * @since 1.6.16
267
+			 */
268
+			echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
269 269
             if (jQuery.inArray(rr, $country_arr) !== -1) {
270 270
                 if (administrative_area_level_2.long_name) {
271 271
                     getState = administrative_area_level_2.long_name;
@@ -346,13 +346,13 @@  discard block
 block discarded – undo
346 346
                 getZip = postal_code.long_name;
347 347
             }
348 348
             <?php 
349
-            /**
350
-             * Fires to add javascript variable to use in google map.
351
-             *
352
-             * @since 1.0.0
353
-             */
354
-            do_action('geodir_add_listing_geocode_js_vars');
355
-            ?>
349
+			/**
350
+			 * Fires to add javascript variable to use in google map.
351
+			 *
352
+			 * @since 1.0.0
353
+			 */
354
+			do_action('geodir_add_listing_geocode_js_vars');
355
+			?>
356 356
             <?php if ($is_map_restrict) { ?>
357 357
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
358 358
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -433,15 +433,15 @@  discard block
 block discarded – undo
433 433
             }
434 434
         }
435 435
         <?php
436
-        /**
437
-         * Fires when marker address updated on map.
438
-         *
439
-         * @since 1.0.0
440
-         * @param string $prefix Identifier used as a prefix for field name
441
-         */
442
-        do_action('geodir_update_marker_address', $prefix);
443
-        echo $updateMarkerAddress = ob_get_clean();
444
-        ?>
436
+		/**
437
+		 * Fires when marker address updated on map.
438
+		 *
439
+		 * @since 1.0.0
440
+		 * @param string $prefix Identifier used as a prefix for field name
441
+		 */
442
+		do_action('geodir_update_marker_address', $prefix);
443
+		echo $updateMarkerAddress = ob_get_clean();
444
+		?>
445 445
     }
446 446
     function geodir_codeAddress(set_on_map) {
447 447
         var address = jQuery('#<?php echo $prefix.'address';?>').val();
@@ -456,17 +456,17 @@  discard block
 block discarded – undo
456 456
         }
457 457
         if(!ISO2){
458 458
             <?php
459
-            if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
460
-                global $wpdb;
461
-                $location_result = geodir_get_default_location();
462
-                if(!empty($location_result)){
463
-                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
464
-                    echo "ISO2 = '$ISO2';";
465
-                }
466
-            }
459
+			if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
460
+				global $wpdb;
461
+				$location_result = geodir_get_default_location();
462
+				if(!empty($location_result)){
463
+					$ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
464
+					echo "ISO2 = '$ISO2';";
465
+				}
466
+			}
467 467
 
468 468
 
469
-            ?>
469
+			?>
470 470
         }
471 471
         if (ISO2 == '--') {
472 472
             ISO2 = '';
@@ -486,9 +486,9 @@  discard block
 block discarded – undo
486 486
         }
487 487
         var is_restrict = '<?php echo $is_map_restrict; ?>';
488 488
         <?php ob_start();
489
-        $defaultregion = isset($default_location->region) ? $default_location->region : '';
490
-        $defaultcountry = isset($default_location->country) ? $default_location->country : '';
491
-        ?>
489
+		$defaultregion = isset($default_location->region) ? $default_location->region : '';
490
+		$defaultcountry = isset($default_location->country) ? $default_location->country : '';
491
+		?>
492 492
         if (set_on_map && is_restrict) {
493 493
             if (zip != '' && address != '') {
494 494
                 address = address + ',' + zip;
@@ -500,12 +500,12 @@  discard block
 block discarded – undo
500 500
             if( address == city || address == region || address == country || address == zip )
501 501
                 address = '';
502 502
             <?php
503
-            if(is_admin() && isset($_REQUEST['tab'])){?>
503
+			if(is_admin() && isset($_REQUEST['tab'])){?>
504 504
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
505 505
                 address = '';
506 506
             }
507 507
             <?php
508
-               }?>
508
+			   }?>
509 509
 
510 510
             if (ISO2 == 'GB') {
511 511
                 address = address + ',' + city + ',' + country; // UK is funny with regions
@@ -521,15 +521,15 @@  discard block
 block discarded – undo
521 521
             address =  address.replace(",null,", ",");
522 522
         }
523 523
         <?php $codeAddress = ob_get_clean();
524
-        /**
525
-         * Filter the address variable
526
-         *
527
-         * @since 1.0.0
528
-         *
529
-         * @param string $codeAddress Row of address to use in google map.
530
-         */
531
-        echo apply_filters('geodir_codeaddress', $codeAddress);
532
-        ?>
524
+		/**
525
+		 * Filter the address variable
526
+		 *
527
+		 * @since 1.0.0
528
+		 *
529
+		 * @param string $codeAddress Row of address to use in google map.
530
+		 */
531
+		echo apply_filters('geodir_codeaddress', $codeAddress);
532
+		?>
533 533
         if (!window.gdMaps) { // No Google Map Loaded
534 534
             return;
535 535
         }
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
                         updateMarkerPosition(baseMarker.getPosition());
555 555
                         //if(set_on_map && is_restrict) {
556 556
                         <?php 
557
-                        /**
558
-                         * Fires before set geocode position.
559
-                         *
560
-                         * @since 1.0.0
561
-                         */
562
-                        do_action('geodir_add_listing_codeaddress_before_geocode');
563
-                        ?>
557
+						/**
558
+						 * Fires before set geocode position.
559
+						 *
560
+						 * @since 1.0.0
561
+						 */
562
+						do_action('geodir_add_listing_codeaddress_before_geocode');
563
+						?>
564 564
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
565 565
                         //}
566 566
                     } else {
@@ -606,13 +606,13 @@  discard block
 block discarded – undo
606 606
                 updateMarkerPositionOSM(baseMarker.getLatLng());
607 607
             }
608 608
             <?php 
609
-            /**
610
-             * Fires to add javascript variable to use in google map.
611
-             *
612
-             * @since 1.0.0
613
-             */
614
-            do_action('geodir_add_listing_geocode_js_vars');
615
-            ?>
609
+			/**
610
+			 * Fires to add javascript variable to use in google map.
611
+			 *
612
+			 * @since 1.0.0
613
+			 */
614
+			do_action('geodir_add_listing_geocode_js_vars');
615
+			?>
616 616
             <?php if ($is_map_restrict) { ?>
617 617
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
618 618
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 <?php
762 762
 $set_button_class = 'geodir_button';
763 763
 if (is_admin())
764
-    $set_button_class = 'button-primary';
764
+	$set_button_class = 'button-primary';
765 765
 ?>
766 766
 <input type="button" id="<?php echo $prefix; ?>set_address_button" class="<?php echo $set_button_class; ?>" value="<?php esc_attr_e($map_title, 'geodirectory'); ?>" style="float:none;"/>
767 767
 <div id="<?php echo $prefix; ?>d_mouseClick"></div>
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
     window.gdMaps = window.gdMaps || gdMaps;
83 83
     
84 84
     user_address = false;
85
-    jQuery('#<?php echo $prefix.'address';?>').keypress(function () {
85
+    jQuery('#<?php echo $prefix.'address'; ?>').keypress(function () {
86 86
         user_address = true;
87 87
     });
88 88
 
89 89
     baseMarker = '';
90 90
     geocoder = '';
91
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat :  '39.952484'; ?>;
92
-    var <?php echo $prefix;?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng :  '-75.163786'; ?>;
93
-    <?php if($lat_lng_blank){$lat='';$lng='';}?>
94
-    var <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12;?>;
91
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LAT = <?php echo ($lat) ? $lat : '39.952484'; ?>;
92
+    var <?php echo $prefix; ?>CITY_MAP_CENTER_LNG = <?php echo ($lng) ? $lng : '-75.163786'; ?>;
93
+    <?php if ($lat_lng_blank) {$lat = ''; $lng = ''; }?>
94
+    var <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT = <?php echo ($mapzoom) ? $mapzoom : 12; ?>;
95 95
     var minZoomLevel = <?php echo ($is_map_restrict) ? 5 : 0; ?>;
96 96
     var oldstr_address;
97 97
     var oldstr_zip;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
              *
296 296
              * @since 1.6.16
297 297
              */
298
-            echo apply_filters("geodir_geocode_region_level",'["GB","ES"]');?>;
298
+            echo apply_filters("geodir_geocode_region_level", '["GB","ES"]'); ?>;
299 299
             if (jQuery.inArray(rr, $country_arr) !== -1) {
300 300
                 if (administrative_area_level_2.long_name) {
301 301
                     getState = administrative_area_level_2.long_name;
@@ -404,9 +404,9 @@  discard block
 block discarded – undo
404 404
             do_action('geodir_add_listing_geocode_js_vars');
405 405
             ?>
406 406
             <?php if ($is_map_restrict) { ?>
407
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
408
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
409
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
407
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
408
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
409
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
410 410
                 jQuery.goMap.map.setCenter(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
411 411
                 baseMarker.setPosition(new google.maps.LatLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
412 412
                 updateMarkerPosition(baseMarker.getPosition());
@@ -415,11 +415,11 @@  discard block
 block discarded – undo
415 415
             <?php } ?>
416 416
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
417 417
         } else {
418
-            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
418
+            updateMarkerAddress('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
419 419
         }
420 420
     }
421 421
     function centerMap(latlng) {
422
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
422
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
423 423
         if (window.gdMaps == 'google') {
424 424
             jQuery.goMap.map.panTo(baseMarker.getPosition());
425 425
         } else if (window.gdMaps == 'osm') {
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
         }
429 429
     }
430 430
     function centerMarker() {
431
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
431
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
432 432
         var center = jQuery.goMap.map.getCenter();
433 433
         if (window.gdMaps == 'google') {
434 434
             baseMarker.setPosition(center);
@@ -437,48 +437,48 @@  discard block
 block discarded – undo
437 437
         }
438 438
     }
439 439
     function updateMapZoom(zoom) {
440
-        jQuery('#<?php echo $prefix.'mapzoom';?>').val(zoom);
440
+        jQuery('#<?php echo $prefix.'mapzoom'; ?>').val(zoom);
441 441
     }
442 442
     function updateMarkerPosition(markerlatLng) {
443
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
444
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat());
445
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng());
443
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
444
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat());
445
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng());
446 446
     }
447 447
     function updateMarkerPositionOSM(markerlatLng) {
448
-        jQuery('#<?php echo $prefix.'latitude';?>').val(markerlatLng.lat);
449
-        jQuery('#<?php echo $prefix.'longitude';?>').val(markerlatLng.lng);
448
+        jQuery('#<?php echo $prefix.'latitude'; ?>').val(markerlatLng.lat);
449
+        jQuery('#<?php echo $prefix.'longitude'; ?>').val(markerlatLng.lng);
450 450
     }
451 451
     function updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry) {
452
-        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields);?>';
453
-        <?php ob_start();?>
454
-        var old_country = jQuery("#<?php echo $prefix.'country';?>").val();
455
-        var old_region = jQuery("#<?php echo $prefix.'region';?>").val();
452
+        var set_map_val_in_fields = '<?php echo addslashes_gpc($auto_change_map_fields); ?>';
453
+        <?php ob_start(); ?>
454
+        var old_country = jQuery("#<?php echo $prefix.'country'; ?>").val();
455
+        var old_region = jQuery("#<?php echo $prefix.'region'; ?>").val();
456 456
         
457
-        if (user_address == false || jQuery('#<?php echo $prefix.'address';?>').val() == '') {
458
-            jQuery("#<?php echo $prefix.'address';?>").val(getAddress).trigger("blur");
457
+        if (user_address == false || jQuery('#<?php echo $prefix.'address'; ?>').val() == '') {
458
+            jQuery("#<?php echo $prefix.'address'; ?>").val(getAddress).trigger("blur");
459 459
         }
460 460
         if (getAddress) {
461 461
             oldstr_address = getAddress;
462 462
         }
463 463
 
464
-        jQuery("#<?php echo $prefix.'zip';?>").val(getZip);
464
+        jQuery("#<?php echo $prefix.'zip'; ?>").val(getZip);
465 465
         if (getZip) {
466 466
             oldstr_zip = getZip;
467 467
         }
468 468
         if (set_map_val_in_fields) {
469 469
             if (getCountry) {
470
-                jQuery('#<?php echo $prefix .'country'; ?> option[value=""]').attr("selected",false);
471
-                jQuery('#<?php echo $prefix.'country';?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
472
-                jQuery("#<?php echo $prefix.'country';?>").trigger("chosen:updated");
470
+                jQuery('#<?php echo $prefix.'country'; ?> option[value=""]').attr("selected",false);
471
+                jQuery('#<?php echo $prefix.'country'; ?> option[data-country_code="' + getCountryISO + '"]').attr("selected", true);
472
+                jQuery("#<?php echo $prefix.'country'; ?>").trigger("chosen:updated");
473 473
             }
474 474
             if (getState) {
475
-                if (jQuery('input[id="<?php echo $prefix.'region';?>"]').attr('id')) {
476
-                    jQuery("#<?php echo $prefix.'region';?>").val(getState);
475
+                if (jQuery('input[id="<?php echo $prefix.'region'; ?>"]').attr('id')) {
476
+                    jQuery("#<?php echo $prefix.'region'; ?>").val(getState);
477 477
                 }
478 478
             }
479 479
             if (getCity) {
480
-                if (jQuery('input[id="<?php echo $prefix.'city';?>"]').attr('id')) {
481
-                    jQuery("#<?php echo $prefix.'city';?>").val(getCity);
480
+                if (jQuery('input[id="<?php echo $prefix.'city'; ?>"]').attr('id')) {
481
+                    jQuery("#<?php echo $prefix.'city'; ?>").val(getCity);
482 482
                 }
483 483
             }
484 484
         }
@@ -494,23 +494,23 @@  discard block
 block discarded – undo
494 494
         ?>
495 495
     }
496 496
     function geodir_codeAddress(set_on_map) {
497
-        var address = jQuery('#<?php echo $prefix.'address';?>').val();
498
-        var zip = jQuery('#<?php echo $prefix.'zip';?>').val();
499
-        var city = jQuery('#<?php echo $prefix.'city';?>').val();
500
-        var region = jQuery('#<?php echo $prefix.'region';?>').val();
501
-        var country = jQuery('#<?php echo $prefix.'country';?>').val();
502
-        var country_selected = jQuery('#<?php echo $prefix.'country';?>').find('option:selected');
497
+        var address = jQuery('#<?php echo $prefix.'address'; ?>').val();
498
+        var zip = jQuery('#<?php echo $prefix.'zip'; ?>').val();
499
+        var city = jQuery('#<?php echo $prefix.'city'; ?>').val();
500
+        var region = jQuery('#<?php echo $prefix.'region'; ?>').val();
501
+        var country = jQuery('#<?php echo $prefix.'country'; ?>').val();
502
+        var country_selected = jQuery('#<?php echo $prefix.'country'; ?>').find('option:selected');
503 503
         var ISO2 = country_selected.data('country_code');
504
-        if (!ISO2 && jQuery('#<?php echo $prefix.'country';?>').data('country_code')) {
505
-            ISO2 = jQuery('#<?php echo $prefix.'country';?>').data('country_code');
504
+        if (!ISO2 && jQuery('#<?php echo $prefix.'country'; ?>').data('country_code')) {
505
+            ISO2 = jQuery('#<?php echo $prefix.'country'; ?>').data('country_code');
506 506
         }
507 507
         if(!ISO2){
508 508
             <?php
509
-            if(!defined('GEODIRLOCATION_TEXTDOMAIN')){
509
+            if (!defined('GEODIRLOCATION_TEXTDOMAIN')) {
510 510
                 global $wpdb;
511 511
                 $location_result = geodir_get_default_location();
512
-                if(!empty($location_result)){
513
-                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM " . GEODIR_COUNTRIES_TABLE . " WHERE Country=%s",$location_result->country));
512
+                if (!empty($location_result)) {
513
+                    $ISO2 = $wpdb->get_var($wpdb->prepare("SELECT ISO2 FROM ".GEODIR_COUNTRIES_TABLE." WHERE Country=%s", $location_result->country));
514 514
                     echo "ISO2 = '$ISO2';";
515 515
                 }
516 516
             }
@@ -526,13 +526,13 @@  discard block
 block discarded – undo
526 526
             zip = '';
527 527
         }
528 528
         if (typeof city == "undefined") {
529
-            city = '<?php echo addslashes_gpc($city);?>';
529
+            city = '<?php echo addslashes_gpc($city); ?>';
530 530
         }
531 531
         if (typeof region == "undefined") {
532
-            region = '<?php echo addslashes_gpc($region);?>';
532
+            region = '<?php echo addslashes_gpc($region); ?>';
533 533
         }
534 534
         if (typeof country == "undefined") {
535
-            country = '<?php echo addslashes_gpc($country);?>';
535
+            country = '<?php echo addslashes_gpc($country); ?>';
536 536
         }
537 537
         var is_restrict = '<?php echo $is_map_restrict; ?>';
538 538
         <?php ob_start();
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
             if( address == city || address == region || address == country || address == zip )
551 551
                 address = '';
552 552
             <?php
553
-            if(is_admin() && isset($_REQUEST['tab'])){?>
553
+            if (is_admin() && isset($_REQUEST['tab'])) {?>
554 554
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
555 555
                 address = '';
556 556
             }
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
             geocoder.geocode({'address': address, 'country': ISO2},
598 598
                 function (results, status) {
599 599
                     console.log(status);
600
-                    jQuery("#<?php echo $prefix.'map';?>").goMap();
600
+                    jQuery("#<?php echo $prefix.'map'; ?>").goMap();
601 601
                     if (status == google.maps.GeocoderStatus.OK) {
602 602
                         baseMarker.setPosition(results[0].geometry.location);
603 603
                         jQuery.goMap.map.setCenter(results[0].geometry.location);
@@ -614,21 +614,21 @@  discard block
 block discarded – undo
614 614
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
615 615
                         //}
616 616
                     } else {
617
-                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:','geodirectory'));?> ' + status);
617
+                        alert('<?php echo addslashes_gpc(__('Geocode was not successful for the following reason:', 'geodirectory')); ?> ' + status);
618 618
                     }
619 619
                 });
620 620
         }
621 621
     }
622 622
     function gdMaxMap() {
623
-        jQuery("#<?php echo $prefix.'map';?>").goMap();
623
+        jQuery("#<?php echo $prefix.'map'; ?>").goMap();
624 624
 
625
-        jQuery('#<?php echo $prefix.'map';?>').toggleClass('map-fullscreen');
625
+        jQuery('#<?php echo $prefix.'map'; ?>').toggleClass('map-fullscreen');
626 626
         jQuery('.map_category').toggleClass('map_category_fullscreen');
627
-        jQuery('#<?php echo $prefix;?>trigger').toggleClass('map_category_fullscreen');
627
+        jQuery('#<?php echo $prefix; ?>trigger').toggleClass('map_category_fullscreen');
628 628
         jQuery('body').toggleClass('body_fullscreen');
629
-        jQuery('#<?php echo $prefix;?>loading_div').toggleClass('loading_div_fullscreen');
630
-        jQuery('#<?php echo $prefix;?>advmap_nofound').toggleClass('nofound_fullscreen');
631
-        jQuery('#<?php echo $prefix;?>triggermap').toggleClass('triggermap_fullscreen');
629
+        jQuery('#<?php echo $prefix; ?>loading_div').toggleClass('loading_div_fullscreen');
630
+        jQuery('#<?php echo $prefix; ?>advmap_nofound').toggleClass('nofound_fullscreen');
631
+        jQuery('#<?php echo $prefix; ?>triggermap').toggleClass('triggermap_fullscreen');
632 632
         jQuery('.TopLeft').toggleClass('TopLeft_fullscreen');
633 633
         window.setTimeout(function () {
634 634
             if (window.gdMaps == 'google') {
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
             do_action('geodir_add_listing_geocode_js_vars');
665 665
             ?>
666 666
             <?php if ($is_map_restrict) { ?>
667
-            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
668
-                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
669
-                jQuery("#<?php echo $prefix.'map';?>").goMap();
667
+            if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city)); ?>') {
668
+                alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.', 'geodirectory'), $city)); ?>');
669
+                jQuery("#<?php echo $prefix.'map'; ?>").goMap();
670 670
                 centerMap(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
671 671
                 baseMarker.setLatLng(new L.latLng('<?php echo $default_lat; ?>', '<?php echo $default_lng; ?>'));
672 672
                 updateMarkerPositionOSM(baseMarker.getLatLng());
@@ -675,39 +675,39 @@  discard block
 block discarded – undo
675 675
             <?php } ?>
676 676
             updateMarkerAddress(getAddress, getZip, getCity, getState, getCountry);
677 677
         } else {
678
-            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.','geodirectory'));?>');
678
+            alert('<?php echo addslashes_gpc(__('Cannot determine address at this location.', 'geodirectory')); ?>');
679 679
         }
680 680
     }
681 681
     
682 682
     jQuery(function ($) {
683
-        $("#<?php echo $prefix.'map';?>").goMap({
684
-            latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
685
-            longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
686
-            zoom: <?php echo $prefix;?>CITY_MAP_ZOOMING_FACT,
683
+        $("#<?php echo $prefix.'map'; ?>").goMap({
684
+            latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
685
+            longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
686
+            zoom: <?php echo $prefix; ?>CITY_MAP_ZOOMING_FACT,
687 687
             maptype: 'ROADMAP', // Map type - HYBRID, ROADMAP, SATELLITE, TERRAIN
688 688
             streetViewControl: true,
689
-            <?php if(get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,';}?>
689
+            <?php if (get_option('geodir_add_listing_mouse_scroll')) { echo 'scrollwheel: false,'; }?>
690 690
         });
691 691
 
692 692
         if (window.gdMaps) {
693 693
             geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : [];
694 694
 
695 695
             baseMarker = $.goMap.createMarker({
696
-                latitude: <?php echo $prefix;?>CITY_MAP_CENTER_LAT,
697
-                longitude: <?php echo $prefix;?>CITY_MAP_CENTER_LNG,
696
+                latitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LAT,
697
+                longitude: <?php echo $prefix; ?>CITY_MAP_CENTER_LNG,
698 698
                 id: 'baseMarker',
699
-                icon: '<?php echo $marker_icon;?>',
699
+                icon: '<?php echo $marker_icon; ?>',
700 700
                 draggable: true,
701 701
                 addToMap: true, // For OSM
702
-                w: parseFloat('<?php echo $icon_size['w'];?>'),
703
-                h: parseFloat('<?php echo $icon_size['h'];?>'),
702
+                w: parseFloat('<?php echo $icon_size['w']; ?>'),
703
+                h: parseFloat('<?php echo $icon_size['h']; ?>'),
704 704
             });
705 705
         } else {
706
-            jQuery('#<?php echo $prefix.'advmap_nofound';?>').hide();
707
-            jQuery('#<?php echo $prefix.'advmap_notloaded';?>').show();
706
+            jQuery('#<?php echo $prefix.'advmap_nofound'; ?>').hide();
707
+            jQuery('#<?php echo $prefix.'advmap_notloaded'; ?>').show();
708 708
         }
709 709
         
710
-        $("#<?php echo $prefix;?>set_address_button").click(function () {
710
+        $("#<?php echo $prefix; ?>set_address_button").click(function () {
711 711
             var set_on_map = true;
712 712
             geodir_codeAddress(set_on_map);
713 713
         });
@@ -742,14 +742,14 @@  discard block
 block discarded – undo
742 742
                 updateMapZoom($.goMap.map.zoom);
743 743
             });
744 744
 
745
-            var maxMap = document.getElementById('<?php echo $prefix;?>triggermap');
745
+            var maxMap = document.getElementById('<?php echo $prefix; ?>triggermap');
746 746
             google.maps.event.addDomListener(maxMap, 'click', gdMaxMap);
747 747
 
748 748
             <?php if ($is_map_restrict) { ?>
749
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country);?>';
749
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).','.addslashes_gpc($region).','.addslashes_gpc($country); ?>';
750 750
             geocoder.geocode({'address': CITY_ADDRESS},
751 751
                 function (results, status) {
752
-                    $("#<?php echo $prefix.'map';?>").goMap();
752
+                    $("#<?php echo $prefix.'map'; ?>").goMap();
753 753
                     if (status == google.maps.GeocoderStatus.OK) {
754 754
                         // Bounds for North America
755 755
                         var bound_lat_lng = String(results[0].geometry.bounds);
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
                             new google.maps.LatLng(bound_lat_lng[2], bound_lat_lng[3])
761 761
                         );
762 762
                     } else {
763
-                        alert("<?php _e('Geocode was not successful for the following reason:','geodirectory');?> " + status);
763
+                        alert("<?php _e('Geocode was not successful for the following reason:', 'geodirectory'); ?> " + status);
764 764
                     }
765 765
                 });
766 766
             <?php } ?>
767 767
             // Limit the zoom level
768 768
             google.maps.event.addListener($.goMap.map, 'zoom_changed', function () {
769
-                $("#<?php echo $prefix.'map';?>").goMap();
769
+                $("#<?php echo $prefix.'map'; ?>").goMap();
770 770
                 if ($.goMap.map.getZoom() < minZoomLevel) $.goMap.map.setZoom(minZoomLevel);
771 771
             });
772 772
         } else if (window.gdMaps == 'osm') {
@@ -792,10 +792,10 @@  discard block
 block discarded – undo
792 792
                 updateMapZoom($.goMap.map.getZoom());
793 793
             });
794 794
 
795
-            L.DomEvent.addListener($('<?php echo $prefix;?>triggermap'), 'click', gdMaxMap);
795
+            L.DomEvent.addListener($('<?php echo $prefix; ?>triggermap'), 'click', gdMaxMap);
796 796
 
797 797
             <?php if ($is_map_restrict) { ?>
798
-            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country);?>';
798
+            var CITY_ADDRESS = '<?php echo addslashes_gpc($city).', '.addslashes_gpc($region).', '.addslashes_gpc($country); ?>';
799 799
             geocodePositionOSM('', CITY_ADDRESS);
800 800
             <?php } ?>
801 801
             // Limit the zoom level
@@ -818,14 +818,14 @@  discard block
 block discarded – undo
818 818
 <div class="top_banner_section_inn geodir_map_container clearfix" style="margin-top:10px;">
819 819
     <div class="TopLeft"><span id="<?php echo $prefix; ?>triggermap" style="margin-top:-11px;margin-left:-12px;"></span></div>
820 820
     <div class="TopRight"></div>
821
-    <div id="<?php echo $prefix . 'map'; ?>" class="geodir_map" style="height:300px">
821
+    <div id="<?php echo $prefix.'map'; ?>" class="geodir_map" style="height:300px">
822 822
         <!-- new map start -->
823 823
         <div class="iprelative">
824
-            <div id="<?php echo $prefix . 'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
824
+            <div id="<?php echo $prefix.'map'; ?>" style="float:right;height:300px;position:relative;" class="form_row clearfix"></div>
825 825
             <div id="<?php echo $prefix; ?>loading_div" style="height:300px"></div>
826 826
             <div id="<?php echo $prefix; ?>advmap_counter"></div>
827 827
             <div id="<?php echo $prefix; ?>advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
828
-            <div id="<?php echo $prefix;?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
828
+            <div id="<?php echo $prefix; ?>advmap_notloaded" class="advmap_notloaded"><?php _e('<h3>Map Not Loaded</h3><p>Sorry, unable to load Maps API.', 'geodirectory'); ?></div>
829 829
         </div>
830 830
         <!-- new map end -->
831 831
     </div>
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -427,7 +427,7 @@
 block discarded – undo
427 427
         }
428 428
 
429 429
         return $output;
430
-    }else{
430
+    } else{
431 431
         ob_start();
432 432
         add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
433 433
         add_action('the_post', 'create_list_jsondata'); // Add marker in json array
Please login to merge, or discard this patch.
Indentation   +909 added lines, -909 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // If this file is called directly, abort.
9 9
 if (!defined('WPINC')) {
10
-    die;
10
+	die;
11 11
 }
12 12
 require_once('geodirectory-functions/shortcode_functions.php');
13 13
 
@@ -32,43 +32,43 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function geodir_sc_add_listing($atts)
34 34
 {
35
-    ob_start();
36
-    $defaults = array(
37
-        'pid' => '',
38
-        'listing_type' => 'gd_place',
39
-        'login_msg' => __('You must login to post.', 'geodirectory'),
40
-        'show_login' => false,
41
-    );
42
-    $params = shortcode_atts($defaults, $atts);
43
-
44
-    foreach ($params as $key => $value) {
45
-        $_REQUEST[$key] = $value;
46
-    }
47
-
48
-    $user_id = get_current_user_id();
49
-    if (!$user_id) {
50
-        echo $params['login_msg'];
51
-        if ($params['show_login']) {
52
-            echo "<br />";
53
-            $defaults = array(
54
-                'before_widget' => '',
55
-                'after_widget' => '',
56
-                'before_title' => '',
57
-                'after_title' => '',
58
-            );
59
-
60
-            geodir_loginwidget_output($defaults, $defaults);
61
-        }
62
-
63
-
64
-    } else {
65
-       // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
-    }
67
-    $output = ob_get_contents();
68
-
69
-    ob_end_clean();
70
-
71
-    return $output;
35
+	ob_start();
36
+	$defaults = array(
37
+		'pid' => '',
38
+		'listing_type' => 'gd_place',
39
+		'login_msg' => __('You must login to post.', 'geodirectory'),
40
+		'show_login' => false,
41
+	);
42
+	$params = shortcode_atts($defaults, $atts);
43
+
44
+	foreach ($params as $key => $value) {
45
+		$_REQUEST[$key] = $value;
46
+	}
47
+
48
+	$user_id = get_current_user_id();
49
+	if (!$user_id) {
50
+		echo $params['login_msg'];
51
+		if ($params['show_login']) {
52
+			echo "<br />";
53
+			$defaults = array(
54
+				'before_widget' => '',
55
+				'after_widget' => '',
56
+				'before_title' => '',
57
+				'after_title' => '',
58
+			);
59
+
60
+			geodir_loginwidget_output($defaults, $defaults);
61
+		}
62
+
63
+
64
+	} else {
65
+	   // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
+	}
67
+	$output = ob_get_contents();
68
+
69
+	ob_end_clean();
70
+
71
+	return $output;
72 72
 }
73 73
 
74 74
 /**
@@ -96,136 +96,136 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function geodir_sc_home_map($atts)
98 98
 {
99
-    ob_start();
100
-    $defaults = array(
101
-        'width' => '960',
102
-        'height' => '425',
103
-        'maptype' => 'ROADMAP',
104
-        'zoom' => '13',
105
-        'autozoom' => '',
106
-        'child_collapse' => '0',
107
-        'scrollwheel' => '0',
99
+	ob_start();
100
+	$defaults = array(
101
+		'width' => '960',
102
+		'height' => '425',
103
+		'maptype' => 'ROADMAP',
104
+		'zoom' => '13',
105
+		'autozoom' => '',
106
+		'child_collapse' => '0',
107
+		'scrollwheel' => '0',
108 108
 		'marker_cluster' => false,
109
-        'latitude' => '',
110
-        'longitude' => ''
111
-    );
112
-
113
-    $params = shortcode_atts($defaults, $atts);
114
-
115
-    $params = gdsc_validate_map_args($params);
116
-
117
-    $map_args = array(
118
-        'map_canvas_name' => 'gd_home_map',
119
-        'latitude' => $params['latitude'],
120
-        'longitude' => $params['longitude'],
121
-
122
-        /**
123
-         * Filter the widget width of the map on home/listings page.
124
-         *
125
-         * @since 1.0.0
126
-         * @param mixed(string|int|float) $params['width'] The map width.
127
-         */
128
-        'width' => apply_filters('widget_width', $params['width']),
129
-        /**
130
-         * Filter the widget height of the map on home/listings page.
131
-         *
132
-         * @since 1.0.0
133
-         * @param mixed(string|int|float) $params['height'] The map height.
134
-         */
135
-        'height' => apply_filters('widget_heigh', $params['height']),
136
-        /**
137
-         * Filter the widget maptype of the map on home/listings page.
138
-         *
139
-         * @since 1.0.0
109
+		'latitude' => '',
110
+		'longitude' => ''
111
+	);
112
+
113
+	$params = shortcode_atts($defaults, $atts);
114
+
115
+	$params = gdsc_validate_map_args($params);
116
+
117
+	$map_args = array(
118
+		'map_canvas_name' => 'gd_home_map',
119
+		'latitude' => $params['latitude'],
120
+		'longitude' => $params['longitude'],
121
+
122
+		/**
123
+		 * Filter the widget width of the map on home/listings page.
124
+		 *
125
+		 * @since 1.0.0
126
+		 * @param mixed(string|int|float) $params['width'] The map width.
127
+		 */
128
+		'width' => apply_filters('widget_width', $params['width']),
129
+		/**
130
+		 * Filter the widget height of the map on home/listings page.
131
+		 *
132
+		 * @since 1.0.0
133
+		 * @param mixed(string|int|float) $params['height'] The map height.
134
+		 */
135
+		'height' => apply_filters('widget_heigh', $params['height']),
136
+		/**
137
+		 * Filter the widget maptype of the map on home/listings page.
138
+		 *
139
+		 * @since 1.0.0
140 140
 		 * @since 1.5.2 Added TERRAIN map type.
141
-         * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
-         */
143
-        'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
-        /**
145
-         * Filter the widget scrollwheel value of the map on home/listings page.
146
-         *
147
-         * Should the scrollwheel zoom the map or not.
148
-         *
149
-         * @since 1.0.0
150
-         * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
-         */
152
-        'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
-        /**
154
-         * Filter the widget zoom level of the map on home/listings page.
155
-         *
156
-         * @since 1.0.0
157
-         * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
-         */
159
-        'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
-        /**
161
-         * Filter the widget auto zoom value of the map on home/listings page.
162
-         *
163
-         * If the map should autozoom to fit the markers shown.
164
-         *
165
-         * @since 1.0.0
166
-         * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
-         */
168
-        'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
-        /**
170
-         * Filter the widget child_collapse value of the map on home/listings page.
171
-         *
172
-         * If the map should auto collapse the child categories if the category bar is present.
173
-         *
174
-         * @since 1.0.0
175
-         * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
-         */
177
-        'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
-        'enable_cat_filters' => true,
179
-        'enable_text_search' => true,
180
-        'enable_post_type_filters' => true,
181
-        /**
182
-         * Filter the widget enable_location_filters value of the map on home/listings page.
183
-         *
184
-         * This is used when the location addon is used.
185
-         *
186
-         * @since 1.0.0
187
-         * @param bool $val True if location filters should be used, false if not.
188
-         */
189
-        'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
-        'enable_jason_on_load' => false,
191
-        'enable_marker_cluster' => false,
192
-        'enable_map_resize_button' => true,
193
-        'map_class_name' => 'geodir-map-home-page',
194
-        'is_geodir_home_map_widget' => true,
195
-    );
141
+		 * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
+		 */
143
+		'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
+		/**
145
+		 * Filter the widget scrollwheel value of the map on home/listings page.
146
+		 *
147
+		 * Should the scrollwheel zoom the map or not.
148
+		 *
149
+		 * @since 1.0.0
150
+		 * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
+		 */
152
+		'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
+		/**
154
+		 * Filter the widget zoom level of the map on home/listings page.
155
+		 *
156
+		 * @since 1.0.0
157
+		 * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
+		 */
159
+		'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
+		/**
161
+		 * Filter the widget auto zoom value of the map on home/listings page.
162
+		 *
163
+		 * If the map should autozoom to fit the markers shown.
164
+		 *
165
+		 * @since 1.0.0
166
+		 * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
+		 */
168
+		'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
+		/**
170
+		 * Filter the widget child_collapse value of the map on home/listings page.
171
+		 *
172
+		 * If the map should auto collapse the child categories if the category bar is present.
173
+		 *
174
+		 * @since 1.0.0
175
+		 * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
+		 */
177
+		'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
+		'enable_cat_filters' => true,
179
+		'enable_text_search' => true,
180
+		'enable_post_type_filters' => true,
181
+		/**
182
+		 * Filter the widget enable_location_filters value of the map on home/listings page.
183
+		 *
184
+		 * This is used when the location addon is used.
185
+		 *
186
+		 * @since 1.0.0
187
+		 * @param bool $val True if location filters should be used, false if not.
188
+		 */
189
+		'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
+		'enable_jason_on_load' => false,
191
+		'enable_marker_cluster' => false,
192
+		'enable_map_resize_button' => true,
193
+		'map_class_name' => 'geodir-map-home-page',
194
+		'is_geodir_home_map_widget' => true,
195
+	);
196 196
 
197 197
 	// Add marker cluster
198 198
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
199
-        $map_args['enable_marker_cluster'] = true;
200
-        if(get_option('geodir_marker_cluster_type')) {
201
-            if ($map_args['autozoom']) {
202
-                $map_args['enable_marker_cluster_no_reposition'] = false;
203
-            } else {
204
-                $map_args['enable_marker_cluster_no_reposition'] = true;
205
-            }
199
+		$map_args['enable_marker_cluster'] = true;
200
+		if(get_option('geodir_marker_cluster_type')) {
201
+			if ($map_args['autozoom']) {
202
+				$map_args['enable_marker_cluster_no_reposition'] = false;
203
+			} else {
204
+				$map_args['enable_marker_cluster_no_reposition'] = true;
205
+			}
206 206
 
207
-            $map_args['enable_marker_cluster_server'] = true ;
207
+			$map_args['enable_marker_cluster_server'] = true ;
208 208
 
209
-        }
209
+		}
210 210
 	} else {
211 211
 		$map_args['enable_marker_cluster'] = false;
212 212
 	}
213 213
 
214
-    // if lat and long set in shortcode, hack it so the map is not repositioned
215
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
-        $map_args['enable_marker_cluster_no_reposition'] = true;
217
-    }
214
+	// if lat and long set in shortcode, hack it so the map is not repositioned
215
+	if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
+		$map_args['enable_marker_cluster_no_reposition'] = true;
217
+	}
218 218
 
219 219
 
220
-    geodir_draw_map($map_args);
220
+	geodir_draw_map($map_args);
221 221
 
222
-    add_action('wp_footer', 'geodir_home_map_add_script', 100);
222
+	add_action('wp_footer', 'geodir_home_map_add_script', 100);
223 223
 
224
-    $output = ob_get_contents();
224
+	$output = ob_get_contents();
225 225
 
226
-    ob_end_clean();
226
+	ob_end_clean();
227 227
 
228
-    return $output;
228
+	return $output;
229 229
 }
230 230
 add_shortcode('gd_homepage_map', 'geodir_sc_home_map');
231 231
 
@@ -264,243 +264,243 @@  discard block
 block discarded – undo
264 264
  */
265 265
 function geodir_sc_listing_map($atts) {
266 266
 
267
-    // if some params are set then we need a new query, if not then we can use the main query
268
-    if( isset($atts['post_type']) || isset($atts['category']) || isset($atts['event_type']) ) {
269
-
270
-        global $add_post_in_marker_array, $gd_sc_map_params;
271
-        $backup_globals                             = array();
272
-        $backup_globals['add_post_in_marker_array'] = $add_post_in_marker_array;
273
-        $backup_globals['gd_sc_map_params']         = $gd_sc_map_params;
274
-
275
-        $defaults = array(
276
-            'width'          => '294',
277
-            'height'         => '370',
278
-            'zoom'           => '13',
279
-            'autozoom'       => '',
280
-            'sticky'         => '',
281
-            'showall'        => '0',
282
-            'scrollwheel'    => '0',
283
-            'maptype'        => 'ROADMAP',
284
-            'child_collapse' => 0,
285
-            'marker_cluster' => false,
286
-            'post_type'      => 'gd_place',
287
-            'category'       => '0',
288
-            'event_type'     => 'all'
289
-        );
290
-
291
-        $params = shortcode_atts( $defaults, $atts );
292
-
293
-        if ( ! ( gdsc_is_post_type_valid( $params['post_type'] ) ) ) {
294
-            $params['post_type'] = 'gd_place';
295
-        }
296
-
297
-        // Validate the selected category/ies - Grab the current list based on post_type
298
-        $category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
299
-        $categories        = get_terms( $category_taxonomy, array(
300
-            'orderby' => 'count',
301
-            'order'   => 'DESC',
302
-            'fields'  => 'ids'
303
-        ) );
304
-
305
-        // Make sure we have an array
306
-        if ( ! ( is_array( $params['category'] ) ) ) {
307
-            $params['category'] = explode( ',', $params['category'] );
308
-        }
309
-
310
-        // Array_intersect returns only the items in $params['category'] that are also in our category list
311
-        // Otherwise it becomes empty and later on that will mean "All"
312
-        $params['category'] = array_intersect( $params['category'], $categories );
313
-
314
-        if ( $params['post_type'] == 'gd_event' ) {
315
-            $params['event_type'] = gdsc_validate_list_filter_choice( $params['event_type'] );
316
-        }
317
-
318
-        $params = gdsc_validate_map_args( $params );
319
-
320
-        $gd_sc_map_params = $params;
321
-
322
-        $query_args = array(
323
-            'posts_per_page' => 1000000, //@todo kiran why was this added? 
324
-            'is_geodir_loop' => true,
325
-            'gd_location'    => false,
326
-            'post_type'      => $params['post_type'],
327
-        );
328
-
329
-        if ( ! empty( $params['category'] ) && isset( $params['category'][0] ) && (int) $params['category'][0] != 0 ) {
330
-            $category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
331
-
332
-            ######### WPML #########
333
-            if ( geodir_wpml_is_taxonomy_translated( $category_taxonomy[0] ) ) {
334
-                $category = gd_lang_object_ids( $params['category'], $category_taxonomy[0] );
335
-            }
336
-            ######### WPML #########
337
-
338
-            $tax_query = array(
339
-                'taxonomy' => $category_taxonomy[0],
340
-                'field'    => 'id',
341
-                'terms'    => $params['category']
342
-            );
343
-
344
-            $query_args['tax_query'] = array( $tax_query );
345
-        }
346
-
347
-        $add_post_in_marker_array = true;
348
-
349
-        if ( $params['post_type'] == 'gd_event' && function_exists( 'geodir_event_get_widget_events' ) ) {
350
-            global $geodir_event_widget_listview;
351
-            $geodir_event_widget_listview = true;
352
-
353
-            $query_args['geodir_event_type'] = $params['event_type'];
354
-
355
-            $listings = geodir_event_get_widget_events( $query_args );
356
-
357
-            $geodir_event_widget_listview = false;
358
-        } else {
359
-            $listings = geodir_get_widget_listings( $query_args );
360
-        }
361
-
362
-        if ( ! empty( $listings ) ) {
363
-            foreach ( $listings as $listing ) {
364
-                create_marker_jason_of_posts( $listing );
365
-            }
366
-        }
367
-
368
-        ob_start();
369
-        add_action( 'wp_head', 'init_listing_map_script' ); // Initialize the map object and marker array
370
-
371
-        add_action( 'the_post', 'create_list_jsondata' ); // Add marker in json array
372
-
373
-        add_action( 'wp_footer', 'show_listing_widget_map' ); // Show map for listings with markers
374
-
375
-        $default_location = geodir_get_default_location();
376
-
377
-        $map_args = array(
378
-            'map_canvas_name'          => 'gd_listing_map',
379
-            'width'                    => $params['width'],
380
-            'height'                   => $params['height'],
381
-            'zoom'                     => $params['zoom'],
382
-            'autozoom'                 => $params['autozoom'],
383
-            'sticky'                   => $params['sticky'],
384
-            'showall'                  => $params['showall'],
385
-            'scrollwheel'              => $params['scrollwheel'],
386
-            'maptype'                  => $params['maptype'],
387
-            'child_collapse'           => 0,
388
-            'enable_cat_filters'       => false,
389
-            'enable_text_search'       => false,
390
-            'enable_post_type_filters' => false,
391
-            'enable_location_filters'  => false,
392
-            'enable_jason_on_load'     => true,
393
-            'ajax_url'                 => geodir_get_ajax_url(),
394
-            'latitude'                 => isset( $default_location->city_latitude ) ? $default_location->city_latitude : '',
395
-            'longitude'                => isset( $default_location->city_longitude ) ? $default_location->city_longitude : '',
396
-            'streetViewControl'        => true,
397
-            'showPreview'              => '0',
398
-            'maxZoom'                  => 21,
399
-            'bubble_size'              => 'small',
400
-        );
401
-
402
-        if ( is_single() ) {
403
-            global $post;
404
-            if ( isset( $post->post_latitude ) ) {
405
-                $map_args['latitude']  = $post->post_latitude;
406
-                $map_args['longitude'] = $post->post_longitude;
407
-            }
408
-
409
-            $map_args['map_class_name'] = 'geodir-map-listing-page-single';
410
-        } else {
411
-            $map_args['map_class_name'] = 'geodir-map-listing-page';
412
-        }
413
-
414
-        // Add marker cluster
415
-        if ( isset( $params['marker_cluster'] ) && gdsc_to_bool_val( $params['marker_cluster'] ) && defined( 'GDCLUSTER_VERSION' ) ) {
416
-            $map_args['enable_marker_cluster'] = true;
417
-        } else {
418
-            $map_args['enable_marker_cluster'] = false;
419
-        }
420
-
421
-        geodir_draw_map( $map_args );
422
-
423
-        $output = ob_get_contents();
424
-
425
-        ob_end_clean();
426
-
427
-        foreach ( $backup_globals as $global => $value ) {
428
-            ${$global} = $value;
429
-        }
430
-
431
-        return $output;
432
-    }else{
433
-        ob_start();
434
-        add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
435
-        add_action('the_post', 'create_list_jsondata'); // Add marker in json array
436
-        add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
437
-        $defaults = array(
438
-            'width' => '294',
439
-            'height' => '370',
440
-            'zoom' => '13',
441
-            'autozoom' => '',
442
-            'sticky' => '',
443
-            'showall' => '0',
444
-            'scrollwheel' => '0',
445
-            'maptype' => 'ROADMAP',
446
-            'child_collapse' => 0,
447
-            'marker_cluster' => false
448
-        );
449
-        $params = shortcode_atts($defaults, $atts);
450
-        $params = gdsc_validate_map_args($params);
451
-        $map_args = array(
452
-            'map_canvas_name' => 'gd_listing_map',
453
-            'width' => $params['width'],
454
-            'height' => $params['height'],
455
-            'zoom' => $params['zoom'],
456
-            'autozoom' => $params['autozoom'],
457
-            'sticky' => $params['sticky'],
458
-            'showall' => $params['showall'],
459
-            'scrollwheel' => $params['scrollwheel'],
460
-            'child_collapse' => 0,
461
-            'enable_cat_filters' => false,
462
-            'enable_text_search' => false,
463
-            'enable_post_type_filters' => false,
464
-            'enable_location_filters' => false,
465
-            'enable_jason_on_load' => true,
466
-        );
467
-        if (is_single()) {
468
-            global $post;
469
-            $map_default_lat = $address_latitude = $post->post_latitude;
470
-            $map_default_lng = $address_longitude = $post->post_longitude;
471
-            $mapview = $post->post_mapview;
472
-            $map_args['zoom'] = $post->post_mapzoom;
473
-            $map_args['map_class_name'] = 'geodir-map-listing-page-single';
474
-        } else {
475
-            $default_location = geodir_get_default_location();
476
-            $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
477
-            $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
478
-            $map_args['map_class_name'] = 'geodir-map-listing-page';
479
-        }
480
-        if (empty($mapview)) {
481
-            $mapview = 'ROADMAP';
482
-        }
483
-        // Set default map options
484
-        $map_args['ajax_url'] = geodir_get_ajax_url();
485
-        $map_args['latitude'] = $map_default_lat;
486
-        $map_args['longitude'] = $map_default_lng;
487
-        $map_args['streetViewControl'] = true;
488
-        $map_args['maptype'] = $mapview;
489
-        $map_args['showPreview'] = '0';
490
-        $map_args['maxZoom'] = 21;
491
-        $map_args['bubble_size'] = 'small';
492
-
493
-        // Add marker cluster
494
-        if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
495
-            $map_args['enable_marker_cluster'] = true;
496
-        } else {
497
-            $map_args['enable_marker_cluster'] = false;
498
-        }
499
-        geodir_draw_map($map_args);
500
-        $output = ob_get_contents();
501
-        ob_end_clean();
502
-        return $output;
503
-    }
267
+	// if some params are set then we need a new query, if not then we can use the main query
268
+	if( isset($atts['post_type']) || isset($atts['category']) || isset($atts['event_type']) ) {
269
+
270
+		global $add_post_in_marker_array, $gd_sc_map_params;
271
+		$backup_globals                             = array();
272
+		$backup_globals['add_post_in_marker_array'] = $add_post_in_marker_array;
273
+		$backup_globals['gd_sc_map_params']         = $gd_sc_map_params;
274
+
275
+		$defaults = array(
276
+			'width'          => '294',
277
+			'height'         => '370',
278
+			'zoom'           => '13',
279
+			'autozoom'       => '',
280
+			'sticky'         => '',
281
+			'showall'        => '0',
282
+			'scrollwheel'    => '0',
283
+			'maptype'        => 'ROADMAP',
284
+			'child_collapse' => 0,
285
+			'marker_cluster' => false,
286
+			'post_type'      => 'gd_place',
287
+			'category'       => '0',
288
+			'event_type'     => 'all'
289
+		);
290
+
291
+		$params = shortcode_atts( $defaults, $atts );
292
+
293
+		if ( ! ( gdsc_is_post_type_valid( $params['post_type'] ) ) ) {
294
+			$params['post_type'] = 'gd_place';
295
+		}
296
+
297
+		// Validate the selected category/ies - Grab the current list based on post_type
298
+		$category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
299
+		$categories        = get_terms( $category_taxonomy, array(
300
+			'orderby' => 'count',
301
+			'order'   => 'DESC',
302
+			'fields'  => 'ids'
303
+		) );
304
+
305
+		// Make sure we have an array
306
+		if ( ! ( is_array( $params['category'] ) ) ) {
307
+			$params['category'] = explode( ',', $params['category'] );
308
+		}
309
+
310
+		// Array_intersect returns only the items in $params['category'] that are also in our category list
311
+		// Otherwise it becomes empty and later on that will mean "All"
312
+		$params['category'] = array_intersect( $params['category'], $categories );
313
+
314
+		if ( $params['post_type'] == 'gd_event' ) {
315
+			$params['event_type'] = gdsc_validate_list_filter_choice( $params['event_type'] );
316
+		}
317
+
318
+		$params = gdsc_validate_map_args( $params );
319
+
320
+		$gd_sc_map_params = $params;
321
+
322
+		$query_args = array(
323
+			'posts_per_page' => 1000000, //@todo kiran why was this added? 
324
+			'is_geodir_loop' => true,
325
+			'gd_location'    => false,
326
+			'post_type'      => $params['post_type'],
327
+		);
328
+
329
+		if ( ! empty( $params['category'] ) && isset( $params['category'][0] ) && (int) $params['category'][0] != 0 ) {
330
+			$category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
331
+
332
+			######### WPML #########
333
+			if ( geodir_wpml_is_taxonomy_translated( $category_taxonomy[0] ) ) {
334
+				$category = gd_lang_object_ids( $params['category'], $category_taxonomy[0] );
335
+			}
336
+			######### WPML #########
337
+
338
+			$tax_query = array(
339
+				'taxonomy' => $category_taxonomy[0],
340
+				'field'    => 'id',
341
+				'terms'    => $params['category']
342
+			);
343
+
344
+			$query_args['tax_query'] = array( $tax_query );
345
+		}
346
+
347
+		$add_post_in_marker_array = true;
348
+
349
+		if ( $params['post_type'] == 'gd_event' && function_exists( 'geodir_event_get_widget_events' ) ) {
350
+			global $geodir_event_widget_listview;
351
+			$geodir_event_widget_listview = true;
352
+
353
+			$query_args['geodir_event_type'] = $params['event_type'];
354
+
355
+			$listings = geodir_event_get_widget_events( $query_args );
356
+
357
+			$geodir_event_widget_listview = false;
358
+		} else {
359
+			$listings = geodir_get_widget_listings( $query_args );
360
+		}
361
+
362
+		if ( ! empty( $listings ) ) {
363
+			foreach ( $listings as $listing ) {
364
+				create_marker_jason_of_posts( $listing );
365
+			}
366
+		}
367
+
368
+		ob_start();
369
+		add_action( 'wp_head', 'init_listing_map_script' ); // Initialize the map object and marker array
370
+
371
+		add_action( 'the_post', 'create_list_jsondata' ); // Add marker in json array
372
+
373
+		add_action( 'wp_footer', 'show_listing_widget_map' ); // Show map for listings with markers
374
+
375
+		$default_location = geodir_get_default_location();
376
+
377
+		$map_args = array(
378
+			'map_canvas_name'          => 'gd_listing_map',
379
+			'width'                    => $params['width'],
380
+			'height'                   => $params['height'],
381
+			'zoom'                     => $params['zoom'],
382
+			'autozoom'                 => $params['autozoom'],
383
+			'sticky'                   => $params['sticky'],
384
+			'showall'                  => $params['showall'],
385
+			'scrollwheel'              => $params['scrollwheel'],
386
+			'maptype'                  => $params['maptype'],
387
+			'child_collapse'           => 0,
388
+			'enable_cat_filters'       => false,
389
+			'enable_text_search'       => false,
390
+			'enable_post_type_filters' => false,
391
+			'enable_location_filters'  => false,
392
+			'enable_jason_on_load'     => true,
393
+			'ajax_url'                 => geodir_get_ajax_url(),
394
+			'latitude'                 => isset( $default_location->city_latitude ) ? $default_location->city_latitude : '',
395
+			'longitude'                => isset( $default_location->city_longitude ) ? $default_location->city_longitude : '',
396
+			'streetViewControl'        => true,
397
+			'showPreview'              => '0',
398
+			'maxZoom'                  => 21,
399
+			'bubble_size'              => 'small',
400
+		);
401
+
402
+		if ( is_single() ) {
403
+			global $post;
404
+			if ( isset( $post->post_latitude ) ) {
405
+				$map_args['latitude']  = $post->post_latitude;
406
+				$map_args['longitude'] = $post->post_longitude;
407
+			}
408
+
409
+			$map_args['map_class_name'] = 'geodir-map-listing-page-single';
410
+		} else {
411
+			$map_args['map_class_name'] = 'geodir-map-listing-page';
412
+		}
413
+
414
+		// Add marker cluster
415
+		if ( isset( $params['marker_cluster'] ) && gdsc_to_bool_val( $params['marker_cluster'] ) && defined( 'GDCLUSTER_VERSION' ) ) {
416
+			$map_args['enable_marker_cluster'] = true;
417
+		} else {
418
+			$map_args['enable_marker_cluster'] = false;
419
+		}
420
+
421
+		geodir_draw_map( $map_args );
422
+
423
+		$output = ob_get_contents();
424
+
425
+		ob_end_clean();
426
+
427
+		foreach ( $backup_globals as $global => $value ) {
428
+			${$global} = $value;
429
+		}
430
+
431
+		return $output;
432
+	}else{
433
+		ob_start();
434
+		add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
435
+		add_action('the_post', 'create_list_jsondata'); // Add marker in json array
436
+		add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
437
+		$defaults = array(
438
+			'width' => '294',
439
+			'height' => '370',
440
+			'zoom' => '13',
441
+			'autozoom' => '',
442
+			'sticky' => '',
443
+			'showall' => '0',
444
+			'scrollwheel' => '0',
445
+			'maptype' => 'ROADMAP',
446
+			'child_collapse' => 0,
447
+			'marker_cluster' => false
448
+		);
449
+		$params = shortcode_atts($defaults, $atts);
450
+		$params = gdsc_validate_map_args($params);
451
+		$map_args = array(
452
+			'map_canvas_name' => 'gd_listing_map',
453
+			'width' => $params['width'],
454
+			'height' => $params['height'],
455
+			'zoom' => $params['zoom'],
456
+			'autozoom' => $params['autozoom'],
457
+			'sticky' => $params['sticky'],
458
+			'showall' => $params['showall'],
459
+			'scrollwheel' => $params['scrollwheel'],
460
+			'child_collapse' => 0,
461
+			'enable_cat_filters' => false,
462
+			'enable_text_search' => false,
463
+			'enable_post_type_filters' => false,
464
+			'enable_location_filters' => false,
465
+			'enable_jason_on_load' => true,
466
+		);
467
+		if (is_single()) {
468
+			global $post;
469
+			$map_default_lat = $address_latitude = $post->post_latitude;
470
+			$map_default_lng = $address_longitude = $post->post_longitude;
471
+			$mapview = $post->post_mapview;
472
+			$map_args['zoom'] = $post->post_mapzoom;
473
+			$map_args['map_class_name'] = 'geodir-map-listing-page-single';
474
+		} else {
475
+			$default_location = geodir_get_default_location();
476
+			$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
477
+			$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
478
+			$map_args['map_class_name'] = 'geodir-map-listing-page';
479
+		}
480
+		if (empty($mapview)) {
481
+			$mapview = 'ROADMAP';
482
+		}
483
+		// Set default map options
484
+		$map_args['ajax_url'] = geodir_get_ajax_url();
485
+		$map_args['latitude'] = $map_default_lat;
486
+		$map_args['longitude'] = $map_default_lng;
487
+		$map_args['streetViewControl'] = true;
488
+		$map_args['maptype'] = $mapview;
489
+		$map_args['showPreview'] = '0';
490
+		$map_args['maxZoom'] = 21;
491
+		$map_args['bubble_size'] = 'small';
492
+
493
+		// Add marker cluster
494
+		if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
495
+			$map_args['enable_marker_cluster'] = true;
496
+		} else {
497
+			$map_args['enable_marker_cluster'] = false;
498
+		}
499
+		geodir_draw_map($map_args);
500
+		$output = ob_get_contents();
501
+		ob_end_clean();
502
+		return $output;
503
+	}
504 504
 }
505 505
 
506 506
 add_shortcode('gd_listing_slider', 'geodir_sc_listing_slider');
@@ -533,120 +533,120 @@  discard block
 block discarded – undo
533 533
  */
534 534
 function geodir_sc_listing_slider($atts)
535 535
 {
536
-    ob_start();
537
-    $defaults = array(
538
-        'post_type' => 'gd_place',
539
-        'category' => '0',
540
-        'post_number' => '5',
541
-        'slideshow' => '0',
542
-        'animation_loop' => 0,
543
-        'direction_nav' => 0,
544
-        'slideshow_speed' => 5000,
545
-        'animation_speed' => 600,
546
-        'animation' => 'slide',
547
-        'order_by' => 'latest',
548
-        'show_title' => '',
549
-        'show_featured_only' => '',
550
-        'title' => '',
551
-    );
552
-
553
-    $params = shortcode_atts($defaults, $atts);
554
-
555
-
556
-    /*
536
+	ob_start();
537
+	$defaults = array(
538
+		'post_type' => 'gd_place',
539
+		'category' => '0',
540
+		'post_number' => '5',
541
+		'slideshow' => '0',
542
+		'animation_loop' => 0,
543
+		'direction_nav' => 0,
544
+		'slideshow_speed' => 5000,
545
+		'animation_speed' => 600,
546
+		'animation' => 'slide',
547
+		'order_by' => 'latest',
548
+		'show_title' => '',
549
+		'show_featured_only' => '',
550
+		'title' => '',
551
+	);
552
+
553
+	$params = shortcode_atts($defaults, $atts);
554
+
555
+
556
+	/*
557 557
      *
558 558
      * Now we begin the validation of the attributes.
559 559
      */
560
-    // Check we have a valid post_type
561
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
562
-        $params['post_type'] = 'gd_place';
563
-    }
564
-
565
-    // Check we have a valid sort_order
566
-    $params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
567
-
568
-    // Match the chosen animation to our options
569
-    $animation_list = array('slide', 'fade');
570
-    if (!(in_array($params['animation'], $animation_list))) {
571
-        $params['animation'] = 'slide';
572
-    }
573
-
574
-    // Post_number needs to be a positive integer
575
-    $params['post_number'] = absint($params['post_number']);
576
-    if (0 == $params['post_number']) {
577
-        $params['post_number'] = 1;
578
-    }
579
-
580
-    // Manage the entered categories
581
-    if (0 != $params['category'] || '' != $params['category']) {
582
-        $params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
583
-    }
584
-    // Convert show_title to a bool
585
-    $params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
586
-
587
-    // Convert show_featured_only to a bool
588
-    $params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
589
-
590
-    /*
560
+	// Check we have a valid post_type
561
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
562
+		$params['post_type'] = 'gd_place';
563
+	}
564
+
565
+	// Check we have a valid sort_order
566
+	$params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
567
+
568
+	// Match the chosen animation to our options
569
+	$animation_list = array('slide', 'fade');
570
+	if (!(in_array($params['animation'], $animation_list))) {
571
+		$params['animation'] = 'slide';
572
+	}
573
+
574
+	// Post_number needs to be a positive integer
575
+	$params['post_number'] = absint($params['post_number']);
576
+	if (0 == $params['post_number']) {
577
+		$params['post_number'] = 1;
578
+	}
579
+
580
+	// Manage the entered categories
581
+	if (0 != $params['category'] || '' != $params['category']) {
582
+		$params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
583
+	}
584
+	// Convert show_title to a bool
585
+	$params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
586
+
587
+	// Convert show_featured_only to a bool
588
+	$params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
589
+
590
+	/*
591 591
      * Hopefully all attributes are now valid, and safe to pass forward
592 592
      */
593 593
 
594
-    // redeclare vars after validation
595
-
596
-    if (isset($params['direction_nav'])) {
597
-        $params['directionNav'] = $params['direction_nav'];
598
-    }
599
-    if (isset($params['animation_loop'])) {
600
-        $params['animationLoop'] = $params['animation_loop'];
601
-    }
602
-    if (isset($params['slideshow_speed'])) {
603
-        $params['slideshowSpeed'] = $params['slideshow_speed'];
604
-    }
605
-    if (isset($params['animation_speed'])) {
606
-        $params['animationSpeed'] = $params['animation_speed'];
607
-    }
608
-    if (isset($params['order_by'])) {
609
-        $params['list_sort'] = $params['order_by'];
610
-    }
611
-
612
-    $query_args = array(
613
-        'post_number' => $params['post_number'],
614
-        'is_geodir_loop' => true,
615
-        'post_type' => $params['post_type'],
616
-        'order_by' => $params['order_by']
617
-    );
618
-
619
-    if (1 == $params['show_featured_only']) {
620
-        $query_args['show_featured_only'] = 1;
621
-    }
622
-
623
-    if (0 != $params['category'] && '' != $params['category']) {
624
-        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
625
-        $tax_query = array(
626
-            'taxonomy' => $category_taxonomy[0],
627
-            'field' => 'id',
628
-            'terms' => $params['category'],
629
-        );
630
-
631
-        $query_args['tax_query'] = array($tax_query);
632
-    }
633
-
634
-    $defaults = array(
635
-        'before_widget' => '',
636
-        'after_widget' => '',
637
-        'before_title' => '',
638
-        'after_title' => '',
639
-    );
640
-
641
-    $query_args = array_merge($query_args, $params);
642
-
643
-    geodir_listing_slider_widget_output($defaults, $query_args);
644
-
645
-    $output = ob_get_contents();
646
-
647
-    ob_end_clean();
648
-
649
-    return $output;
594
+	// redeclare vars after validation
595
+
596
+	if (isset($params['direction_nav'])) {
597
+		$params['directionNav'] = $params['direction_nav'];
598
+	}
599
+	if (isset($params['animation_loop'])) {
600
+		$params['animationLoop'] = $params['animation_loop'];
601
+	}
602
+	if (isset($params['slideshow_speed'])) {
603
+		$params['slideshowSpeed'] = $params['slideshow_speed'];
604
+	}
605
+	if (isset($params['animation_speed'])) {
606
+		$params['animationSpeed'] = $params['animation_speed'];
607
+	}
608
+	if (isset($params['order_by'])) {
609
+		$params['list_sort'] = $params['order_by'];
610
+	}
611
+
612
+	$query_args = array(
613
+		'post_number' => $params['post_number'],
614
+		'is_geodir_loop' => true,
615
+		'post_type' => $params['post_type'],
616
+		'order_by' => $params['order_by']
617
+	);
618
+
619
+	if (1 == $params['show_featured_only']) {
620
+		$query_args['show_featured_only'] = 1;
621
+	}
622
+
623
+	if (0 != $params['category'] && '' != $params['category']) {
624
+		$category_taxonomy = geodir_get_taxonomies($params['post_type']);
625
+		$tax_query = array(
626
+			'taxonomy' => $category_taxonomy[0],
627
+			'field' => 'id',
628
+			'terms' => $params['category'],
629
+		);
630
+
631
+		$query_args['tax_query'] = array($tax_query);
632
+	}
633
+
634
+	$defaults = array(
635
+		'before_widget' => '',
636
+		'after_widget' => '',
637
+		'before_title' => '',
638
+		'after_title' => '',
639
+	);
640
+
641
+	$query_args = array_merge($query_args, $params);
642
+
643
+	geodir_listing_slider_widget_output($defaults, $query_args);
644
+
645
+	$output = ob_get_contents();
646
+
647
+	ob_end_clean();
648
+
649
+	return $output;
650 650
 }
651 651
 
652 652
 add_shortcode('gd_login_box', 'geodir_sc_login_box');
@@ -670,22 +670,22 @@  discard block
 block discarded – undo
670 670
  */
671 671
 function geodir_sc_login_box($atts)
672 672
 {
673
-    ob_start();
673
+	ob_start();
674 674
 
675
-    $defaults = array(
676
-        'before_widget' => '',
677
-        'after_widget' => '',
678
-        'before_title' => '',
679
-        'after_title' => '',
680
-    );
675
+	$defaults = array(
676
+		'before_widget' => '',
677
+		'after_widget' => '',
678
+		'before_title' => '',
679
+		'after_title' => '',
680
+	);
681 681
 
682
-    geodir_loginwidget_output($defaults, $defaults);
682
+	geodir_loginwidget_output($defaults, $defaults);
683 683
 
684
-    $output = ob_get_contents();
684
+	$output = ob_get_contents();
685 685
 
686
-    ob_end_clean();
686
+	ob_end_clean();
687 687
 
688
-    return $output;
688
+	return $output;
689 689
 }
690 690
 
691 691
 add_shortcode('gd_popular_post_category', 'geodir_sc_popular_post_category');
@@ -716,31 +716,31 @@  discard block
 block discarded – undo
716 716
  */
717 717
 function geodir_sc_popular_post_category($atts)
718 718
 {
719
-    ob_start();
720
-    global $geodir_post_category_str;
721
-    $defaults = array(
722
-        'category_limit' => 15,
723
-        'category_restrict' => false,
724
-        'before_widget' => '',
725
-        'after_widget' => '',
726
-        'before_title' => '',
727
-        'after_title' => '',
728
-        'title' => '',
729
-        'default_post_type' => '',
730
-        'parent_only' => false,
731
-    );
732
-
733
-    $params = shortcode_atts($defaults, $atts, 'popular_post_category');
734
-    $params['category_limit'] = absint($params['category_limit']);
735
-    $params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
736
-    $params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
737
-    geodir_popular_post_category_output($params, $params);
738
-
739
-    $output = ob_get_contents();
740
-
741
-    ob_end_clean();
742
-
743
-    return $output;
719
+	ob_start();
720
+	global $geodir_post_category_str;
721
+	$defaults = array(
722
+		'category_limit' => 15,
723
+		'category_restrict' => false,
724
+		'before_widget' => '',
725
+		'after_widget' => '',
726
+		'before_title' => '',
727
+		'after_title' => '',
728
+		'title' => '',
729
+		'default_post_type' => '',
730
+		'parent_only' => false,
731
+	);
732
+
733
+	$params = shortcode_atts($defaults, $atts, 'popular_post_category');
734
+	$params['category_limit'] = absint($params['category_limit']);
735
+	$params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
736
+	$params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
737
+	geodir_popular_post_category_output($params, $params);
738
+
739
+	$output = ob_get_contents();
740
+
741
+	ob_end_clean();
742
+
743
+	return $output;
744 744
 }
745 745
 
746 746
 add_shortcode('gd_popular_post_view', 'geodir_sc_popular_post_view');
@@ -783,98 +783,98 @@  discard block
 block discarded – undo
783 783
  */
784 784
 function geodir_sc_popular_post_view($atts)
785 785
 {
786
-    ob_start();
787
-    $defaults = array(
788
-        'post_type' => 'gd_place',
789
-        'category' => '0',
790
-        'post_number' => '5',
791
-        'layout' => 'gridview_onehalf',
792
-        'add_location_filter' => '0',
793
-        'list_sort' => 'latest',
794
-        'use_viewing_post_type' => '1',
795
-        'character_count' => '20',
796
-        'listing_width' => '',
797
-        'show_featured_only' => '0',
798
-        'show_special_only' => '0',
799
-        'with_pics_only' => '0',
800
-        'with_videos_only' => '0',
801
-        'hide_if_empty' => '0',
802
-        'before_widget' => '',
803
-        'after_widget' => '',
804
-        'before_title' => '<h3 class="widget-title">',
805
-        'after_title' => '</h3>',
806
-        'title' => '',
807
-        'category_title' => '',
808
-    );
809
-
810
-    $params = shortcode_atts($defaults, $atts);
811
-
812
-    /**
813
-     * Validate our incoming params
814
-     */
786
+	ob_start();
787
+	$defaults = array(
788
+		'post_type' => 'gd_place',
789
+		'category' => '0',
790
+		'post_number' => '5',
791
+		'layout' => 'gridview_onehalf',
792
+		'add_location_filter' => '0',
793
+		'list_sort' => 'latest',
794
+		'use_viewing_post_type' => '1',
795
+		'character_count' => '20',
796
+		'listing_width' => '',
797
+		'show_featured_only' => '0',
798
+		'show_special_only' => '0',
799
+		'with_pics_only' => '0',
800
+		'with_videos_only' => '0',
801
+		'hide_if_empty' => '0',
802
+		'before_widget' => '',
803
+		'after_widget' => '',
804
+		'before_title' => '<h3 class="widget-title">',
805
+		'after_title' => '</h3>',
806
+		'title' => '',
807
+		'category_title' => '',
808
+	);
815 809
 
816
-    // Validate the selected post type, default to gd_place on fail
817
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
818
-        $params['post_type'] = 'gd_place';
819
-    }
820
-
821
-    // Validate the selected category/ies - Grab the current list based on post_type
822
-    $category_taxonomy = geodir_get_taxonomies($params['post_type']);
823
-    $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
824
-
825
-    // Make sure we have an array
826
-    if (!(is_array($params['category']))) {
827
-        $params['category'] = explode(',', $params['category']);
828
-    }
829
-
830
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
831
-    // Otherwise it becomes empty and later on that will mean "All"
832
-    $params['category'] = array_intersect($params['category'], $categories);
833
-
834
-    // Post_number needs to be a positive integer
835
-    $params['post_number'] = absint($params['post_number']);
836
-    if (0 == $params['post_number']) {
837
-        $params['post_number'] = 1;
838
-    }
839
-
840
-    // Validate our layout choice
841
-    // Outside of the norm, I added some more simple terms to match the existing
842
-    // So now I just run the switch to set it properly.
843
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
844
-
845
-    // Validate our sorting choice
846
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort'], $params['post_type']);
847
-
848
-    // Validate character_count
849
-    if ($params['character_count'] !== '') {
850
-        $params['character_count'] = absint($params['character_count']);
851
-    }
852
-
853
-    // Validate Listing width, used in the template widget-listing-listview.php
854
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
855
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
856
-
857
-    // Validate the checkboxes used on the widget
858
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
859
-    $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
860
-    $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
861
-    $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
862
-    $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
863
-    $params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
864
-    $params['hide_if_empty'] = gdsc_to_bool_val($params['hide_if_empty']);
865
-
866
-    /**
867
-     * End of validation
868
-     */
810
+	$params = shortcode_atts($defaults, $atts);
811
+
812
+	/**
813
+	 * Validate our incoming params
814
+	 */
815
+
816
+	// Validate the selected post type, default to gd_place on fail
817
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
818
+		$params['post_type'] = 'gd_place';
819
+	}
820
+
821
+	// Validate the selected category/ies - Grab the current list based on post_type
822
+	$category_taxonomy = geodir_get_taxonomies($params['post_type']);
823
+	$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
824
+
825
+	// Make sure we have an array
826
+	if (!(is_array($params['category']))) {
827
+		$params['category'] = explode(',', $params['category']);
828
+	}
869 829
 
870
-    geodir_popular_postview_output($params, $params);
830
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
831
+	// Otherwise it becomes empty and later on that will mean "All"
832
+	$params['category'] = array_intersect($params['category'], $categories);
871 833
 
834
+	// Post_number needs to be a positive integer
835
+	$params['post_number'] = absint($params['post_number']);
836
+	if (0 == $params['post_number']) {
837
+		$params['post_number'] = 1;
838
+	}
839
+
840
+	// Validate our layout choice
841
+	// Outside of the norm, I added some more simple terms to match the existing
842
+	// So now I just run the switch to set it properly.
843
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
844
+
845
+	// Validate our sorting choice
846
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort'], $params['post_type']);
847
+
848
+	// Validate character_count
849
+	if ($params['character_count'] !== '') {
850
+		$params['character_count'] = absint($params['character_count']);
851
+	}
852
+
853
+	// Validate Listing width, used in the template widget-listing-listview.php
854
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
855
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
872 856
 
873
-    $output = ob_get_contents();
857
+	// Validate the checkboxes used on the widget
858
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
859
+	$params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
860
+	$params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
861
+	$params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
862
+	$params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
863
+	$params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
864
+	$params['hide_if_empty'] = gdsc_to_bool_val($params['hide_if_empty']);
874 865
 
875
-    ob_end_clean();
866
+	/**
867
+	 * End of validation
868
+	 */
876 869
 
877
-    return $output;
870
+	geodir_popular_postview_output($params, $params);
871
+
872
+
873
+	$output = ob_get_contents();
874
+
875
+	ob_end_clean();
876
+
877
+	return $output;
878 878
 }
879 879
 
880 880
 add_shortcode('gd_recent_reviews', 'geodir_sc_recent_reviews');
@@ -896,37 +896,37 @@  discard block
 block discarded – undo
896 896
  * @return string Recent reviews HTML.
897 897
  */
898 898
 function geodir_sc_recent_reviews($atts) {
899
-    ob_start();
900
-    $defaults = array(
899
+	ob_start();
900
+	$defaults = array(
901 901
 		'title' => '',
902 902
 		'count' => 5,
903
-    );
903
+	);
904 904
 
905
-    $params = shortcode_atts($defaults, $atts);
905
+	$params = shortcode_atts($defaults, $atts);
906 906
 
907
-    $count = absint($params['count']);
908
-    if (0 == $count) {
909
-        $count = 1;
910
-    }
907
+	$count = absint($params['count']);
908
+	if (0 == $count) {
909
+		$count = 1;
910
+	}
911 911
 	
912 912
 	$title = !empty($params['title']) ? __($params['title'], 'geodirectory') : '';
913 913
 
914
-    $comments_li = geodir_get_recent_reviews(30, $count, 100, false);
914
+	$comments_li = geodir_get_recent_reviews(30, $count, 100, false);
915 915
 
916
-    if ($comments_li) {
917
-        if ($title != '') { ?>
916
+	if ($comments_li) {
917
+		if ($title != '') { ?>
918 918
 		<h3 class="geodir-sc-recent-reviews-title widget-title"><?php echo $title; ?></h3>
919 919
 		<?php } ?>
920 920
         <div class="geodir_sc_recent_reviews_section">
921 921
             <ul class="geodir_sc_recent_reviews"><?php echo $comments_li; ?></ul>
922 922
         </div>
923 923
     <?php
924
-    }
925
-    $output = ob_get_contents();
924
+	}
925
+	$output = ob_get_contents();
926 926
 
927
-    ob_end_clean();
927
+	ob_end_clean();
928 928
 
929
-    return $output;
929
+	return $output;
930 930
 }
931 931
 
932 932
 add_shortcode('gd_related_listings', 'geodir_sc_related_listings');
@@ -956,63 +956,63 @@  discard block
 block discarded – undo
956 956
  */
957 957
 function geodir_sc_related_listings($atts)
958 958
 {
959
-    ob_start();
960
-    $defaults = array(
961
-        'post_number' => 5,
962
-        'relate_to' => 'category',
963
-        'layout' => 'gridview_onehalf',
964
-        'add_location_filter' => 0,
965
-        'listing_width' => '',
966
-        'list_sort' => 'latest',
967
-        'character_count' => 20,
968
-        'is_widget' => 1,
969
-        'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
970
-    );
971
-    // The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
972
-
973
-    $params = shortcode_atts($defaults, $atts);
974
-
975
-    /**
976
-     * Begin validating parameters
977
-     */
959
+	ob_start();
960
+	$defaults = array(
961
+		'post_number' => 5,
962
+		'relate_to' => 'category',
963
+		'layout' => 'gridview_onehalf',
964
+		'add_location_filter' => 0,
965
+		'listing_width' => '',
966
+		'list_sort' => 'latest',
967
+		'character_count' => 20,
968
+		'is_widget' => 1,
969
+		'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
970
+	);
971
+	// The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
978 972
 
979
-    // Validate that post_number is a number and is 1 or higher
980
-    $params['post_number'] = absint($params['post_number']);
981
-    if (0 === $params['post_number']) {
982
-        $params['post_number'] = 1;
983
-    }
973
+	$params = shortcode_atts($defaults, $atts);
984 974
 
985
-    // Validate relate_to - only category or tags
986
-    $params['relate_to'] = geodir_strtolower($params['relate_to']);
987
-    if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
988
-        $params['relate_to'] = 'category';
989
-    }
975
+	/**
976
+	 * Begin validating parameters
977
+	 */
990 978
 
991
-    // Validate layout selection
992
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
979
+	// Validate that post_number is a number and is 1 or higher
980
+	$params['post_number'] = absint($params['post_number']);
981
+	if (0 === $params['post_number']) {
982
+		$params['post_number'] = 1;
983
+	}
993 984
 
994
-    // Validate sorting option
995
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
985
+	// Validate relate_to - only category or tags
986
+	$params['relate_to'] = geodir_strtolower($params['relate_to']);
987
+	if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
988
+		$params['relate_to'] = 'category';
989
+	}
990
+
991
+	// Validate layout selection
992
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
996 993
 
997
-    // Validate add_location_filter
998
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
994
+	// Validate sorting option
995
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
999 996
 
1000
-    // Validate listing_width
1001
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
997
+	// Validate add_location_filter
998
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
1002 999
 
1003
-    // Validate character_count
1004
-    if ($params['character_count'] !== '') {
1005
-        $params['character_count'] = absint($params['character_count']);
1006
-    }
1000
+	// Validate listing_width
1001
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1007 1002
 
1008
-    if ($related_display = geodir_related_posts_display($params)) {
1009
-        echo $related_display;
1010
-    }
1011
-    $output = ob_get_contents();
1003
+	// Validate character_count
1004
+	if ($params['character_count'] !== '') {
1005
+		$params['character_count'] = absint($params['character_count']);
1006
+	}
1007
+
1008
+	if ($related_display = geodir_related_posts_display($params)) {
1009
+		echo $related_display;
1010
+	}
1011
+	$output = ob_get_contents();
1012 1012
 
1013
-    ob_end_clean();
1013
+	ob_end_clean();
1014 1014
 
1015
-    return $output;
1015
+	return $output;
1016 1016
 }
1017 1017
 
1018 1018
 /**
@@ -1036,13 +1036,13 @@  discard block
 block discarded – undo
1036 1036
  * @return string Advanced search widget HTML.
1037 1037
  */
1038 1038
 function geodir_sc_advanced_search($atts) {
1039
-    $defaults = array(
1039
+	$defaults = array(
1040 1040
 		'title' => '',
1041 1041
 		'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advance_search_widget">',
1042
-        'after_widget' => '</section>',
1043
-        'before_title' => '<h3 class="widget-title">',
1044
-        'after_title' => '</h3>',
1045
-        'show_adv_search' => 'default',
1042
+		'after_widget' => '</section>',
1043
+		'before_title' => '<h3 class="widget-title">',
1044
+		'after_title' => '</h3>',
1045
+		'show_adv_search' => 'default',
1046 1046
 		'post_type' => ''
1047 1047
 	);
1048 1048
 	
@@ -1066,9 +1066,9 @@  discard block
 block discarded – undo
1066 1066
 	the_widget('geodir_advance_search_widget', $params, $params );
1067 1067
 	
1068 1068
 	$output = ob_get_contents();
1069
-    ob_end_clean();
1069
+	ob_end_clean();
1070 1070
 
1071
-    return $output;
1071
+	return $output;
1072 1072
 }
1073 1073
 add_shortcode('gd_advanced_search', 'geodir_sc_advanced_search');
1074 1074
 
@@ -1114,48 +1114,48 @@  discard block
 block discarded – undo
1114 1114
 		'add_location_filter' => '1',
1115 1115
 		'tab_layout' => 'bestof-tabs-on-top',
1116 1116
 		'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">',
1117
-        'after_widget' => '</section>',
1118
-        'before_title' => '<h3 class="widget-title">',
1119
-        'after_title' => '</h3>',
1117
+		'after_widget' => '</section>',
1118
+		'before_title' => '<h3 class="widget-title">',
1119
+		'after_title' => '</h3>',
1120 1120
 	);
1121 1121
 	$params = shortcode_atts($defaults, $atts);
1122 1122
 
1123
-    /**
1124
-     * Validate our incoming params
1125
-     */
1123
+	/**
1124
+	 * Validate our incoming params
1125
+	 */
1126 1126
 
1127
-    // Validate the selected post type, default to gd_place on fail
1128
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
1129
-        $params['post_type'] = 'gd_place';
1130
-    }
1127
+	// Validate the selected post type, default to gd_place on fail
1128
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
1129
+		$params['post_type'] = 'gd_place';
1130
+	}
1131 1131
 	
1132 1132
 	// Post limit needs to be a positive integer
1133
-    $params['post_limit'] = absint($params['post_limit']);
1134
-    if (0 == $params['post_limit']) {
1135
-        $params['post_limit'] = 5;
1136
-    }
1133
+	$params['post_limit'] = absint($params['post_limit']);
1134
+	if (0 == $params['post_limit']) {
1135
+		$params['post_limit'] = 5;
1136
+	}
1137 1137
 	
1138 1138
 	// Category limit needs to be a positive integer
1139
-    $params['categ_limit'] = absint($params['categ_limit']);
1140
-    if (0 == $params['categ_limit']) {
1141
-        $params['categ_limit'] = 3;
1142
-    }
1139
+	$params['categ_limit'] = absint($params['categ_limit']);
1140
+	if (0 == $params['categ_limit']) {
1141
+		$params['categ_limit'] = 3;
1142
+	}
1143 1143
 	
1144 1144
 	// Tab layout validation
1145
-    $params['tab_layout'] = $params['tab_layout'];
1146
-    if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
1147
-        $params['tab_layout'] = 'bestof-tabs-on-top';
1148
-    }
1145
+	$params['tab_layout'] = $params['tab_layout'];
1146
+	if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
1147
+		$params['tab_layout'] = 'bestof-tabs-on-top';
1148
+	}
1149 1149
 	
1150 1150
 	// Validate character_count
1151
-    $params['character_count'] = $params['character_count'];
1151
+	$params['character_count'] = $params['character_count'];
1152 1152
 
1153 1153
 	ob_start();
1154 1154
 	the_widget('geodir_bestof_widget', $params, $params);
1155
-    $output = ob_get_contents();
1156
-    ob_end_clean();
1155
+	$output = ob_get_contents();
1156
+	ob_end_clean();
1157 1157
 
1158
-    return $output;
1158
+	return $output;
1159 1159
 }
1160 1160
 add_shortcode('gd_bestof_widget', 'geodir_sc_bestof_widget');
1161 1161
 
@@ -1208,162 +1208,162 @@  discard block
 block discarded – undo
1208 1208
  * @return string HTML content to display geodirectory listings.
1209 1209
  */
1210 1210
 function geodir_sc_gd_listings($atts, $content = '') {
1211
-    global $post;
1212
-    $defaults = array(
1213
-        'title'                 => '',
1214
-        'post_type'             => 'gd_place',
1215
-        'category'              => 0,
1216
-        'list_sort'             => 'latest',
1217
-        'event_type'            => '',
1218
-        'post_number'           => 10,
1219
-        'post_author'           => '',
1220
-        'layout'                => 'gridview_onehalf',
1221
-        'listing_width'         => '',
1222
-        'character_count'       => 20,
1223
-        'add_location_filter'   => 1,
1224
-        'show_featured_only'    => '',
1225
-        'show_special_only'     => '',
1226
-        'with_pics_only'        => '',
1227
-        'with_videos_only'      => '',
1228
-        'with_pagination'       => '1',
1229
-        'top_pagination'        => '0',
1230
-        'bottom_pagination'     => '1',
1231
-        'without_no_results'    => 0,
1232
-        'tags'                  => '',
1233
-        'show_favorites_only'   => '',
1234
-        'favorites_by_user'     => '',
1235
-    );
1236
-    $params = shortcode_atts($defaults, $atts);
1237
-
1238
-    $params['title']        = wp_strip_all_tags($params['title']);
1239
-    $params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1240
-
1241
-    // Validate the selected category/ies - Grab the current list based on post_type
1242
-    $category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1243
-    $categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids', 'hide_empty' => 0));
1244
-
1245
-    // Make sure we have an array
1246
-    if (!(is_array($params['category']))) {
1247
-        $params['category'] = explode(',', $params['category']);
1248
-    }
1249
-
1250
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
1251
-    // Otherwise it becomes empty and later on that will mean "All"
1252
-    $params['category']     = array_intersect($params['category'], $categories);
1253
-
1254
-    // Post_number needs to be a positive integer
1255
-    $params['post_number']  = absint($params['post_number']);
1256
-    $params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1211
+	global $post;
1212
+	$defaults = array(
1213
+		'title'                 => '',
1214
+		'post_type'             => 'gd_place',
1215
+		'category'              => 0,
1216
+		'list_sort'             => 'latest',
1217
+		'event_type'            => '',
1218
+		'post_number'           => 10,
1219
+		'post_author'           => '',
1220
+		'layout'                => 'gridview_onehalf',
1221
+		'listing_width'         => '',
1222
+		'character_count'       => 20,
1223
+		'add_location_filter'   => 1,
1224
+		'show_featured_only'    => '',
1225
+		'show_special_only'     => '',
1226
+		'with_pics_only'        => '',
1227
+		'with_videos_only'      => '',
1228
+		'with_pagination'       => '1',
1229
+		'top_pagination'        => '0',
1230
+		'bottom_pagination'     => '1',
1231
+		'without_no_results'    => 0,
1232
+		'tags'                  => '',
1233
+		'show_favorites_only'   => '',
1234
+		'favorites_by_user'     => '',
1235
+	);
1236
+	$params = shortcode_atts($defaults, $atts);
1237
+
1238
+	$params['title']        = wp_strip_all_tags($params['title']);
1239
+	$params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1240
+
1241
+	// Validate the selected category/ies - Grab the current list based on post_type
1242
+	$category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1243
+	$categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids', 'hide_empty' => 0));
1244
+
1245
+	// Make sure we have an array
1246
+	if (!(is_array($params['category']))) {
1247
+		$params['category'] = explode(',', $params['category']);
1248
+	}
1249
+
1250
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
1251
+	// Otherwise it becomes empty and later on that will mean "All"
1252
+	$params['category']     = array_intersect($params['category'], $categories);
1253
+
1254
+	// Post_number needs to be a positive integer
1255
+	$params['post_number']  = absint($params['post_number']);
1256
+	$params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1257 1257
     
1258
-    // Post_number needs to be a positive integer
1259
-    if (!empty($params['post_author'])) {
1260
-        // 'current' left for backwards compatibility
1261
-        if ( $params['post_author'] == 'current' || $params['post_author'] == 'current_author') {
1262
-            if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1263
-                $params['post_author'] = $post->post_author;
1264
-            } else {
1265
-                $params['post_author'] = -1; // Don't show any listings.
1266
-            }
1267
-        } else if ($params['post_author'] == 'current_user' ) {
1268
-            if ($current_user_id = get_current_user_id()) {
1269
-                $params['post_author'] = $current_user_id;
1270
-            } else {
1271
-                $params['post_author'] = -1; // If not logged in then don't show any listings.
1272
-            }
1273
-        } else if (absint($params['post_author']) > 0) {
1274
-            $params['post_author'] = absint($params['post_author']);
1275
-        } else {
1276
-            $params['post_author'] = -1; // Don't show any listings.
1277
-        }
1278
-    } else {
1279
-        unset($params['post_author']);
1280
-    }
1281
-
1282
-    // Validate character_count
1283
-    //todo: is this necessary?
1284
-    $params['character_count']  = $params['character_count'];
1285
-
1286
-    // Validate our layout choice
1287
-    // Outside of the norm, I added some more simple terms to match the existing
1288
-    // So now I just run the switch to set it properly.
1289
-    $params['layout']           = gdsc_validate_layout_choice($params['layout']);
1290
-
1291
-    // Validate our sorting choice
1292
-    $params['list_sort']        = gdsc_validate_sort_choice($params['list_sort'], $params['post_type']);
1293
-
1294
-    // Validate Listing width, used in the template widget-listing-listview.php
1295
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1296
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1297
-
1298
-    // Validate the checkboxes used on the widget
1299
-    $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1300
-    $params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1301
-    $params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1302
-    $params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1303
-    $params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1304
-    $params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1305
-    $params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1306
-    $params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1258
+	// Post_number needs to be a positive integer
1259
+	if (!empty($params['post_author'])) {
1260
+		// 'current' left for backwards compatibility
1261
+		if ( $params['post_author'] == 'current' || $params['post_author'] == 'current_author') {
1262
+			if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1263
+				$params['post_author'] = $post->post_author;
1264
+			} else {
1265
+				$params['post_author'] = -1; // Don't show any listings.
1266
+			}
1267
+		} else if ($params['post_author'] == 'current_user' ) {
1268
+			if ($current_user_id = get_current_user_id()) {
1269
+				$params['post_author'] = $current_user_id;
1270
+			} else {
1271
+				$params['post_author'] = -1; // If not logged in then don't show any listings.
1272
+			}
1273
+		} else if (absint($params['post_author']) > 0) {
1274
+			$params['post_author'] = absint($params['post_author']);
1275
+		} else {
1276
+			$params['post_author'] = -1; // Don't show any listings.
1277
+		}
1278
+	} else {
1279
+		unset($params['post_author']);
1280
+	}
1281
+
1282
+	// Validate character_count
1283
+	//todo: is this necessary?
1284
+	$params['character_count']  = $params['character_count'];
1285
+
1286
+	// Validate our layout choice
1287
+	// Outside of the norm, I added some more simple terms to match the existing
1288
+	// So now I just run the switch to set it properly.
1289
+	$params['layout']           = gdsc_validate_layout_choice($params['layout']);
1290
+
1291
+	// Validate our sorting choice
1292
+	$params['list_sort']        = gdsc_validate_sort_choice($params['list_sort'], $params['post_type']);
1293
+
1294
+	// Validate Listing width, used in the template widget-listing-listview.php
1295
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
1296
+	$params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1297
+
1298
+	// Validate the checkboxes used on the widget
1299
+	$params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1300
+	$params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1301
+	$params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1302
+	$params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1303
+	$params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1304
+	$params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1305
+	$params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1306
+	$params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1307 1307
     
1308
-    // User favorites
1309
-    $params['show_favorites_only']  = gdsc_to_bool_val($params['show_favorites_only']);
1310
-    if (!empty($params['show_favorites_only'])) {
1311
-        if ( $params['favorites_by_user'] == 'current' || $params['favorites_by_user'] == 'current_author') {
1312
-            if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1313
-                $params['favorites_by_user'] = $post->post_author;
1314
-            } else {
1315
-                $params['favorites_by_user'] = 0;
1316
-            }
1317
-        } else if ($params['favorites_by_user'] == 'current_user' || empty($params['favorites_by_user'])) {
1318
-            if ($current_user_id = get_current_user_id()) {
1319
-                $params['favorites_by_user'] = $current_user_id;
1320
-            } else {
1321
-                $params['favorites_by_user'] = 0;
1322
-            }
1323
-        } else if (absint($params['favorites_by_user']) > 0) {
1324
-            $params['favorites_by_user'] = absint($params['favorites_by_user']);
1325
-        } else {
1326
-            $params['favorites_by_user'] = 0;
1327
-        }
1328
-    }
1329
-
1330
-    // Clean tags
1331
-    if (!empty($params['tags'])) {
1332
-        if (!is_array($params['tags'])) {
1333
-            $comma = _x(',', 'tag delimiter');
1334
-            if ( ',' !== $comma ) {
1335
-                $params['tags'] = str_replace($comma, ',', $params['tags']);
1336
-            }
1337
-            $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1338
-            $params['tags'] = array_map('trim', $params['tags']);
1339
-        }
1340
-    } else {
1341
-        $params['tags'] = array();
1342
-    }
1343
-
1344
-    /**
1345
-     * End of validation
1346
-     */
1347
-    if (isset($atts['geodir_ajax'])) {
1348
-        $params['geodir_ajax'] = $atts['geodir_ajax'];
1349
-        unset($atts['geodir_ajax']);
1350
-    }
1351
-    if (isset($atts['pageno'])) {
1352
-        $params['pageno'] = $atts['pageno'];
1353
-        unset($atts['pageno']);
1354
-    }
1355
-
1356
-    if ( !empty($atts['shortcode_content']) ) {
1357
-        $content = $atts['shortcode_content'];
1358
-    }
1359
-    $params['shortcode_content'] = trim($content);
1360
-    $atts['shortcode_content'] = trim($content);
1308
+	// User favorites
1309
+	$params['show_favorites_only']  = gdsc_to_bool_val($params['show_favorites_only']);
1310
+	if (!empty($params['show_favorites_only'])) {
1311
+		if ( $params['favorites_by_user'] == 'current' || $params['favorites_by_user'] == 'current_author') {
1312
+			if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1313
+				$params['favorites_by_user'] = $post->post_author;
1314
+			} else {
1315
+				$params['favorites_by_user'] = 0;
1316
+			}
1317
+		} else if ($params['favorites_by_user'] == 'current_user' || empty($params['favorites_by_user'])) {
1318
+			if ($current_user_id = get_current_user_id()) {
1319
+				$params['favorites_by_user'] = $current_user_id;
1320
+			} else {
1321
+				$params['favorites_by_user'] = 0;
1322
+			}
1323
+		} else if (absint($params['favorites_by_user']) > 0) {
1324
+			$params['favorites_by_user'] = absint($params['favorites_by_user']);
1325
+		} else {
1326
+			$params['favorites_by_user'] = 0;
1327
+		}
1328
+	}
1329
+
1330
+	// Clean tags
1331
+	if (!empty($params['tags'])) {
1332
+		if (!is_array($params['tags'])) {
1333
+			$comma = _x(',', 'tag delimiter');
1334
+			if ( ',' !== $comma ) {
1335
+				$params['tags'] = str_replace($comma, ',', $params['tags']);
1336
+			}
1337
+			$params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1338
+			$params['tags'] = array_map('trim', $params['tags']);
1339
+		}
1340
+	} else {
1341
+		$params['tags'] = array();
1342
+	}
1343
+
1344
+	/**
1345
+	 * End of validation
1346
+	 */
1347
+	if (isset($atts['geodir_ajax'])) {
1348
+		$params['geodir_ajax'] = $atts['geodir_ajax'];
1349
+		unset($atts['geodir_ajax']);
1350
+	}
1351
+	if (isset($atts['pageno'])) {
1352
+		$params['pageno'] = $atts['pageno'];
1353
+		unset($atts['pageno']);
1354
+	}
1355
+
1356
+	if ( !empty($atts['shortcode_content']) ) {
1357
+		$content = $atts['shortcode_content'];
1358
+	}
1359
+	$params['shortcode_content'] = trim($content);
1360
+	$atts['shortcode_content'] = trim($content);
1361 1361
     
1362
-    $params['shortcode_atts']       = $atts;
1362
+	$params['shortcode_atts']       = $atts;
1363 1363
 
1364
-    $output = geodir_sc_gd_listings_output($params);
1364
+	$output = geodir_sc_gd_listings_output($params);
1365 1365
 
1366
-    return $output;
1366
+	return $output;
1367 1367
 }
1368 1368
 add_shortcode('gd_listings', 'geodir_sc_gd_listings');
1369 1369
 
@@ -1403,56 +1403,56 @@  discard block
 block discarded – undo
1403 1403
  * @return string HTML content to display CPT categories.
1404 1404
  */
1405 1405
 function geodir_sc_cpt_categories_widget($atts, $content = '') {
1406
-    $defaults = array(
1407
-        'title' => '',
1408
-        'post_type' => '', // NULL for all
1409
-        'hide_empty' => '',
1410
-        'show_count' => '',
1411
-        'hide_icon' => '',
1412
-        'cpt_left' => '',
1413
-        'sort_by' => 'count',
1414
-        'max_count' => 'all',
1415
-        'max_level' => '1',
1416
-        'no_cpt_filter' => '',
1417
-        'no_cat_filter' => '',
1418
-        'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1419
-        'after_widget' => '</section>',
1420
-        'before_title' => '<h3 class="widget-title">',
1421
-        'after_title' => '</h3>',
1422
-    );
1423
-    $params = shortcode_atts($defaults, $atts);
1424
-
1425
-    /**
1426
-     * Validate our incoming params
1427
-     */
1428
-    // Make sure we have an array
1429
-    $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1430
-     
1431
-    // Validate the checkboxes used on the widget
1432
-    $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1433
-    $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1434
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1435
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1406
+	$defaults = array(
1407
+		'title' => '',
1408
+		'post_type' => '', // NULL for all
1409
+		'hide_empty' => '',
1410
+		'show_count' => '',
1411
+		'hide_icon' => '',
1412
+		'cpt_left' => '',
1413
+		'sort_by' => 'count',
1414
+		'max_count' => 'all',
1415
+		'max_level' => '1',
1416
+		'no_cpt_filter' => '',
1417
+		'no_cat_filter' => '',
1418
+		'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1419
+		'after_widget' => '</section>',
1420
+		'before_title' => '<h3 class="widget-title">',
1421
+		'after_title' => '</h3>',
1422
+	);
1423
+	$params = shortcode_atts($defaults, $atts);
1436 1424
 
1437
-    if ($params['max_count'] != 'all') {
1438
-        $params['max_count'] = absint($params['max_count']);
1439
-    }
1425
+	/**
1426
+	 * Validate our incoming params
1427
+	 */
1428
+	// Make sure we have an array
1429
+	$params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1430
+     
1431
+	// Validate the checkboxes used on the widget
1432
+	$params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1433
+	$params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1434
+	$params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1435
+	$params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1436
+
1437
+	if ($params['max_count'] != 'all') {
1438
+		$params['max_count'] = absint($params['max_count']);
1439
+	}
1440 1440
 
1441
-    if ($params['max_level'] != 'all') {
1442
-        $params['max_level'] = absint($params['max_level']);
1443
-    }
1441
+	if ($params['max_level'] != 'all') {
1442
+		$params['max_level'] = absint($params['max_level']);
1443
+	}
1444 1444
 
1445
-    $params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1446
-    $params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1445
+	$params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1446
+	$params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1447 1447
 
1448
-    $params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1448
+	$params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1449 1449
 
1450
-    ob_start();
1451
-    the_widget('geodir_cpt_categories_widget', $params, $params);
1452
-    $output = ob_get_contents();
1453
-    ob_end_clean();
1450
+	ob_start();
1451
+	the_widget('geodir_cpt_categories_widget', $params, $params);
1452
+	$output = ob_get_contents();
1453
+	ob_end_clean();
1454 1454
 
1455
-    return $output;
1455
+	return $output;
1456 1456
 }
1457 1457
 add_shortcode('gd_cpt_categories', 'geodir_sc_cpt_categories_widget');
1458 1458
 
@@ -1467,6 +1467,6 @@  discard block
 block discarded – undo
1467 1467
  * @return string HTML code.
1468 1468
  */
1469 1469
 function geodir_sc_responsive_videos($atts, $content) {
1470
-    return '<div class="geodir-video-wrapper">'.$content.'</div>';
1470
+	return '<div class="geodir-video-wrapper">'.$content.'</div>';
1471 1471
 }
1472 1472
 add_shortcode('gd_video', 'geodir_sc_responsive_videos');
1473 1473
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 	// Add marker cluster
198 198
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
199 199
         $map_args['enable_marker_cluster'] = true;
200
-        if(get_option('geodir_marker_cluster_type')) {
200
+        if (get_option('geodir_marker_cluster_type')) {
201 201
             if ($map_args['autozoom']) {
202 202
                 $map_args['enable_marker_cluster_no_reposition'] = false;
203 203
             } else {
204 204
                 $map_args['enable_marker_cluster_no_reposition'] = true;
205 205
             }
206 206
 
207
-            $map_args['enable_marker_cluster_server'] = true ;
207
+            $map_args['enable_marker_cluster_server'] = true;
208 208
 
209 209
         }
210 210
 	} else {
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 	}
213 213
 
214 214
     // if lat and long set in shortcode, hack it so the map is not repositioned
215
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
215
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
216 216
         $map_args['enable_marker_cluster_no_reposition'] = true;
217 217
     }
218 218
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 function geodir_sc_listing_map($atts) {
266 266
 
267 267
     // if some params are set then we need a new query, if not then we can use the main query
268
-    if( isset($atts['post_type']) || isset($atts['category']) || isset($atts['event_type']) ) {
268
+    if (isset($atts['post_type']) || isset($atts['category']) || isset($atts['event_type'])) {
269 269
 
270 270
         global $add_post_in_marker_array, $gd_sc_map_params;
271 271
         $backup_globals                             = array();
@@ -288,34 +288,34 @@  discard block
 block discarded – undo
288 288
             'event_type'     => 'all'
289 289
         );
290 290
 
291
-        $params = shortcode_atts( $defaults, $atts );
291
+        $params = shortcode_atts($defaults, $atts);
292 292
 
293
-        if ( ! ( gdsc_is_post_type_valid( $params['post_type'] ) ) ) {
293
+        if (!(gdsc_is_post_type_valid($params['post_type']))) {
294 294
             $params['post_type'] = 'gd_place';
295 295
         }
296 296
 
297 297
         // Validate the selected category/ies - Grab the current list based on post_type
298
-        $category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
299
-        $categories        = get_terms( $category_taxonomy, array(
298
+        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
299
+        $categories        = get_terms($category_taxonomy, array(
300 300
             'orderby' => 'count',
301 301
             'order'   => 'DESC',
302 302
             'fields'  => 'ids'
303
-        ) );
303
+        ));
304 304
 
305 305
         // Make sure we have an array
306
-        if ( ! ( is_array( $params['category'] ) ) ) {
307
-            $params['category'] = explode( ',', $params['category'] );
306
+        if (!(is_array($params['category']))) {
307
+            $params['category'] = explode(',', $params['category']);
308 308
         }
309 309
 
310 310
         // Array_intersect returns only the items in $params['category'] that are also in our category list
311 311
         // Otherwise it becomes empty and later on that will mean "All"
312
-        $params['category'] = array_intersect( $params['category'], $categories );
312
+        $params['category'] = array_intersect($params['category'], $categories);
313 313
 
314
-        if ( $params['post_type'] == 'gd_event' ) {
315
-            $params['event_type'] = gdsc_validate_list_filter_choice( $params['event_type'] );
314
+        if ($params['post_type'] == 'gd_event') {
315
+            $params['event_type'] = gdsc_validate_list_filter_choice($params['event_type']);
316 316
         }
317 317
 
318
-        $params = gdsc_validate_map_args( $params );
318
+        $params = gdsc_validate_map_args($params);
319 319
 
320 320
         $gd_sc_map_params = $params;
321 321
 
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
             'post_type'      => $params['post_type'],
327 327
         );
328 328
 
329
-        if ( ! empty( $params['category'] ) && isset( $params['category'][0] ) && (int) $params['category'][0] != 0 ) {
330
-            $category_taxonomy = geodir_get_taxonomies( $params['post_type'] );
329
+        if (!empty($params['category']) && isset($params['category'][0]) && (int) $params['category'][0] != 0) {
330
+            $category_taxonomy = geodir_get_taxonomies($params['post_type']);
331 331
 
332 332
             ######### WPML #########
333
-            if ( geodir_wpml_is_taxonomy_translated( $category_taxonomy[0] ) ) {
334
-                $category = gd_lang_object_ids( $params['category'], $category_taxonomy[0] );
333
+            if (geodir_wpml_is_taxonomy_translated($category_taxonomy[0])) {
334
+                $category = gd_lang_object_ids($params['category'], $category_taxonomy[0]);
335 335
             }
336 336
             ######### WPML #########
337 337
 
@@ -341,36 +341,36 @@  discard block
 block discarded – undo
341 341
                 'terms'    => $params['category']
342 342
             );
343 343
 
344
-            $query_args['tax_query'] = array( $tax_query );
344
+            $query_args['tax_query'] = array($tax_query);
345 345
         }
346 346
 
347 347
         $add_post_in_marker_array = true;
348 348
 
349
-        if ( $params['post_type'] == 'gd_event' && function_exists( 'geodir_event_get_widget_events' ) ) {
349
+        if ($params['post_type'] == 'gd_event' && function_exists('geodir_event_get_widget_events')) {
350 350
             global $geodir_event_widget_listview;
351 351
             $geodir_event_widget_listview = true;
352 352
 
353 353
             $query_args['geodir_event_type'] = $params['event_type'];
354 354
 
355
-            $listings = geodir_event_get_widget_events( $query_args );
355
+            $listings = geodir_event_get_widget_events($query_args);
356 356
 
357 357
             $geodir_event_widget_listview = false;
358 358
         } else {
359
-            $listings = geodir_get_widget_listings( $query_args );
359
+            $listings = geodir_get_widget_listings($query_args);
360 360
         }
361 361
 
362
-        if ( ! empty( $listings ) ) {
363
-            foreach ( $listings as $listing ) {
364
-                create_marker_jason_of_posts( $listing );
362
+        if (!empty($listings)) {
363
+            foreach ($listings as $listing) {
364
+                create_marker_jason_of_posts($listing);
365 365
             }
366 366
         }
367 367
 
368 368
         ob_start();
369
-        add_action( 'wp_head', 'init_listing_map_script' ); // Initialize the map object and marker array
369
+        add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
370 370
 
371
-        add_action( 'the_post', 'create_list_jsondata' ); // Add marker in json array
371
+        add_action('the_post', 'create_list_jsondata'); // Add marker in json array
372 372
 
373
-        add_action( 'wp_footer', 'show_listing_widget_map' ); // Show map for listings with markers
373
+        add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
374 374
 
375 375
         $default_location = geodir_get_default_location();
376 376
 
@@ -391,17 +391,17 @@  discard block
 block discarded – undo
391 391
             'enable_location_filters'  => false,
392 392
             'enable_jason_on_load'     => true,
393 393
             'ajax_url'                 => geodir_get_ajax_url(),
394
-            'latitude'                 => isset( $default_location->city_latitude ) ? $default_location->city_latitude : '',
395
-            'longitude'                => isset( $default_location->city_longitude ) ? $default_location->city_longitude : '',
394
+            'latitude'                 => isset($default_location->city_latitude) ? $default_location->city_latitude : '',
395
+            'longitude'                => isset($default_location->city_longitude) ? $default_location->city_longitude : '',
396 396
             'streetViewControl'        => true,
397 397
             'showPreview'              => '0',
398 398
             'maxZoom'                  => 21,
399 399
             'bubble_size'              => 'small',
400 400
         );
401 401
 
402
-        if ( is_single() ) {
402
+        if (is_single()) {
403 403
             global $post;
404
-            if ( isset( $post->post_latitude ) ) {
404
+            if (isset($post->post_latitude)) {
405 405
                 $map_args['latitude']  = $post->post_latitude;
406 406
                 $map_args['longitude'] = $post->post_longitude;
407 407
             }
@@ -412,24 +412,24 @@  discard block
 block discarded – undo
412 412
         }
413 413
 
414 414
         // Add marker cluster
415
-        if ( isset( $params['marker_cluster'] ) && gdsc_to_bool_val( $params['marker_cluster'] ) && defined( 'GDCLUSTER_VERSION' ) ) {
415
+        if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
416 416
             $map_args['enable_marker_cluster'] = true;
417 417
         } else {
418 418
             $map_args['enable_marker_cluster'] = false;
419 419
         }
420 420
 
421
-        geodir_draw_map( $map_args );
421
+        geodir_draw_map($map_args);
422 422
 
423 423
         $output = ob_get_contents();
424 424
 
425 425
         ob_end_clean();
426 426
 
427
-        foreach ( $backup_globals as $global => $value ) {
427
+        foreach ($backup_globals as $global => $value) {
428 428
             ${$global} = $value;
429 429
         }
430 430
 
431 431
         return $output;
432
-    }else{
432
+    } else {
433 433
         ob_start();
434 434
         add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
435 435
         add_action('the_post', 'create_list_jsondata'); // Add marker in json array
@@ -1050,20 +1050,20 @@  discard block
 block discarded – undo
1050 1050
 	
1051 1051
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
1052 1052
 	
1053
-	if ($show_adv_search != '' ) {
1054
-		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
1053
+	if ($show_adv_search != '') {
1054
+		$show_adv_class = 'geodir-advance-search-'.$show_adv_search.' ';
1055 1055
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
1056 1056
 			$show_adv_search = 'search';
1057 1057
 		}
1058
-		$show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"';
1058
+		$show_adv_attrs = 'data-show-adv="'.$show_adv_search.'"';
1059 1059
 		
1060
-		$params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']);
1060
+		$params['before_widget'] = str_replace('class="', $show_adv_attrs.' class="'.$show_adv_class, $params['before_widget']);
1061 1061
 	}
1062 1062
 	
1063 1063
 	ob_start();
1064 1064
 	
1065 1065
 	//geodir_get_template_part('listing', 'filter-form');
1066
-	the_widget('geodir_advance_search_widget', $params, $params );
1066
+	the_widget('geodir_advance_search_widget', $params, $params);
1067 1067
 	
1068 1068
 	$output = ob_get_contents();
1069 1069
     ob_end_clean();
@@ -1258,13 +1258,13 @@  discard block
 block discarded – undo
1258 1258
     // Post_number needs to be a positive integer
1259 1259
     if (!empty($params['post_author'])) {
1260 1260
         // 'current' left for backwards compatibility
1261
-        if ( $params['post_author'] == 'current' || $params['post_author'] == 'current_author') {
1261
+        if ($params['post_author'] == 'current' || $params['post_author'] == 'current_author') {
1262 1262
             if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1263 1263
                 $params['post_author'] = $post->post_author;
1264 1264
             } else {
1265 1265
                 $params['post_author'] = -1; // Don't show any listings.
1266 1266
             }
1267
-        } else if ($params['post_author'] == 'current_user' ) {
1267
+        } else if ($params['post_author'] == 'current_user') {
1268 1268
             if ($current_user_id = get_current_user_id()) {
1269 1269
                 $params['post_author'] = $current_user_id;
1270 1270
             } else {
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 
1282 1282
     // Validate character_count
1283 1283
     //todo: is this necessary?
1284
-    $params['character_count']  = $params['character_count'];
1284
+    $params['character_count'] = $params['character_count'];
1285 1285
 
1286 1286
     // Validate our layout choice
1287 1287
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 
1294 1294
     // Validate Listing width, used in the template widget-listing-listview.php
1295 1295
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1296
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1296
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1297 1297
 
1298 1298
     // Validate the checkboxes used on the widget
1299 1299
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
     // User favorites
1309 1309
     $params['show_favorites_only']  = gdsc_to_bool_val($params['show_favorites_only']);
1310 1310
     if (!empty($params['show_favorites_only'])) {
1311
-        if ( $params['favorites_by_user'] == 'current' || $params['favorites_by_user'] == 'current_author') {
1311
+        if ($params['favorites_by_user'] == 'current' || $params['favorites_by_user'] == 'current_author') {
1312 1312
             if (!empty($post) && $post->post_type != 'page' && isset($post->post_author)) {
1313 1313
                 $params['favorites_by_user'] = $post->post_author;
1314 1314
             } else {
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
     if (!empty($params['tags'])) {
1332 1332
         if (!is_array($params['tags'])) {
1333 1333
             $comma = _x(',', 'tag delimiter');
1334
-            if ( ',' !== $comma ) {
1334
+            if (',' !== $comma) {
1335 1335
                 $params['tags'] = str_replace($comma, ',', $params['tags']);
1336 1336
             }
1337 1337
             $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
@@ -1353,13 +1353,13 @@  discard block
 block discarded – undo
1353 1353
         unset($atts['pageno']);
1354 1354
     }
1355 1355
 
1356
-    if ( !empty($atts['shortcode_content']) ) {
1356
+    if (!empty($atts['shortcode_content'])) {
1357 1357
         $content = $atts['shortcode_content'];
1358 1358
     }
1359 1359
     $params['shortcode_content'] = trim($content);
1360 1360
     $atts['shortcode_content'] = trim($content);
1361 1361
     
1362
-    $params['shortcode_atts']       = $atts;
1362
+    $params['shortcode_atts'] = $atts;
1363 1363
 
1364 1364
     $output = geodir_sc_gd_listings_output($params);
1365 1365
 
@@ -1431,8 +1431,8 @@  discard block
 block discarded – undo
1431 1431
     // Validate the checkboxes used on the widget
1432 1432
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1433 1433
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1434
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1435
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1434
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1435
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1436 1436
 
1437 1437
     if ($params['max_count'] != 'all') {
1438 1438
         $params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/notifications_settings_array.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         'id' => 'geodir_post_submited_success_email_subject_admin',
130 130
         'type' => 'text',
131 131
         'css' => 'min-width:300px;',
132
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
132
+        'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings
133 133
     ),
134 134
      array(
135 135
         'name' => '',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         'id' => 'geodir_post_submited_success_email_content_admin',
138 138
         'css' => 'width:500px; height: 150px;',
139 139
         'type' => 'textarea',
140
-        'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
140
+        'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>', 'geodirectory')
141 141
     ),
142 142
     array(
143 143
         'name' => __('Notify Admin when listing edited by Author', 'geodirectory'),
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         'id' => 'geodir_post_submited_success_email_subject',
189 189
         'type' => 'text',
190 190
         'css' => 'min-width:300px;',
191
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
191
+        'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings
192 192
     ),
193 193
     array(
194 194
         'name' => '',
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         'id' => 'geodir_post_submited_success_email_content',
197 197
         'css' => 'width:500px; height: 150px;',
198 198
         'type' => 'textarea',
199
-        'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
199
+        'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>', 'geodirectory')
200 200
     ),
201 201
 
202 202
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         'id' => 'geodir_forgot_password_content',
215 215
         'css' => 'width:500px; height: 150px;',
216 216
         'type' => 'textarea',
217
-        'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
217
+        'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
218 218
     ),
219 219
 
220 220
     array(
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         'id' => 'geodir_registration_success_email_content',
232 232
         'css' => 'width:500px; height: 150px;',
233 233
         'type' => 'textarea',
234
-        'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
234
+        'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
235 235
     ),
236 236
     array(
237 237
         'name' => __('Listing published email', 'geodirectory'),
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         'id' => 'geodir_email_friend_content',
271 271
         'css' => 'width:500px; height: 150px;',
272 272
         'type' => 'textarea',
273
-        'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
273
+        'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>", 'geodirectory')
274 274
     ),
275 275
 
276 276
     array(
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         'id' => 'geodir_email_enquiry_content',
288 288
         'css' => 'width:500px; height: 150px;',
289 289
         'type' => 'textarea',
290
-        'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
290
+        'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory')
291 291
     ),
292 292
 
293 293
     array('type' => 'sectionend', 'id' => 'other_emails'),
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         'id' => 'geodir_post_added_success_msg_content',
304 304
         'css' => 'width:500px; height: 150px;',
305 305
         'type' => 'textarea',
306
-        'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
306
+        'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>', 'geodirectory')
307 307
     ),
308 308
 
309 309
 
Please login to merge, or discard this patch.
Indentation   +309 added lines, -309 removed lines patch added patch discarded remove patch
@@ -17,314 +17,314 @@
 block discarded – undo
17 17
 $geodir_settings['notifications_settings'] = apply_filters('geodir_notifications_settings', array(
18 18
 
19 19
 
20
-    array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'),
21
-
22
-
23
-    array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'),
24
-
25
-    array(
26
-        'name' => __('List of usable shortcodes', 'geodirectory'),
27
-        'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'),
28
-        'id' => 'geodir_list_of_usable_shordcodes',
29
-        'type' => 'html_content',
30
-        'css' => 'min-width:300px;',
31
-        'std' => 'All Places' // Default value for the page title - changed in settings
32
-    ),
33
-
34
-    array(
35
-        'name' => __('Use advanced editor? (slow loading)', 'geodirectory'),
36
-        'desc' => __('Yes', 'geodirectory'),
37
-        'id' => 'geodir_tiny_editor',
38
-        'std' => 'yes',
39
-        'type' => 'radio',
40
-        'value' => '1',
41
-        'radiogroup' => 'start'
42
-    ),
43
-    array(
44
-        'name' => __('Use advanced editor?(slow loading)', 'geodirectory'),
45
-        'desc' => __('No', 'geodirectory'),
46
-        'id' => 'geodir_tiny_editor',
47
-        'std' => 'yes',
48
-        'type' => 'radio',
49
-        'value' => '0',
50
-        'radiogroup' => 'end'
51
-    ),
52
-
53
-
54
-    array('type' => 'sectionend', 'id' => 'notification_options'),
55
-
56
-
57
-    array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'),
58
-
59
-    array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'),
60
-
61
-    array(
62
-        'name' => __('New user registration', 'geodirectory'),
63
-        'desc' => __('Yes', 'geodirectory'),
64
-        'id' => 'geodir_bcc_new_user',
65
-        'std' => 'yes',
66
-        'type' => 'radio',
67
-        'value' => '1',
68
-        'radiogroup' => 'start'
69
-    ),
70
-    array(
71
-        'name' => __('New user registration', 'geodirectory'),
72
-        'desc' => __('No', 'geodirectory'),
73
-        'id' => 'geodir_bcc_new_user',
74
-        'std' => 'yes',
75
-        'type' => 'radio',
76
-        'value' => '0',
77
-        'radiogroup' => 'end'
78
-    ),
79
-
80
-    array(
81
-        'name' => __('Send to friend', 'geodirectory'),
82
-        'desc' => __('Yes', 'geodirectory'),
83
-        'id' => 'geodir_bcc_friend',
84
-        'std' => 'yes',
85
-        'type' => 'radio',
86
-        'value' => '1',
87
-        'radiogroup' => 'start'
88
-    ),
89
-    array(
90
-        'name' => __('Send to friend', 'geodirectory'),
91
-        'desc' => __('No', 'geodirectory'),
92
-        'id' => 'geodir_bcc_friend',
93
-        'std' => 'yes',
94
-        'type' => 'radio',
95
-        'value' => '0',
96
-        'radiogroup' => 'end'
97
-    ),
98
-
99
-    array(
100
-        'name' => __('Send enquiry', 'geodirectory'),
101
-        'desc' => __('Yes', 'geodirectory'),
102
-        'id' => 'geodir_bcc_enquiry',
103
-        'std' => 'yes',
104
-        'type' => 'radio',
105
-        'value' => '1',
106
-        'radiogroup' => 'start'
107
-    ),
108
-    array(
109
-        'name' => __('Send enquiry', 'geodirectory'),
110
-        'desc' => __('No', 'geodirectory'),
111
-        'id' => 'geodir_bcc_enquiry',
112
-        'std' => 'yes',
113
-        'type' => 'radio',
114
-        'value' => '0',
115
-        'radiogroup' => 'end'
116
-    ),
117
-
118
-
119
-    array('type' => 'sectionend', 'id' => 'site_bcc_options'),
120
-
121
-
122
-    array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'),
123
-
124
-    array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'),
125
-
126
-    array(
127
-        'name' => __('Notify to admin on post submit', 'geodirectory'),
128
-        'desc' => __('Yes', 'geodirectory'),
129
-        'id' => 'geodir_notify_post_submit',
130
-        'std' => '1',
131
-        'type' => 'radio',
132
-        'value' => '1',
133
-        'radiogroup' => 'start'
134
-    ),
135
-    array(
136
-        'name' => __('Notify to admin on post submit', 'geodirectory'),
137
-        'desc' => __('No', 'geodirectory'),
138
-        'id' => 'geodir_notify_post_submit',
139
-        'std' => '1',
140
-        'type' => 'radio',
141
-        'value' => '0',
142
-        'radiogroup' => 'end'
143
-    ),
144
-    array(
145
-        'name' => __('Post submit success to admin email', 'geodirectory'),
146
-        'desc' => '',
147
-        'id' => 'geodir_post_submited_success_email_subject_admin',
148
-        'type' => 'text',
149
-        'css' => 'min-width:300px;',
150
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
151
-    ),
152
-     array(
153
-        'name' => '',
154
-        'desc' => '',
155
-        'id' => 'geodir_post_submited_success_email_content_admin',
156
-        'css' => 'width:500px; height: 150px;',
157
-        'type' => 'textarea',
158
-        'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
159
-    ),
160
-    array(
161
-        'name' => __('Notify Admin when listing edited by Author', 'geodirectory'),
162
-        'desc' => __('Yes', 'geodirectory'),
163
-        'id' => 'geodir_notify_post_edited',
164
-        'std' => '0',
165
-        'type' => 'radio',
166
-        'value' => '1',
167
-        'radiogroup' => 'start'
168
-    ),
169
-    array(
170
-        'name' => __('Notify Admin when listing edited by Author', 'geodirectory'),
171
-        'desc' => __('No', 'geodirectory'),
172
-        'id' => 'geodir_notify_post_edited',
173
-        'std' => '0',
174
-        'type' => 'radio',
175
-        'value' => '0',
176
-        'radiogroup' => 'end'
177
-    ),
178
-    array(
179
-        'name' => __('Listing edited by Author', 'geodirectory'),
180
-        'desc' => '',
181
-        'id' => 'geodir_post_edited_email_subject_admin',
182
-        'type' => 'text',
183
-        'css' => 'min-width:300px;',
184
-        'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory')
185
-    ),
186
-    array(
187
-        'name' => '',
188
-        'desc' => '',
189
-        'id' => 'geodir_post_edited_email_content_admin',
190
-        'css' => 'width:500px; height: 150px;',
191
-        'type' => 'textarea',
192
-        'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory')
193
-    ),
194
-
195
-
196
-    array('type' => 'sectionend', 'id' => 'admin_emails'),
197
-
198
-
199
-    array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'),
200
-
201
-    array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'),
202
-
203
-    array(
204
-        'name' => __('Post submit success to client email', 'geodirectory'),
205
-        'desc' => '',
206
-        'id' => 'geodir_post_submited_success_email_subject',
207
-        'type' => 'text',
208
-        'css' => 'min-width:300px;',
209
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
210
-    ),
211
-    array(
212
-        'name' => '',
213
-        'desc' => '',
214
-        'id' => 'geodir_post_submited_success_email_content',
215
-        'css' => 'width:500px; height: 150px;',
216
-        'type' => 'textarea',
217
-        'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
218
-    ),
219
-
220
-
221
-    array(
222
-        'name' => __('User forgot password email', 'geodirectory'),
223
-        'desc' => '',
224
-        'id' => 'geodir_forgot_password_subject',
225
-        'type' => 'text',
226
-        'css' => 'min-width:300px;',
227
-        'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings
228
-    ),
229
-    array(
230
-        'name' => '',
231
-        'desc' => '',
232
-        'id' => 'geodir_forgot_password_content',
233
-        'css' => 'width:500px; height: 150px;',
234
-        'type' => 'textarea',
235
-        'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
236
-    ),
237
-
238
-    array(
239
-        'name' => __('Registration success email', 'geodirectory'),
240
-        'desc' => '',
241
-        'id' => 'geodir_registration_success_email_subject',
242
-        'type' => 'text',
243
-        'css' => 'min-width:300px;',
244
-        'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings
245
-    ),
246
-    array(
247
-        'name' => '',
248
-        'desc' => '',
249
-        'id' => 'geodir_registration_success_email_content',
250
-        'css' => 'width:500px; height: 150px;',
251
-        'type' => 'textarea',
252
-        'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
253
-    ),
254
-    array(
255
-        'name' => __('Listing published email', 'geodirectory'),
256
-        'desc' => '',
257
-        'id' => 'geodir_post_published_email_subject',
258
-        'type' => 'text',
259
-        'css' => 'min-width:300px;',
260
-        'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings
261
-    ),
262
-    array(
263
-        'name' => '',
264
-        'desc' => '',
265
-        'id' => 'geodir_post_published_email_content',
266
-        'css' => 'width:500px; height: 150px;',
267
-        'type' => 'textarea',
268
-        'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory')
269
-    ),
270
-
271
-    array('type' => 'sectionend', 'id' => 'client_emails'),
272
-
273
-    array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'),
274
-
275
-    array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'),
276
-
277
-    array(
278
-        'name' => __('Send to friend', 'geodirectory'),
279
-        'desc' => '',
280
-        'id' => 'geodir_email_friend_subject',
281
-        'type' => 'text',
282
-        'css' => 'min-width:300px;',
283
-        'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory')
284
-    ),
285
-    array(
286
-        'name' => '',
287
-        'desc' => '',
288
-        'id' => 'geodir_email_friend_content',
289
-        'css' => 'width:500px; height: 150px;',
290
-        'type' => 'textarea',
291
-        'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
292
-    ),
293
-
294
-    array(
295
-        'name' => __('Email enquiry', 'geodirectory'),
296
-        'desc' => '',
297
-        'id' => 'geodir_email_enquiry_subject',
298
-        'type' => 'text',
299
-        'css' => 'min-width:300px;',
300
-        'std' => __('Website Enquiry', 'geodirectory')
301
-    ),
302
-    array(
303
-        'name' => '',
304
-        'desc' => '',
305
-        'id' => 'geodir_email_enquiry_content',
306
-        'css' => 'width:500px; height: 150px;',
307
-        'type' => 'textarea',
308
-        'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
309
-    ),
310
-
311
-    array('type' => 'sectionend', 'id' => 'other_emails'),
312
-
313
-
314
-    array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'),
315
-
316
-    array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'),
317
-
318
-    array(
319
-        'name' => __('Post submitted success', 'geodirectory'),
320
-        'desc' => '',
321
-        'id' => 'geodir_post_added_success_msg_content',
322
-        'css' => 'width:500px; height: 150px;',
323
-        'type' => 'textarea',
324
-        'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
325
-    ),
326
-
327
-
328
-    array('type' => 'sectionend', 'id' => 'messages'),
20
+	array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'),
21
+
22
+
23
+	array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'),
24
+
25
+	array(
26
+		'name' => __('List of usable shortcodes', 'geodirectory'),
27
+		'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'),
28
+		'id' => 'geodir_list_of_usable_shordcodes',
29
+		'type' => 'html_content',
30
+		'css' => 'min-width:300px;',
31
+		'std' => 'All Places' // Default value for the page title - changed in settings
32
+	),
33
+
34
+	array(
35
+		'name' => __('Use advanced editor? (slow loading)', 'geodirectory'),
36
+		'desc' => __('Yes', 'geodirectory'),
37
+		'id' => 'geodir_tiny_editor',
38
+		'std' => 'yes',
39
+		'type' => 'radio',
40
+		'value' => '1',
41
+		'radiogroup' => 'start'
42
+	),
43
+	array(
44
+		'name' => __('Use advanced editor?(slow loading)', 'geodirectory'),
45
+		'desc' => __('No', 'geodirectory'),
46
+		'id' => 'geodir_tiny_editor',
47
+		'std' => 'yes',
48
+		'type' => 'radio',
49
+		'value' => '0',
50
+		'radiogroup' => 'end'
51
+	),
52
+
53
+
54
+	array('type' => 'sectionend', 'id' => 'notification_options'),
55
+
56
+
57
+	array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'),
58
+
59
+	array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'),
60
+
61
+	array(
62
+		'name' => __('New user registration', 'geodirectory'),
63
+		'desc' => __('Yes', 'geodirectory'),
64
+		'id' => 'geodir_bcc_new_user',
65
+		'std' => 'yes',
66
+		'type' => 'radio',
67
+		'value' => '1',
68
+		'radiogroup' => 'start'
69
+	),
70
+	array(
71
+		'name' => __('New user registration', 'geodirectory'),
72
+		'desc' => __('No', 'geodirectory'),
73
+		'id' => 'geodir_bcc_new_user',
74
+		'std' => 'yes',
75
+		'type' => 'radio',
76
+		'value' => '0',
77
+		'radiogroup' => 'end'
78
+	),
79
+
80
+	array(
81
+		'name' => __('Send to friend', 'geodirectory'),
82
+		'desc' => __('Yes', 'geodirectory'),
83
+		'id' => 'geodir_bcc_friend',
84
+		'std' => 'yes',
85
+		'type' => 'radio',
86
+		'value' => '1',
87
+		'radiogroup' => 'start'
88
+	),
89
+	array(
90
+		'name' => __('Send to friend', 'geodirectory'),
91
+		'desc' => __('No', 'geodirectory'),
92
+		'id' => 'geodir_bcc_friend',
93
+		'std' => 'yes',
94
+		'type' => 'radio',
95
+		'value' => '0',
96
+		'radiogroup' => 'end'
97
+	),
98
+
99
+	array(
100
+		'name' => __('Send enquiry', 'geodirectory'),
101
+		'desc' => __('Yes', 'geodirectory'),
102
+		'id' => 'geodir_bcc_enquiry',
103
+		'std' => 'yes',
104
+		'type' => 'radio',
105
+		'value' => '1',
106
+		'radiogroup' => 'start'
107
+	),
108
+	array(
109
+		'name' => __('Send enquiry', 'geodirectory'),
110
+		'desc' => __('No', 'geodirectory'),
111
+		'id' => 'geodir_bcc_enquiry',
112
+		'std' => 'yes',
113
+		'type' => 'radio',
114
+		'value' => '0',
115
+		'radiogroup' => 'end'
116
+	),
117
+
118
+
119
+	array('type' => 'sectionend', 'id' => 'site_bcc_options'),
120
+
121
+
122
+	array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'),
123
+
124
+	array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'),
125
+
126
+	array(
127
+		'name' => __('Notify to admin on post submit', 'geodirectory'),
128
+		'desc' => __('Yes', 'geodirectory'),
129
+		'id' => 'geodir_notify_post_submit',
130
+		'std' => '1',
131
+		'type' => 'radio',
132
+		'value' => '1',
133
+		'radiogroup' => 'start'
134
+	),
135
+	array(
136
+		'name' => __('Notify to admin on post submit', 'geodirectory'),
137
+		'desc' => __('No', 'geodirectory'),
138
+		'id' => 'geodir_notify_post_submit',
139
+		'std' => '1',
140
+		'type' => 'radio',
141
+		'value' => '0',
142
+		'radiogroup' => 'end'
143
+	),
144
+	array(
145
+		'name' => __('Post submit success to admin email', 'geodirectory'),
146
+		'desc' => '',
147
+		'id' => 'geodir_post_submited_success_email_subject_admin',
148
+		'type' => 'text',
149
+		'css' => 'min-width:300px;',
150
+		'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
151
+	),
152
+	 array(
153
+		'name' => '',
154
+		'desc' => '',
155
+		'id' => 'geodir_post_submited_success_email_content_admin',
156
+		'css' => 'width:500px; height: 150px;',
157
+		'type' => 'textarea',
158
+		'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
159
+	),
160
+	array(
161
+		'name' => __('Notify Admin when listing edited by Author', 'geodirectory'),
162
+		'desc' => __('Yes', 'geodirectory'),
163
+		'id' => 'geodir_notify_post_edited',
164
+		'std' => '0',
165
+		'type' => 'radio',
166
+		'value' => '1',
167
+		'radiogroup' => 'start'
168
+	),
169
+	array(
170
+		'name' => __('Notify Admin when listing edited by Author', 'geodirectory'),
171
+		'desc' => __('No', 'geodirectory'),
172
+		'id' => 'geodir_notify_post_edited',
173
+		'std' => '0',
174
+		'type' => 'radio',
175
+		'value' => '0',
176
+		'radiogroup' => 'end'
177
+	),
178
+	array(
179
+		'name' => __('Listing edited by Author', 'geodirectory'),
180
+		'desc' => '',
181
+		'id' => 'geodir_post_edited_email_subject_admin',
182
+		'type' => 'text',
183
+		'css' => 'min-width:300px;',
184
+		'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory')
185
+	),
186
+	array(
187
+		'name' => '',
188
+		'desc' => '',
189
+		'id' => 'geodir_post_edited_email_content_admin',
190
+		'css' => 'width:500px; height: 150px;',
191
+		'type' => 'textarea',
192
+		'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory')
193
+	),
194
+
195
+
196
+	array('type' => 'sectionend', 'id' => 'admin_emails'),
197
+
198
+
199
+	array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'),
200
+
201
+	array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'),
202
+
203
+	array(
204
+		'name' => __('Post submit success to client email', 'geodirectory'),
205
+		'desc' => '',
206
+		'id' => 'geodir_post_submited_success_email_subject',
207
+		'type' => 'text',
208
+		'css' => 'min-width:300px;',
209
+		'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
210
+	),
211
+	array(
212
+		'name' => '',
213
+		'desc' => '',
214
+		'id' => 'geodir_post_submited_success_email_content',
215
+		'css' => 'width:500px; height: 150px;',
216
+		'type' => 'textarea',
217
+		'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
218
+	),
219
+
220
+
221
+	array(
222
+		'name' => __('User forgot password email', 'geodirectory'),
223
+		'desc' => '',
224
+		'id' => 'geodir_forgot_password_subject',
225
+		'type' => 'text',
226
+		'css' => 'min-width:300px;',
227
+		'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings
228
+	),
229
+	array(
230
+		'name' => '',
231
+		'desc' => '',
232
+		'id' => 'geodir_forgot_password_content',
233
+		'css' => 'width:500px; height: 150px;',
234
+		'type' => 'textarea',
235
+		'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
236
+	),
237
+
238
+	array(
239
+		'name' => __('Registration success email', 'geodirectory'),
240
+		'desc' => '',
241
+		'id' => 'geodir_registration_success_email_subject',
242
+		'type' => 'text',
243
+		'css' => 'min-width:300px;',
244
+		'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings
245
+	),
246
+	array(
247
+		'name' => '',
248
+		'desc' => '',
249
+		'id' => 'geodir_registration_success_email_content',
250
+		'css' => 'width:500px; height: 150px;',
251
+		'type' => 'textarea',
252
+		'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
253
+	),
254
+	array(
255
+		'name' => __('Listing published email', 'geodirectory'),
256
+		'desc' => '',
257
+		'id' => 'geodir_post_published_email_subject',
258
+		'type' => 'text',
259
+		'css' => 'min-width:300px;',
260
+		'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings
261
+	),
262
+	array(
263
+		'name' => '',
264
+		'desc' => '',
265
+		'id' => 'geodir_post_published_email_content',
266
+		'css' => 'width:500px; height: 150px;',
267
+		'type' => 'textarea',
268
+		'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory')
269
+	),
270
+
271
+	array('type' => 'sectionend', 'id' => 'client_emails'),
272
+
273
+	array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'),
274
+
275
+	array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'),
276
+
277
+	array(
278
+		'name' => __('Send to friend', 'geodirectory'),
279
+		'desc' => '',
280
+		'id' => 'geodir_email_friend_subject',
281
+		'type' => 'text',
282
+		'css' => 'min-width:300px;',
283
+		'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory')
284
+	),
285
+	array(
286
+		'name' => '',
287
+		'desc' => '',
288
+		'id' => 'geodir_email_friend_content',
289
+		'css' => 'width:500px; height: 150px;',
290
+		'type' => 'textarea',
291
+		'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
292
+	),
293
+
294
+	array(
295
+		'name' => __('Email enquiry', 'geodirectory'),
296
+		'desc' => '',
297
+		'id' => 'geodir_email_enquiry_subject',
298
+		'type' => 'text',
299
+		'css' => 'min-width:300px;',
300
+		'std' => __('Website Enquiry', 'geodirectory')
301
+	),
302
+	array(
303
+		'name' => '',
304
+		'desc' => '',
305
+		'id' => 'geodir_email_enquiry_content',
306
+		'css' => 'width:500px; height: 150px;',
307
+		'type' => 'textarea',
308
+		'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
309
+	),
310
+
311
+	array('type' => 'sectionend', 'id' => 'other_emails'),
312
+
313
+
314
+	array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'),
315
+
316
+	array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'),
317
+
318
+	array(
319
+		'name' => __('Post submitted success', 'geodirectory'),
320
+		'desc' => '',
321
+		'id' => 'geodir_post_added_success_msg_content',
322
+		'css' => 'width:500px; height: 150px;',
323
+		'type' => 'textarea',
324
+		'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
325
+	),
326
+
327
+
328
+	array('type' => 'sectionend', 'id' => 'messages'),
329 329
 
330 330
 )); // End Manage NOtifications settings
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/general_settings_array.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
     ),
99 99
     array('type' => 'sectionend', 'id' => 'general_options'),
100 100
 
101
-));/* General Options End*/
101
+)); /* General Options End*/
102 102
 
103 103
 /**
104 104
  * Filter GD Google Analytic Settings array.
Please login to merge, or discard this patch.
Indentation   +273 added lines, -273 removed lines patch added patch discarded remove patch
@@ -16,92 +16,92 @@  discard block
 block discarded – undo
16 16
  */
17 17
 $general_options = apply_filters('geodir_general_options', array(
18 18
 
19
-    array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
20
-
21
-    array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
22
-
23
-    array(
24
-        'name' => __('Sender name', 'geodirectory'),
25
-        'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
26
-        'id' => 'site_email_name',
27
-        'type' => 'text',
28
-        'css' => 'min-width:300px;',
29
-        'std' => get_bloginfo('name') // Default value for the page title - changed in settings
30
-    ),
31
-
32
-    array(
33
-        'name' => __('Email address', 'geodirectory'),
34
-        'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
35
-        'id' => 'site_email',
36
-        'type' => 'text',
37
-        'css' => 'min-width:300px;',
38
-        'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
39
-    ),
40
-    array(
41
-        'name' => __('Allow user to see wp-admin area', 'geodirectory'),
42
-        'desc' => __('Yes', 'geodirectory'),
43
-        'id' => 'geodir_allow_wpadmin',
44
-        'std' => '1',
45
-        'type' => 'radio',
46
-        'value' => '1',
47
-        'radiogroup' => 'start'
48
-    ),
49
-    array(
50
-        'name' => __('Allow user to see wp-admin area', 'geodirectory'),
51
-        'desc' => __('No', 'geodirectory'),
52
-        'id' => 'geodir_allow_wpadmin',
53
-        'std' => '0',
54
-        'type' => 'radio',
55
-        'value' => '0',
56
-        'radiogroup' => 'end'
57
-    ),
58
-
59
-    array(
60
-        'name' => __('Allow user to choose own password', 'geodirectory'),
61
-        'desc' => __('Yes', 'geodirectory'),
62
-        'id' => 'geodir_allow_cpass',
63
-        'std' => '1',
64
-        'type' => 'radio',
65
-        'value' => '1',
66
-        'radiogroup' => 'start'
67
-    ),
68
-    array(
69
-        'name' => __('Allow user to choose own password', 'geodirectory'),
70
-        'desc' => __('No', 'geodirectory'),
71
-        'id' => 'geodir_allow_cpass',
72
-        'std' => '0',
73
-        'type' => 'radio',
74
-        'value' => '0',
75
-        'radiogroup' => 'end'
76
-    ),
77
-    array(
78
-        'name' => __('Disable review stars for CPT', 'geodirectory'),
79
-        'desc' => __('Disable review stars for certain CPT without disabling comments on listings.', 'geodirectory'),
80
-        'tip' => '',
81
-        'id' => 'geodir_disable_rating_cpt',
82
-        'css' => 'min-width:300px;',
83
-        'std' => '',
84
-        'type' => 'multiselect',
85
-        'placeholder_text' => __('Select post types', 'geodirectory'),
86
-        'class' => 'chosen_select',
87
-        'options' => array_unique(geodir_post_type_setting_fun())
88
-    ),
89
-    array(
90
-        'name' => __('User deleted posts go to trash', 'geodirectory'),
91
-        'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
92
-        'id' => 'geodir_disable_perm_delete',
93
-        'type' => 'checkbox',
94
-        'std' => '1'
95
-    ),
96
-    array(
97
-        'name' => __('Max upload file size(in mb)', 'geodirectory'),
98
-        'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'),
99
-        'id' => 'geodir_upload_max_filesize',
100
-        'type' => 'text',
101
-        'css' => 'min-width:300px;',
102
-        'std' => '2'
103
-    ),
104
-    array('type' => 'sectionend', 'id' => 'general_options'),
19
+	array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
20
+
21
+	array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
22
+
23
+	array(
24
+		'name' => __('Sender name', 'geodirectory'),
25
+		'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
26
+		'id' => 'site_email_name',
27
+		'type' => 'text',
28
+		'css' => 'min-width:300px;',
29
+		'std' => get_bloginfo('name') // Default value for the page title - changed in settings
30
+	),
31
+
32
+	array(
33
+		'name' => __('Email address', 'geodirectory'),
34
+		'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
35
+		'id' => 'site_email',
36
+		'type' => 'text',
37
+		'css' => 'min-width:300px;',
38
+		'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
39
+	),
40
+	array(
41
+		'name' => __('Allow user to see wp-admin area', 'geodirectory'),
42
+		'desc' => __('Yes', 'geodirectory'),
43
+		'id' => 'geodir_allow_wpadmin',
44
+		'std' => '1',
45
+		'type' => 'radio',
46
+		'value' => '1',
47
+		'radiogroup' => 'start'
48
+	),
49
+	array(
50
+		'name' => __('Allow user to see wp-admin area', 'geodirectory'),
51
+		'desc' => __('No', 'geodirectory'),
52
+		'id' => 'geodir_allow_wpadmin',
53
+		'std' => '0',
54
+		'type' => 'radio',
55
+		'value' => '0',
56
+		'radiogroup' => 'end'
57
+	),
58
+
59
+	array(
60
+		'name' => __('Allow user to choose own password', 'geodirectory'),
61
+		'desc' => __('Yes', 'geodirectory'),
62
+		'id' => 'geodir_allow_cpass',
63
+		'std' => '1',
64
+		'type' => 'radio',
65
+		'value' => '1',
66
+		'radiogroup' => 'start'
67
+	),
68
+	array(
69
+		'name' => __('Allow user to choose own password', 'geodirectory'),
70
+		'desc' => __('No', 'geodirectory'),
71
+		'id' => 'geodir_allow_cpass',
72
+		'std' => '0',
73
+		'type' => 'radio',
74
+		'value' => '0',
75
+		'radiogroup' => 'end'
76
+	),
77
+	array(
78
+		'name' => __('Disable review stars for CPT', 'geodirectory'),
79
+		'desc' => __('Disable review stars for certain CPT without disabling comments on listings.', 'geodirectory'),
80
+		'tip' => '',
81
+		'id' => 'geodir_disable_rating_cpt',
82
+		'css' => 'min-width:300px;',
83
+		'std' => '',
84
+		'type' => 'multiselect',
85
+		'placeholder_text' => __('Select post types', 'geodirectory'),
86
+		'class' => 'chosen_select',
87
+		'options' => array_unique(geodir_post_type_setting_fun())
88
+	),
89
+	array(
90
+		'name' => __('User deleted posts go to trash', 'geodirectory'),
91
+		'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
92
+		'id' => 'geodir_disable_perm_delete',
93
+		'type' => 'checkbox',
94
+		'std' => '1'
95
+	),
96
+	array(
97
+		'name' => __('Max upload file size(in mb)', 'geodirectory'),
98
+		'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'),
99
+		'id' => 'geodir_upload_max_filesize',
100
+		'type' => 'text',
101
+		'css' => 'min-width:300px;',
102
+		'std' => '2'
103
+	),
104
+	array('type' => 'sectionend', 'id' => 'general_options'),
105 105
 
106 106
 ));/* General Options End*/
107 107
 
@@ -113,104 +113,104 @@  discard block
 block discarded – undo
113 113
  */
114 114
 $google_analytic_settings = apply_filters('geodir_google_analytic_settings', array(
115 115
 
116
-    array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
117
-
118
-    array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
119
-
120
-
121
-
122
-    array(
123
-        'name' => __('Show business owner google analytics stats?', 'geodirectory'),
124
-        'desc' => __('Yes', 'geodirectory'),
125
-        'id' => 'geodir_ga_stats',
126
-        'std' => '0',
127
-        'type' => 'radio',
128
-        'value' => '1',
129
-        'radiogroup' => 'start'
130
-    ),
131
-    array(
132
-        'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
133
-        'desc' => __('No', 'geodirectory'),
134
-        'id' => 'geodir_ga_stats',
135
-        'std' => '1',
136
-        'type' => 'radio',
137
-        'value' => '0',
138
-        'radiogroup' => 'end'
139
-    ),
140
-
141
-    array(
142
-        'name' => __('Google analytics access', 'geodirectory'),
143
-        'desc' => '',
144
-        'id' => 'geodir_ga_token',
145
-        'type' => 'google_analytics',
146
-        'css' => 'min-width:300px;',
147
-        'std' => '' // Default value for the page title - changed in settings
148
-    ),
149
-
150
-    array(
151
-        'name' => __('Google analytics Auth Code', 'geodirectory'),
152
-        'desc' => __('You must save this setting before accounts will show.', 'geodirectory'),
153
-        'id' => 'geodir_ga_auth_code',
154
-        'type' => 'text',
155
-        'css' => 'min-width:300px;',
156
-        'std' => '' // Default value for the page title - changed in settings
157
-    ),
158
-
159
-    array(
160
-        'name' => __('Analytics Account', 'geodirectory'),
161
-        'desc' => __('Select the account that you setup for this site.', 'geodirectory'),
162
-        'id' => 'geodir_ga_account_id',
163
-        'css' => 'min-width:300px;',
164
-        'std' => 'gridview_onehalf',
165
-        'type' => 'select',
166
-        'class' => 'chosen_select',
167
-        'options' => geodir_gd_accounts()
168
-    ),
169
-
170
-
171
-    array(
172
-        'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
173
-        'desc' => __('Yes <small>(this will automatically add the correct tracking code to your site)</small>', 'geodirectory'),
174
-        'id' => 'geodir_ga_add_tracking_code',
175
-        'std' => '0',
176
-        'type' => 'radio',
177
-        'value' => '1',
178
-        'radiogroup' => 'start'
179
-    ),
180
-    array(
181
-        'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
182
-        'desc' => __('No <small>(if you already have tracking code added you should not add it again)</small>', 'geodirectory'),
183
-        'id' => 'geodir_ga_add_tracking_code',
184
-        'std' => '1',
185
-        'type' => 'radio',
186
-        'value' => '0',
187
-        'radiogroup' => 'end'
188
-    ),
189
-
190
-    array(
191
-        'name' => __('Anonymize user IP?', 'geodirectory'),
192
-        'desc' => __('In most cases this is not required, this is to comply with certain country laws such as Germany.', 'geodirectory'),
193
-        'id' => 'geodir_ga_anonymize_ip',
194
-        'type' => 'checkbox',
195
-        'std' => '0'
196
-    ),
197
-
198
-    array(
199
-        'name' => __('Auto refresh active users?', 'geodirectory'),
200
-        'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'),
201
-        'id' => 'geodir_ga_auto_refresh',
202
-        'type' => 'checkbox',
203
-        'std' => '0'
204
-    ),
205
-    array(
206
-        'name' => __('Time interval for auto refresh active users', 'geodirectory'),
207
-        'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'),
208
-        'id' => 'geodir_ga_refresh_time',
209
-        'type' => 'text',
210
-        'std' => '5'
211
-    ),
212
-
213
-    array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
116
+	array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
117
+
118
+	array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
119
+
120
+
121
+
122
+	array(
123
+		'name' => __('Show business owner google analytics stats?', 'geodirectory'),
124
+		'desc' => __('Yes', 'geodirectory'),
125
+		'id' => 'geodir_ga_stats',
126
+		'std' => '0',
127
+		'type' => 'radio',
128
+		'value' => '1',
129
+		'radiogroup' => 'start'
130
+	),
131
+	array(
132
+		'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
133
+		'desc' => __('No', 'geodirectory'),
134
+		'id' => 'geodir_ga_stats',
135
+		'std' => '1',
136
+		'type' => 'radio',
137
+		'value' => '0',
138
+		'radiogroup' => 'end'
139
+	),
140
+
141
+	array(
142
+		'name' => __('Google analytics access', 'geodirectory'),
143
+		'desc' => '',
144
+		'id' => 'geodir_ga_token',
145
+		'type' => 'google_analytics',
146
+		'css' => 'min-width:300px;',
147
+		'std' => '' // Default value for the page title - changed in settings
148
+	),
149
+
150
+	array(
151
+		'name' => __('Google analytics Auth Code', 'geodirectory'),
152
+		'desc' => __('You must save this setting before accounts will show.', 'geodirectory'),
153
+		'id' => 'geodir_ga_auth_code',
154
+		'type' => 'text',
155
+		'css' => 'min-width:300px;',
156
+		'std' => '' // Default value for the page title - changed in settings
157
+	),
158
+
159
+	array(
160
+		'name' => __('Analytics Account', 'geodirectory'),
161
+		'desc' => __('Select the account that you setup for this site.', 'geodirectory'),
162
+		'id' => 'geodir_ga_account_id',
163
+		'css' => 'min-width:300px;',
164
+		'std' => 'gridview_onehalf',
165
+		'type' => 'select',
166
+		'class' => 'chosen_select',
167
+		'options' => geodir_gd_accounts()
168
+	),
169
+
170
+
171
+	array(
172
+		'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
173
+		'desc' => __('Yes <small>(this will automatically add the correct tracking code to your site)</small>', 'geodirectory'),
174
+		'id' => 'geodir_ga_add_tracking_code',
175
+		'std' => '0',
176
+		'type' => 'radio',
177
+		'value' => '1',
178
+		'radiogroup' => 'start'
179
+	),
180
+	array(
181
+		'name' => __('Add Google analytics tracking code to site?', 'geodirectory'),
182
+		'desc' => __('No <small>(if you already have tracking code added you should not add it again)</small>', 'geodirectory'),
183
+		'id' => 'geodir_ga_add_tracking_code',
184
+		'std' => '1',
185
+		'type' => 'radio',
186
+		'value' => '0',
187
+		'radiogroup' => 'end'
188
+	),
189
+
190
+	array(
191
+		'name' => __('Anonymize user IP?', 'geodirectory'),
192
+		'desc' => __('In most cases this is not required, this is to comply with certain country laws such as Germany.', 'geodirectory'),
193
+		'id' => 'geodir_ga_anonymize_ip',
194
+		'type' => 'checkbox',
195
+		'std' => '0'
196
+	),
197
+
198
+	array(
199
+		'name' => __('Auto refresh active users?', 'geodirectory'),
200
+		'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'),
201
+		'id' => 'geodir_ga_auto_refresh',
202
+		'type' => 'checkbox',
203
+		'std' => '0'
204
+	),
205
+	array(
206
+		'name' => __('Time interval for auto refresh active users', 'geodirectory'),
207
+		'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'),
208
+		'id' => 'geodir_ga_refresh_time',
209
+		'type' => 'text',
210
+		'std' => '5'
211
+	),
212
+
213
+	array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
214 214
 
215 215
 )); // google_analytic_settings End
216 216
 
@@ -222,84 +222,84 @@  discard block
 block discarded – undo
222 222
  */
223 223
 $search_settings = apply_filters('geodir_search_settings', array(
224 224
 
225
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
226
-
227
-    array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
228
-
229
-    array(
230
-        'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
231
-        'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
232
-        'id' => 'geodir_search_dist',
233
-        'type' => 'text',
234
-        'css' => 'min-width:300px;',
235
-        'std' => '40' // Default value for the page title - changed in settings
236
-    ),
237
-
238
-    array(
239
-        'name' => __('Show search distances in miles or km', 'geodirectory'),
240
-        'desc' => __('Miles', 'geodirectory'),
241
-        'id' => 'geodir_search_dist_1',
242
-        'std' => 'miles',
243
-        'type' => 'radio',
244
-        'value' => 'miles',
245
-        'radiogroup' => 'start'
246
-    ),
247
-    array(
248
-        'name' => __('Show search distances in miles or km', 'geodirectory'),
249
-        'desc' => __('Kilometers', 'geodirectory'),
250
-        'id' => 'geodir_search_dist_1',
251
-        'std' => 'miles',
252
-        'type' => 'radio',
253
-        'value' => 'km',
254
-        'radiogroup' => 'end'
255
-    ),
256
-
257
-    array(
258
-        'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
259
-        'desc' => __('Meters', 'geodirectory'),
260
-        'id' => 'geodir_search_dist_2',
261
-        'std' => 'meters',
262
-        'type' => 'radio',
263
-        'value' => 'meters',
264
-        'radiogroup' => 'start'
265
-    ),
266
-
267
-    array(
268
-        'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
269
-        'desc' => __('Feet', 'geodirectory'),
270
-        'id' => 'geodir_search_dist_2',
271
-        'std' => 'meters',
272
-        'type' => 'radio',
273
-        'value' => 'feet',
274
-        'radiogroup' => 'end'
275
-    ),
276
-
277
-    array(
278
-        'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
279
-        'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
280
-        'id' => 'geodir_search_near_addition',
281
-        'type' => 'text',
282
-        'css' => 'min-width:300px;',
283
-        'std' => ''
284
-    ),
285
-    array(
286
-        'name' => __('Individual word search limit', 'geodirectory'),
287
-        'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
288
-        'id' => 'geodir_search_word_limit',
289
-        'css' => 'min-width:300px;',
290
-        'std' => 'gridview_onehalf',
291
-        'type' => 'select',
292
-        'class' => 'chosen_select',
293
-        'options' => array_unique(array(
294
-            '0' => __('Disabled', 'geodirectory'),
295
-            '1' => __('1 Character words excluded', 'geodirectory'),
296
-            '2' => __('2 Character words and less excluded', 'geodirectory'),
297
-            '3' => __('3 Character words and less excluded', 'geodirectory'),
298
-        ))
299
-    ),
300
-
301
-
302
-    array('type' => 'sectionend', 'id' => 'search_settings'),
225
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
226
+
227
+	array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
228
+
229
+	array(
230
+		'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
231
+		'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
232
+		'id' => 'geodir_search_dist',
233
+		'type' => 'text',
234
+		'css' => 'min-width:300px;',
235
+		'std' => '40' // Default value for the page title - changed in settings
236
+	),
237
+
238
+	array(
239
+		'name' => __('Show search distances in miles or km', 'geodirectory'),
240
+		'desc' => __('Miles', 'geodirectory'),
241
+		'id' => 'geodir_search_dist_1',
242
+		'std' => 'miles',
243
+		'type' => 'radio',
244
+		'value' => 'miles',
245
+		'radiogroup' => 'start'
246
+	),
247
+	array(
248
+		'name' => __('Show search distances in miles or km', 'geodirectory'),
249
+		'desc' => __('Kilometers', 'geodirectory'),
250
+		'id' => 'geodir_search_dist_1',
251
+		'std' => 'miles',
252
+		'type' => 'radio',
253
+		'value' => 'km',
254
+		'radiogroup' => 'end'
255
+	),
256
+
257
+	array(
258
+		'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
259
+		'desc' => __('Meters', 'geodirectory'),
260
+		'id' => 'geodir_search_dist_2',
261
+		'std' => 'meters',
262
+		'type' => 'radio',
263
+		'value' => 'meters',
264
+		'radiogroup' => 'start'
265
+	),
266
+
267
+	array(
268
+		'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
269
+		'desc' => __('Feet', 'geodirectory'),
270
+		'id' => 'geodir_search_dist_2',
271
+		'std' => 'meters',
272
+		'type' => 'radio',
273
+		'value' => 'feet',
274
+		'radiogroup' => 'end'
275
+	),
276
+
277
+	array(
278
+		'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
279
+		'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
280
+		'id' => 'geodir_search_near_addition',
281
+		'type' => 'text',
282
+		'css' => 'min-width:300px;',
283
+		'std' => ''
284
+	),
285
+	array(
286
+		'name' => __('Individual word search limit', 'geodirectory'),
287
+		'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
288
+		'id' => 'geodir_search_word_limit',
289
+		'css' => 'min-width:300px;',
290
+		'std' => 'gridview_onehalf',
291
+		'type' => 'select',
292
+		'class' => 'chosen_select',
293
+		'options' => array_unique(array(
294
+			'0' => __('Disabled', 'geodirectory'),
295
+			'1' => __('1 Character words excluded', 'geodirectory'),
296
+			'2' => __('2 Character words and less excluded', 'geodirectory'),
297
+			'3' => __('3 Character words and less excluded', 'geodirectory'),
298
+		))
299
+	),
300
+
301
+
302
+	array('type' => 'sectionend', 'id' => 'search_settings'),
303 303
 
304 304
 )); //search_settings End
305 305
 
@@ -311,17 +311,17 @@  discard block
 block discarded – undo
311 311
  */
312 312
 $dummy_data_settings = apply_filters('geodir_dummy_data_settings', array(
313 313
 
314
-    array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
315
-
316
-    array(
317
-        'name' => '',
318
-        'desc' => '',
319
-        'id' => 'geodir_dummy_data_installer',
320
-        'type' => 'dummy_installer',
321
-        'css' => 'min-width:300px;',
322
-        'std' => '40' // Default value for the page title - changed in settings
323
-    ),
324
-    array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
314
+	array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
315
+
316
+	array(
317
+		'name' => '',
318
+		'desc' => '',
319
+		'id' => 'geodir_dummy_data_installer',
320
+		'type' => 'dummy_installer',
321
+		'css' => 'min-width:300px;',
322
+		'std' => '40' // Default value for the page title - changed in settings
323
+	),
324
+	array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
325 325
 
326 326
 )); //dummy_data_settings End
327 327
 
Please login to merge, or discard this patch.
geodirectory-admin/google-api-php-client/src/Google/Task/Retryable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
  */
17 17
 
18 18
 if (!class_exists('Google_Client')) {
19
-  require_once dirname(__FILE__) . '/../autoload.php';
19
+  require_once dirname(__FILE__).'/../autoload.php';
20 20
 }
21 21
 
22 22
 /**
Please login to merge, or discard this patch.