Test Failed
Push — master ( 395cef...16d7b8 )
by
unknown
04:20
created
geodirectory-functions/map-functions/map_template_tags.php 3 patches
Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -67,77 +67,77 @@  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
-        'maptype' => $maptype,
116
-        'showPreview' => '0',
117
-        'maxZoom' => 21,
118
-        'autozoom' => true,
119
-        'bubble_size' => 'small',
120
-        'token' => '68f48005e256696074e1da9bf9f67f06',
121
-        'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN')
122
-    );
123
-
124
-    if (!empty($map_args)) {
125
-        foreach ($map_args as $map_option_key => $map_option_value) {
126
-            $geodir_map_options[$map_option_key] = $map_option_value;
127
-        }
128
-    }
129
-
130
-    if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
131
-    } else {
132
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
133
-    }
134
-
135
-    if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
136
-    } else {
137
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
138
-    }
139
-
140
-    /**
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
+		'maptype' => $maptype,
116
+		'showPreview' => '0',
117
+		'maxZoom' => 21,
118
+		'autozoom' => true,
119
+		'bubble_size' => 'small',
120
+		'token' => '68f48005e256696074e1da9bf9f67f06',
121
+		'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN')
122
+	);
123
+
124
+	if (!empty($map_args)) {
125
+		foreach ($map_args as $map_option_key => $map_option_value) {
126
+			$geodir_map_options[$map_option_key] = $map_option_value;
127
+		}
128
+	}
129
+
130
+	if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
131
+	} else {
132
+		$geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
133
+	}
134
+
135
+	if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
136
+	} else {
137
+		$geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
138
+	}
139
+
140
+	/**
141 141
 	 * Filter the options to use in google map.
142 142
 	 *
143 143
 	 * @since 1.0.0
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	$geodir_map_options = apply_filters("geodir_map_options_{$map_canvas_name}", $geodir_map_options);
148 148
 
149
-    $map_canvas_arr[$map_canvas_name] = array();
149
+	$map_canvas_arr[$map_canvas_name] = array();
150 150
 
151
-    /**
151
+	/**
152 152
 	 * Filter the post types to display data on map.
153 153
 	 *
154 154
 	 * @since 1.0.0
@@ -166,20 +166,20 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
168 168
 
169
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170
-        // Set default map options
169
+	if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170
+		// Set default map options
171 171
 
172
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
172
+		wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
173 173
 
174
-        wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
174
+		wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
175 175
 
176
-        if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') {
177
-            $map_width = '100%';
178
-        } else {
179
-            $map_width = $geodir_map_options['width'];
180
-        }
176
+		if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') {
177
+			$map_width = '100%';
178
+		} else {
179
+			$map_width = $geodir_map_options['width'];
180
+		}
181 181
 
182
-        /**
182
+		/**
183 183
 		 * Filter the width of map.
184 184
 		 *
185 185
 		 * @since 1.0.0
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		 * @param int $map_width Width of map box, eg: gd_place.
188 188
 		 */
189 189
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
190
-        ?>
190
+		?>
191 191
         <div id="catcher_<?php echo $map_canvas_name;?>"></div>
192 192
         <div class="stick_trigger_container">
193 193
             <div class="trigger_sticky triggeroff_sticky"></div>
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
222 222
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
223 223
                 <?php } else {
224
-                    ?>
224
+					?>
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 = "''";
232
-                ?>
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
+				?>
233 233
 
234 234
                 <?php if ($geodir_map_options['enable_map_direction']) { ?>
235 235
                     <div class="gd-input-group gd-get-directions">
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
                         <select id="travel-units" onchange="calcRoute('<?php echo $map_canvas_name; ?>')">
293 293
                             <option value="miles"><?php _e('Miles', 'geodirectory'); ?></option>
294 294
                             <option <?php if (get_option('geodir_search_dist_1') == 'km') {
295
-                                echo 'selected="selected"';
296
-                            } ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option>
295
+								echo 'selected="selected"';
296
+							} ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option>
297 297
                         </select>
298 298
                     </div>
299 299
 
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
 				if (empty($geodir_default_map_search_pt))
306 306
 					$geodir_default_map_search_pt = 'gd_place';
307 307
 
308
-                global $gd_session;
309
-                $homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype');
308
+				global $gd_session;
309
+				$homemap_catlist_ptype = $gd_session->get('homemap_catlist_ptype');
310 310
 
311
-                if ($homemap_catlist_ptype) {
312
-                    $geodir_default_map_search_pt = $homemap_catlist_ptype;
313
-                }
311
+				if ($homemap_catlist_ptype) {
312
+					$geodir_default_map_search_pt = $homemap_catlist_ptype;
313
+				}
314 314
 
315 315
 				/**
316 316
 				 * Filter the post type to retrieve data for map
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
 				?>
324 324
                 <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
325 325
                     <?php
326
-                    $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
327
-                    $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
326
+					$exclude_post_types = get_option('geodir_exclude_post_type_on_map');
327
+					$geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
328 328
 					$map_cat_class = '';
329 329
 					if ($geodir_map_options['enable_post_type_filters']) {
330 330
 						$map_cat_class = $geodir_available_pt_on_map > 1 ? ' map-cat-ptypes' : ' map-cat-floor';
331 331
 					}
332
-                    ?>
332
+					?>
333 333
                     <div
334 334
                         class="map-category-listing<?php echo $map_cat_class;?>">
335 335
                         <div class="gd-trigger gd-triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
                                 <?php if ($geodir_map_options['child_collapse']) { $child_collapse = "1"; ?>
348 348
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
349 349
                                 <?php } else {$child_collapse = "0";
350
-                                    ?>
350
+									?>
351 351
                                     <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
352 352
                                 <?php } ?>
353 353
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
@@ -369,17 +369,17 @@  discard block
 block discarded – undo
369 369
                 <!-- map-category-listings-->
370 370
 
371 371
                 <?php
372
-                if ($geodir_map_options['enable_location_filters']) {
372
+				if ($geodir_map_options['enable_location_filters']) {
373 373
 					$country = get_query_var('gd_country');
374 374
 					$region = get_query_var('gd_region');
375 375
 					$city = get_query_var('gd_city');
376 376
                     
377
-                    //fix for location/me page
378
-                    $country = $country != 'me' ? $country : '';
377
+					//fix for location/me page
378
+					$country = $country != 'me' ? $country : '';
379 379
 					$region = $region != 'me' ? $region : '';
380 380
 					$city = $country != 'me' ? $city : '';
381
-                    $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
382
-                    ?>
381
+					$gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
382
+					?>
383 383
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
384 384
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
385 385
                            value="<?php echo $country;?>"/>
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
391 391
                            value="<?php echo $gd_neighbourhood;?>"/>
392 392
                 <?php } else { //end of location filter
393
-                    ?>
393
+					?>
394 394
                     <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
395 395
                 <?php }?>
396 396
 
@@ -401,9 +401,9 @@  discard block
 block discarded – undo
401 401
 
402 402
 
403 403
                 <?php if ($geodir_map_options['enable_post_type_filters']) {
404
-                    $post_types = geodir_get_posttypes('object');
405
-                    if (count((array)($post_types)) > 1) {
406
-                        ?>
404
+					$post_types = geodir_get_posttypes('object');
405
+					if (count((array)($post_types)) > 1) {
406
+						?>
407 407
                         <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
408 408
                              style="max-width:<?php echo $map_width;?>!important;">
409 409
 
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
                             <div class="geodir-map-posttype-list"><?php } ?>
412 412
                                 <ul class="clearfix place-list">
413 413
                                     <?php
414
-                                    $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
414
+									$exclude_post_types = get_option('geodir_exclude_post_type_on_map');
415 415
 
416
-                                    foreach ($post_types as $post_type => $args) {
417
-                                        if (!in_array($post_type, $exclude_post_types)) {
418
-                                            $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
416
+									foreach ($post_types as $post_type => $args) {
417
+										if (!in_array($post_type, $exclude_post_types)) {
418
+											$class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
419 419
 											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)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>';
420
-                                        }
421
-                                    }
422
-                                    ?>
420
+										}
421
+									}
422
+									?>
423 423
                                 </ul>
424 424
                                 <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
425 425
                             </div><?php } ?>
@@ -433,8 +433,8 @@  discard block
 block discarded – undo
433 433
 
434 434
                         </div> <!-- map-places-listings-->
435 435
                     <?php }
436
-                } // end of post type filter if
437
-                ?>
436
+				} // end of post type filter if
437
+				?>
438 438
 
439 439
             </div>
440 440
         </div> <!--end of stick trigger container-->
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
         </script>
450 450
         <?php
451 451
 
452
-        if (strpos($geodir_map_options['height'], 'vh')) {
453
-            ?>
452
+		if (strpos($geodir_map_options['height'], 'vh')) {
453
+			?>
454 454
             <script>
455 455
                 (function () {
456 456
                     var screenH = jQuery(window).height();
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 
473 473
         <?php
474 474
 
475
-        } elseif (strpos($geodir_map_options['height'], 'px')) {
476
-            ?>
475
+		} elseif (strpos($geodir_map_options['height'], 'px')) {
476
+			?>
477 477
             <script>
478 478
                 (function () {
479 479
                     var screenH = jQuery(window).height();
@@ -488,20 +488,20 @@  discard block
 block discarded – undo
488 488
                 }());
489 489
             </script>
490 490
         <?php
491
-        }
491
+		}
492 492
 
493
-        /**
494
-         * Action that runs after all the map code has been output;
495
-         *
496
-         * @since 1.5.3
497
-         *
498
-         * @param array $geodir_map_options Array of map settings.
499
-         * @param string $map_canvas_name The canvas name and ID for the map.
500
-         */
501
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
493
+		/**
494
+		 * Action that runs after all the map code has been output;
495
+		 *
496
+		 * @since 1.5.3
497
+		 *
498
+		 * @param array $geodir_map_options Array of map settings.
499
+		 * @param string $map_canvas_name The canvas name and ID for the map.
500
+		 */
501
+		do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
502 502
 
503 503
 
504
-    endif; // Exclude posttypes if end
504
+	endif; // Exclude posttypes if end
505 505
 }
506 506
 
507 507
 /**
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 
130 130
     if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) {
131 131
     } else {
132
-        $geodir_map_options['height'] = $geodir_map_options['height'] . 'px';
132
+        $geodir_map_options['height'] = $geodir_map_options['height'].'px';
133 133
     }
134 134
 
135 135
     if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) {
136 136
     } else {
137
-        $geodir_map_options['width'] = $geodir_map_options['width'] . 'px';
137
+        $geodir_map_options['width'] = $geodir_map_options['width'].'px';
138 138
     }
139 139
 
140 140
     /**
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	$exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map'));
168 168
 
169
-    if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
169
+    if (count((array) $post_types) != count($exclude_post_types) || ($enable_jason_on_load)):
170 170
         // Set default map options
171 171
 
172
-        wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true);
172
+        wp_enqueue_script('geodir-map-widget', geodir_plugin_url().'/geodirectory-functions/map-functions/js/map.min.js', array(), false, true);
173 173
 
174 174
         wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options);
175 175
 
@@ -188,41 +188,41 @@  discard block
 block discarded – undo
188 188
 		 */
189 189
 		$map_width = apply_filters('geodir_change_map_width', $map_width);
190 190
         ?>
191
-        <div id="catcher_<?php echo $map_canvas_name;?>"></div>
191
+        <div id="catcher_<?php echo $map_canvas_name; ?>"></div>
192 192
         <div class="stick_trigger_container">
193 193
             <div class="trigger_sticky triggeroff_sticky"></div>
194
-            <div class="top_banner_section geodir_map_container <?php echo $map_class_name;?>"
195
-                 id="sticky_map_<?php echo $map_canvas_name;?>"
196
-                 style="min-height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
194
+            <div class="top_banner_section geodir_map_container <?php echo $map_class_name; ?>"
195
+                 id="sticky_map_<?php echo $map_canvas_name; ?>"
196
+                 style="min-height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
197 197
 
198 198
                 <div class="map_background">
199 199
                     <div class="top_banner_section_in clearfix">
200
-                        <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>
201
-                        <div class="<?php echo $map_canvas_name;?>_TopRight TopRight"></div>
202
-                        <div id="<?php echo $map_canvas_name;?>_wrapper" class="main_map_wrapper"
203
-                             style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;">
200
+                        <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>
201
+                        <div class="<?php echo $map_canvas_name; ?>_TopRight TopRight"></div>
202
+                        <div id="<?php echo $map_canvas_name; ?>_wrapper" class="main_map_wrapper"
203
+                             style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;">
204 204
                             <!-- new map start -->
205 205
                             <div class="iprelative">
206
-                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name;?>"
207
-                                     style="height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
208
-                                <div id="<?php echo $map_canvas_name;?>_loading_div" class="loading_div"
209
-                                     style=" height:<?php echo $geodir_map_options['height'];?>;width:<?php echo $map_width;?>;"></div>
206
+                                <div class="geodir_marker_cluster" id="<?php echo $map_canvas_name; ?>"
207
+                                     style="height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
208
+                                <div id="<?php echo $map_canvas_name; ?>_loading_div" class="loading_div"
209
+                                     style=" height:<?php echo $geodir_map_options['height']; ?>;width:<?php echo $map_width; ?>;"></div>
210 210
                                 <!--<div id="home_map_counter"></div>        -->
211
-                                <div id="<?php echo $map_canvas_name;?>_map_nofound"
211
+                                <div id="<?php echo $map_canvas_name; ?>_map_nofound"
212 212
                                      class="advmap_nofound"><?php echo MAP_NO_RESULTS; ?></div>
213
-                                <div id="<?php echo $map_canvas_name;?>_map_notloaded"
213
+                                <div id="<?php echo $map_canvas_name; ?>_map_notloaded"
214 214
                                      class="advmap_notloaded"><?php _e('<h3>Google Map Not Loaded</h3><p>Sorry, unable to load Google Maps API.', 'geodirectory'); ?></div>
215 215
                             </div>
216 216
                             <!-- new map end -->
217 217
                         </div>
218
-                        <div class="<?php echo $map_canvas_name;?>_BottomLeft BottomLeft"></div>
218
+                        <div class="<?php echo $map_canvas_name; ?>_BottomLeft BottomLeft"></div>
219 219
                     </div>
220 220
                 </div>
221 221
                 <?php if ($geodir_map_options['enable_jason_on_load']) { ?>
222
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/>
222
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="1"/>
223 223
                 <?php } else {
224 224
                     ?>
225
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/>
225
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_jason_enabled" value="0"/>
226 226
                 <?php }
227 227
 
228 228
                 if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters'])
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                       <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>
243 243
                     </div>
244 244
                     <script>
245
-                        <?php if(geodir_is_page('detail')){?>
245
+                        <?php if (geodir_is_page('detail')) {?>
246 246
                         jQuery(function () {
247 247
                             gd_initialize_ac();
248 248
                         });
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                                 // Create the autocomplete object, restricting the search
254 254
                                 // to geographical location types.
255 255
                                 autocomplete = new google.maps.places.Autocomplete(
256
-                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name;?>_fromAddress')),
256
+                                    /** @type {HTMLInputElement} */(document.getElementById('<?php echo $map_canvas_name; ?>_fromAddress')),
257 257
                                     {types: ['geocode']});
258 258
                                 // When the user selects an address from the dropdown,
259 259
                                 // populate the address fields in the form.
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                                 
268 268
                                 if (window.gdMaps == 'osm') {
269 269
                                     window.setTimeout(function() {
270
-                                        calcRoute('<?php echo $map_canvas_name;?>');
270
+                                        calcRoute('<?php echo $map_canvas_name; ?>');
271 271
                                     }, 1000);
272 272
                                 }
273 273
                             }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 				 */
322 322
 				$map_search_pt = apply_filters('geodir_default_map_search_pt', $geodir_default_map_search_pt);
323 323
 				?>
324
-                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>">
324
+                <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel; ?>">
325 325
                     <?php
326 326
                     $exclude_post_types = get_option('geodir_exclude_post_type_on_map');
327 327
                     $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types);
@@ -331,12 +331,12 @@  discard block
 block discarded – undo
331 331
 					}
332 332
                     ?>
333 333
                     <div
334
-                        class="map-category-listing<?php echo $map_cat_class;?>">
334
+                        class="map-category-listing<?php echo $map_cat_class; ?>">
335 335
                         <div class="gd-trigger gd-triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div>
336
-                        <div id="<?php echo $map_canvas_name;?>_cat"
337
-                             class="<?php echo $map_canvas_name;?>_map_category  map_category"
338
-                             <?php if ($child_collapse){ ?>checked="checked" <?php }?>
339
-                             style="max-height:<?php echo $geodir_map_options['height'];?>;">
336
+                        <div id="<?php echo $map_canvas_name; ?>_cat"
337
+                             class="<?php echo $map_canvas_name; ?>_map_category  map_category"
338
+                             <?php if ($child_collapse) { ?>checked="checked" <?php }?>
339
+                             style="max-height:<?php echo $geodir_map_options['height']; ?>;">
340 340
                             <input
341 341
                                 onkeydown="if(event.keyCode == 13){build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false)}"
342 342
                                 type="text"
@@ -348,11 +348,11 @@  discard block
 block discarded – undo
348 348
                                     <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/>
349 349
                                 <?php } else {$child_collapse = "0";
350 350
                                     ?>
351
-                                    <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/>
351
+                                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="0"/>
352 352
                                 <?php } ?>
353 353
                                 <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/>
354 354
                                 <div class="geodir_toggle">
355
-                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'),0,true,0,$map_canvas_name,$child_collapse,true); ?>
355
+                                    <?php echo home_map_taxonomy_walker(array($map_search_pt.'category'), 0, true, 0, $map_canvas_name, $child_collapse, true); ?>
356 356
                                     <script>jQuery( document ).ready(function() {
357 357
                                             geodir_show_sub_cat_collapse_button();
358 358
                                         });</script>
@@ -380,21 +380,21 @@  discard block
 block discarded – undo
380 380
 					$city = $country != 'me' ? $city : '';
381 381
                     $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : '';
382 382
                     ?>
383
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/>
384
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country"
385
-                           value="<?php echo $country;?>"/>
386
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_region" name="gd_region"
387
-                           value="<?php echo $region;?>"/>
388
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_city" name="gd_city"
389
-                           value="<?php echo $city;?>"/>
390
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood"
391
-                           value="<?php echo $gd_neighbourhood;?>"/>
383
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="1"/>
384
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_country" name="gd_country"
385
+                           value="<?php echo $country; ?>"/>
386
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_region" name="gd_region"
387
+                           value="<?php echo $region; ?>"/>
388
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_city" name="gd_city"
389
+                           value="<?php echo $city; ?>"/>
390
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_neighbourhood" name="gd_neighbourhood"
391
+                           value="<?php echo $gd_neighbourhood; ?>"/>
392 392
                 <?php } else { //end of location filter
393 393
                     ?>
394
-                    <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/>
394
+                    <input type="hidden" id="<?php echo $map_canvas_name; ?>_location_enabled" value="0"/>
395 395
                 <?php }?>
396 396
 
397
-                <input type="hidden" id="<?php echo $map_canvas_name;?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt;?>"/>
397
+                <input type="hidden" id="<?php echo $map_canvas_name; ?>_posttype" name="gd_posttype" value="<?php echo $map_search_pt; ?>"/>
398 398
 
399 399
                 <input type="hidden" name="limitstart" value=""/>
400 400
 
@@ -402,10 +402,10 @@  discard block
 block discarded – undo
402 402
 
403 403
                 <?php if ($geodir_map_options['enable_post_type_filters']) {
404 404
                     $post_types = geodir_get_posttypes('object');
405
-                    if (count((array)($post_types)) > 1) {
405
+                    if (count((array) ($post_types)) > 1) {
406 406
                         ?>
407
-                        <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu"
408
-                             style="max-width:<?php echo $map_width;?>!important;">
407
+                        <div class="map-places-listing" id="<?php echo $map_canvas_name; ?>_posttype_menu"
408
+                             style="max-width:<?php echo $map_width; ?>!important;">
409 409
 
410 410
                             <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?>
411 411
                             <div class="geodir-map-posttype-list"><?php } ?>
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
                                     foreach ($post_types as $post_type => $args) {
417 417
                                         if (!in_array($post_type, $exclude_post_types)) {
418 418
                                             $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : '';
419
-											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)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>';
419
+											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)">'.__(ucfirst($args->labels->name), 'geodirectory').'</a></li>';
420 420
                                         }
421 421
                                     }
422 422
                                     ?>
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
         <script type="text/javascript">
442 442
 
443 443
             jQuery(document).ready(function () {
444
-                //initMap('<?php echo $map_canvas_name;?>'); // depreciated, no need to load this twice
445
-                build_map_ajax_search_param('<?php echo $map_canvas_name;?>', false);
446
-                map_sticky('<?php echo $map_canvas_name;?>');
444
+                //initMap('<?php echo $map_canvas_name; ?>'); // depreciated, no need to load this twice
445
+                build_map_ajax_search_param('<?php echo $map_canvas_name; ?>', false);
446
+                map_sticky('<?php echo $map_canvas_name; ?>');
447 447
             });
448 448
 
449 449
         </script>
@@ -454,18 +454,18 @@  discard block
 block discarded – undo
454 454
             <script>
455 455
                 (function () {
456 456
                     var screenH = jQuery(window).height();
457
-                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']);?>";
457
+                    var heightVH = "<?php echo str_replace("vh", "", $geodir_map_options['height']); ?>";
458 458
 
459 459
                     var ptypeH = '';
460
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
461
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
460
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
461
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
462 462
                     }
463 463
 
464
-                    jQuery("#sticky_map_<?php echo $map_canvas_name;?>").css("min-height", screenH * (heightVH / 100) + 'px');
465
-                    jQuery("#<?php echo $map_canvas_name;?>_wrapper").height(screenH * (heightVH / 100) + 'px');
466
-                    jQuery("#<?php echo $map_canvas_name;?>").height(screenH * (heightVH / 100) + 'px');
467
-                    jQuery("#<?php echo $map_canvas_name;?>_loading_div").height(screenH * (heightVH / 100) + 'px');
468
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
464
+                    jQuery("#sticky_map_<?php echo $map_canvas_name; ?>").css("min-height", screenH * (heightVH / 100) + 'px');
465
+                    jQuery("#<?php echo $map_canvas_name; ?>_wrapper").height(screenH * (heightVH / 100) + 'px');
466
+                    jQuery("#<?php echo $map_canvas_name; ?>").height(screenH * (heightVH / 100) + 'px');
467
+                    jQuery("#<?php echo $map_canvas_name; ?>_loading_div").height(screenH * (heightVH / 100) + 'px');
468
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", (screenH * (heightVH / 100)) - ptypeH + 'px');
469 469
 
470 470
                 }());
471 471
             </script>
@@ -477,13 +477,13 @@  discard block
 block discarded – undo
477 477
             <script>
478 478
                 (function () {
479 479
                     var screenH = jQuery(window).height();
480
-                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']);?>";
480
+                    var heightVH = "<?php echo str_replace("px", "", $geodir_map_options['height']); ?>";
481 481
                     var ptypeH = '';
482
-                    if (jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").length) {
483
-                        ptypeH = jQuery("#<?php echo $map_canvas_name;?>_posttype_menu").outerHeight();
482
+                    if (jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").length) {
483
+                        ptypeH = jQuery("#<?php echo $map_canvas_name; ?>_posttype_menu").outerHeight();
484 484
                     }
485 485
 
486
-                    jQuery("#<?php echo $map_canvas_name;?>_cat").css("max-height", heightVH - ptypeH + 'px');
486
+                    jQuery("#<?php echo $map_canvas_name; ?>_cat").css("max-height", heightVH - ptypeH + 'px');
487 487
 
488 488
                 }());
489 489
             </script>
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
          * @param array $geodir_map_options Array of map settings.
499 499
          * @param string $map_canvas_name The canvas name and ID for the map.
500 500
          */
501
-        do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name);
501
+        do_action('geodir_map_after_render', $geodir_map_options, $map_canvas_name);
502 502
 
503 503
 
504 504
     endif; // Exclude posttypes if end
Please login to merge, or discard this patch.
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.
geodirectory-functions/custom_fields_input_functions.php 3 patches
Indentation   +709 added lines, -709 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_cfi_fieldset($html,$cf){
21 21
 
22
-    $html_var = $cf['htmlvar_name'];
23
-
24
-    // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
-        /**
27
-         * Filter the fieldset html by individual custom field.
28
-         *
29
-         * @param string $html The html to filter.
30
-         * @param array $cf The custom field array.
31
-         * @since 1.6.6
32
-         */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
-    }
35
-
36
-    // If no html then we run the standard output.
37
-    if(empty($html)) {
38
-
39
-        ob_start(); // Start  buffering;
40
-        ?>
22
+	$html_var = $cf['htmlvar_name'];
23
+
24
+	// Check if there is a custom field specific filter.
25
+	if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
+		/**
27
+		 * Filter the fieldset html by individual custom field.
28
+		 *
29
+		 * @param string $html The html to filter.
30
+		 * @param array $cf The custom field array.
31
+		 * @since 1.6.6
32
+		 */
33
+		$html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
+	}
35
+
36
+	// If no html then we run the standard output.
37
+	if(empty($html)) {
38
+
39
+		ob_start(); // Start  buffering;
40
+		?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __( $cf['site_title'], 'geodirectory' ); ?>
43 43
             <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>';
45
-            } ?></h5>
44
+				echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>';
45
+			} ?></h5>
46 46
         <?php
47
-        $html = ob_get_clean();
48
-    }
47
+		$html = ob_get_clean();
48
+	}
49 49
 
50
-    return $html;
50
+	return $html;
51 51
 }
52 52
 add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
53 53
 
@@ -64,47 +64,47 @@  discard block
 block discarded – undo
64 64
  */
65 65
 function geodir_cfi_text($html,$cf){
66 66
 
67
-    $html_var = $cf['htmlvar_name'];
68
-
69
-    // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
-        /**
72
-         * Filter the text html by individual custom field.
73
-         *
74
-         * @param string $html The html to filter.
75
-         * @param array $cf The custom field array.
76
-         * @since 1.6.6
77
-         */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
-    }
80
-
81
-    // If no html then we run the standard output.
82
-    if(empty($html)) {
83
-
84
-        ob_start(); // Start  buffering;
85
-
86
-        $value = geodir_get_cf_value($cf);
87
-        $type = $cf['type'];
88
-        //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
-
92
-        //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
-            $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
96
-
97
-        // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
-            $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
101
-        ?>
67
+	$html_var = $cf['htmlvar_name'];
68
+
69
+	// Check if there is a custom field specific filter.
70
+	if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
+		/**
72
+		 * Filter the text html by individual custom field.
73
+		 *
74
+		 * @param string $html The html to filter.
75
+		 * @param array $cf The custom field array.
76
+		 * @since 1.6.6
77
+		 */
78
+		$html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
+	}
80
+
81
+	// If no html then we run the standard output.
82
+	if(empty($html)) {
83
+
84
+		ob_start(); // Start  buffering;
85
+
86
+		$value = geodir_get_cf_value($cf);
87
+		$type = $cf['type'];
88
+		//number and float validation $validation_pattern
89
+		if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
+		elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
+
92
+		//validation
93
+		if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
+			$validation = 'pattern="'.$cf['validation_pattern'].'"';
95
+		}else{$validation='';}
96
+
97
+		// validation message
98
+		if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
+			$validation_msg = 'title="'.$cf['validation_msg'].'"';
100
+		}else{$validation_msg='';}
101
+		?>
102 102
 
103 103
         <div id="<?php echo $cf['name'];?>_row"
104 104
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
107
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108 108
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
109 109
             </label>
110 110
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
         </div>
117 117
 
118 118
         <?php
119
-        $html = ob_get_clean();
120
-    }
119
+		$html = ob_get_clean();
120
+	}
121 121
 
122
-    return $html;
122
+	return $html;
123 123
 }
124 124
 add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
125 125
 
@@ -135,35 +135,35 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function geodir_cfi_email($html,$cf){
137 137
 
138
-    $html_var = $cf['htmlvar_name'];
138
+	$html_var = $cf['htmlvar_name'];
139 139
 
140
-    // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
-        /**
143
-         * Filter the email html by individual custom field.
144
-         *
145
-         * @param string $html The html to filter.
146
-         * @param array $cf The custom field array.
147
-         * @since 1.6.6
148
-         */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
-    }
140
+	// Check if there is a custom field specific filter.
141
+	if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
+		/**
143
+		 * Filter the email html by individual custom field.
144
+		 *
145
+		 * @param string $html The html to filter.
146
+		 * @param array $cf The custom field array.
147
+		 * @since 1.6.6
148
+		 */
149
+		$html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
+	}
151 151
 
152
-    // If no html then we run the standard output.
153
-    if(empty($html)) {
152
+	// If no html then we run the standard output.
153
+	if(empty($html)) {
154 154
 
155
-        ob_start(); // Start  buffering;
156
-        $value = geodir_get_cf_value($cf);
155
+		ob_start(); // Start  buffering;
156
+		$value = geodir_get_cf_value($cf);
157 157
 
158
-        if ($value == $cf['default']) {
159
-            $value = '';
160
-        }?>
158
+		if ($value == $cf['default']) {
159
+			$value = '';
160
+		}?>
161 161
 
162 162
         <div id="<?php echo $cf['name'];?>_row"
163 163
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
166
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167 167
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
168 168
             </label>
169 169
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         </div>
176 176
 
177 177
         <?php
178
-        $html = ob_get_clean();
179
-    }
178
+		$html = ob_get_clean();
179
+	}
180 180
 
181
-    return $html;
181
+	return $html;
182 182
 }
183 183
 add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
184 184
 
@@ -195,35 +195,35 @@  discard block
 block discarded – undo
195 195
  */
196 196
 function geodir_cfi_phone($html,$cf){
197 197
 
198
-    $html_var = $cf['htmlvar_name'];
198
+	$html_var = $cf['htmlvar_name'];
199 199
 
200
-    // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
-        /**
203
-         * Filter the phone html by individual custom field.
204
-         *
205
-         * @param string $html The html to filter.
206
-         * @param array $cf The custom field array.
207
-         * @since 1.6.6
208
-         */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
-    }
200
+	// Check if there is a custom field specific filter.
201
+	if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
+		/**
203
+		 * Filter the phone html by individual custom field.
204
+		 *
205
+		 * @param string $html The html to filter.
206
+		 * @param array $cf The custom field array.
207
+		 * @since 1.6.6
208
+		 */
209
+		$html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
+	}
211 211
 
212
-    // If no html then we run the standard output.
213
-    if(empty($html)) {
212
+	// If no html then we run the standard output.
213
+	if(empty($html)) {
214 214
 
215
-        ob_start(); // Start  buffering;
216
-        $value = geodir_get_cf_value($cf);
215
+		ob_start(); // Start  buffering;
216
+		$value = geodir_get_cf_value($cf);
217 217
 
218
-        if ($value == $cf['default']) {
219
-            $value = '';
220
-        }?>
218
+		if ($value == $cf['default']) {
219
+			$value = '';
220
+		}?>
221 221
 
222 222
         <div id="<?php echo $cf['name'];?>_row"
223 223
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
226
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227 227
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
228 228
             </label>
229 229
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
         </div>
236 236
 
237 237
         <?php
238
-        $html = ob_get_clean();
239
-    }
238
+		$html = ob_get_clean();
239
+	}
240 240
 
241
-    return $html;
241
+	return $html;
242 242
 }
243 243
 add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
244 244
 
@@ -255,35 +255,35 @@  discard block
 block discarded – undo
255 255
  */
256 256
 function geodir_cfi_url($html,$cf){
257 257
 
258
-    $html_var = $cf['htmlvar_name'];
258
+	$html_var = $cf['htmlvar_name'];
259 259
 
260
-    // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
-        /**
263
-         * Filter the url html by individual custom field.
264
-         *
265
-         * @param string $html The html to filter.
266
-         * @param array $cf The custom field array.
267
-         * @since 1.6.6
268
-         */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
-    }
260
+	// Check if there is a custom field specific filter.
261
+	if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
+		/**
263
+		 * Filter the url html by individual custom field.
264
+		 *
265
+		 * @param string $html The html to filter.
266
+		 * @param array $cf The custom field array.
267
+		 * @since 1.6.6
268
+		 */
269
+		$html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
+	}
271 271
 
272
-    // If no html then we run the standard output.
273
-    if(empty($html)) {
272
+	// If no html then we run the standard output.
273
+	if(empty($html)) {
274 274
 
275
-        ob_start(); // Start  buffering;
276
-        $value = geodir_get_cf_value($cf);
275
+		ob_start(); // Start  buffering;
276
+		$value = geodir_get_cf_value($cf);
277 277
 
278
-        if ($value == $cf['default']) {
279
-            $value = '';
280
-        }?>
278
+		if ($value == $cf['default']) {
279
+			$value = '';
280
+		}?>
281 281
 
282 282
         <div id="<?php echo $cf['name'];?>_row"
283 283
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
286
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287 287
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
288 288
             </label>
289 289
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
         </div>
299 299
 
300 300
         <?php
301
-        $html = ob_get_clean();
302
-    }
301
+		$html = ob_get_clean();
302
+	}
303 303
 
304
-    return $html;
304
+	return $html;
305 305
 }
306 306
 add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
307 307
 
@@ -317,48 +317,48 @@  discard block
 block discarded – undo
317 317
  */
318 318
 function geodir_cfi_radio($html,$cf){
319 319
 
320
-    $html_var = $cf['htmlvar_name'];
320
+	$html_var = $cf['htmlvar_name'];
321 321
 
322
-    // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
-        /**
325
-         * Filter the radio html by individual custom field.
326
-         *
327
-         * @param string $html The html to filter.
328
-         * @param array $cf The custom field array.
329
-         * @since 1.6.6
330
-         */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
-    }
322
+	// Check if there is a custom field specific filter.
323
+	if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
+		/**
325
+		 * Filter the radio html by individual custom field.
326
+		 *
327
+		 * @param string $html The html to filter.
328
+		 * @param array $cf The custom field array.
329
+		 * @since 1.6.6
330
+		 */
331
+		$html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
+	}
333 333
 
334
-    // If no html then we run the standard output.
335
-    if(empty($html)) {
334
+	// If no html then we run the standard output.
335
+	if(empty($html)) {
336 336
 
337
-        ob_start(); // Start  buffering;
338
-        $value = geodir_get_cf_value($cf);
337
+		ob_start(); // Start  buffering;
338
+		$value = geodir_get_cf_value($cf);
339 339
 
340
-        ?>
340
+		?>
341 341
         <div id="<?php echo $cf['name'];?>_row"
342 342
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
345
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346 346
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349
-                $option_values = geodir_string_values_to_options($cf['option_values'], true);
349
+				$option_values = geodir_string_values_to_options($cf['option_values'], true);
350 350
 
351
-                if (!empty($option_values)) {
352
-                    foreach ($option_values as $option_value) {
353
-                        if (empty($option_value['optgroup'])) {
354
-                            ?>
351
+				if (!empty($option_values)) {
352
+					foreach ($option_values as $option_value) {
353
+						if (empty($option_value['optgroup'])) {
354
+							?>
355 355
                             <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357
-                        }
358
-                    }
359
-                }
360
-            }
361
-            ?>
357
+						}
358
+					}
359
+				}
360
+			}
361
+			?>
362 362
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
         </div>
367 367
 
368 368
         <?php
369
-        $html = ob_get_clean();
370
-    }
369
+		$html = ob_get_clean();
370
+	}
371 371
 
372
-    return $html;
372
+	return $html;
373 373
 }
374 374
 add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
375 375
 
@@ -385,46 +385,46 @@  discard block
 block discarded – undo
385 385
  */
386 386
 function geodir_cfi_checkbox($html,$cf){
387 387
 
388
-    $html_var = $cf['htmlvar_name'];
388
+	$html_var = $cf['htmlvar_name'];
389 389
 
390
-    // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
-        /**
393
-         * Filter the checkbox html by individual custom field.
394
-         *
395
-         * @param string $html The html to filter.
396
-         * @param array $cf The custom field array.
397
-         * @since 1.6.6
398
-         */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
-    }
390
+	// Check if there is a custom field specific filter.
391
+	if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
+		/**
393
+		 * Filter the checkbox html by individual custom field.
394
+		 *
395
+		 * @param string $html The html to filter.
396
+		 * @param array $cf The custom field array.
397
+		 * @since 1.6.6
398
+		 */
399
+		$html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
+	}
401 401
 
402
-    // If no html then we run the standard output.
403
-    if(empty($html)) {
402
+	// If no html then we run the standard output.
403
+	if(empty($html)) {
404 404
 
405
-        ob_start(); // Start  buffering;
406
-        $value = geodir_get_cf_value($cf);
405
+		ob_start(); // Start  buffering;
406
+		$value = geodir_get_cf_value($cf);
407 407
 
408 408
 
409
-        if ($value == '' && $cf['default']) {
410
-            $value = '1';
411
-        }
412
-        ?>
409
+		if ($value == '' && $cf['default']) {
410
+			$value = '1';
411
+		}
412
+		?>
413 413
 
414 414
         <div id="<?php echo $cf['name'];?>_row"
415 415
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
416 416
             <label>
417 417
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
418
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
418
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
419 419
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
420 420
             </label>
421 421
             <?php if ($value != '1') {
422
-                $value = '0';
423
-            }?>
422
+				$value = '0';
423
+			}?>
424 424
             <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
425 425
             <input  <?php if ($value == '1') {
426
-                echo 'checked="checked"';
427
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
+				echo 'checked="checked"';
427
+			}?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
428 428
                  onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
429 429
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
430 430
             <?php if ($cf['is_required']) { ?>
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
         </div>
434 434
 
435 435
         <?php
436
-        $html = ob_get_clean();
437
-    }
436
+		$html = ob_get_clean();
437
+	}
438 438
 
439
-    return $html;
439
+	return $html;
440 440
 }
441 441
 add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
442 442
 
@@ -452,52 +452,52 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_cfi_textarea($html,$cf){
454 454
 
455
-    $html_var = $cf['htmlvar_name'];
455
+	$html_var = $cf['htmlvar_name'];
456 456
 
457
-    // Check if there is a custom field specific filter.
458
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
459
-        /**
460
-         * Filter the textarea html by individual custom field.
461
-         *
462
-         * @param string $html The html to filter.
463
-         * @param array $cf The custom field array.
464
-         * @since 1.6.6
465
-         */
466
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
467
-    }
457
+	// Check if there is a custom field specific filter.
458
+	if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
459
+		/**
460
+		 * Filter the textarea html by individual custom field.
461
+		 *
462
+		 * @param string $html The html to filter.
463
+		 * @param array $cf The custom field array.
464
+		 * @since 1.6.6
465
+		 */
466
+		$html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
467
+	}
468 468
 
469
-    // If no html then we run the standard output.
470
-    if(empty($html)) {
469
+	// If no html then we run the standard output.
470
+	if(empty($html)) {
471 471
 
472
-        ob_start(); // Start  buffering;
473
-        $value = geodir_get_cf_value($cf);
472
+		ob_start(); // Start  buffering;
473
+		$value = geodir_get_cf_value($cf);
474 474
 
475
-        $extra_fields = unserialize($cf['extra_fields']);
476
-        ?>
475
+		$extra_fields = unserialize($cf['extra_fields']);
476
+		?>
477 477
 
478 478
         <div id="<?php echo $cf['name'];?>_row"
479 479
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
480 480
             <label>
481 481
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
482
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
482
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
483 483
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
484 484
             </label><?php
485 485
 
486 486
 
487
-            if (is_array($extra_fields) && in_array('1', $extra_fields)) {
487
+			if (is_array($extra_fields) && in_array('1', $extra_fields)) {
488 488
 
489
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
489
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
490 490
 
491 491
             <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
492 492
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
493 493
                 </div><?php
494 494
 
495
-            } else {
495
+			} else {
496 496
 
497
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
497
+				?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
498 498
                             id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
499 499
 
500
-            }?>
500
+			}?>
501 501
 
502 502
 
503 503
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
         </div>
508 508
 
509 509
         <?php
510
-        $html = ob_get_clean();
511
-    }
510
+		$html = ob_get_clean();
511
+	}
512 512
 
513
-    return $html;
513
+	return $html;
514 514
 }
515 515
 add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
516 516
 
@@ -526,53 +526,53 @@  discard block
 block discarded – undo
526 526
  */
527 527
 function geodir_cfi_select($html,$cf){
528 528
 
529
-    $html_var = $cf['htmlvar_name'];
529
+	$html_var = $cf['htmlvar_name'];
530 530
 
531
-    // Check if there is a custom field specific filter.
532
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
533
-        /**
534
-         * Filter the select html by individual custom field.
535
-         *
536
-         * @param string $html The html to filter.
537
-         * @param array $cf The custom field array.
538
-         * @since 1.6.6
539
-         */
540
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
541
-    }
531
+	// Check if there is a custom field specific filter.
532
+	if(has_filter("geodir_custom_field_input_select_{$html_var}")){
533
+		/**
534
+		 * Filter the select html by individual custom field.
535
+		 *
536
+		 * @param string $html The html to filter.
537
+		 * @param array $cf The custom field array.
538
+		 * @since 1.6.6
539
+		 */
540
+		$html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
541
+	}
542 542
 
543
-    // If no html then we run the standard output.
544
-    if(empty($html)) {
543
+	// If no html then we run the standard output.
544
+	if(empty($html)) {
545 545
 
546
-        ob_start(); // Start  buffering;
547
-        $value = geodir_get_cf_value($cf);
546
+		ob_start(); // Start  buffering;
547
+		$value = geodir_get_cf_value($cf);
548 548
 
549
-        ?>
549
+		?>
550 550
         <div id="<?php echo $cf['name'];?>_row"
551 551
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
552 552
             <label>
553 553
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
554
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
554
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
555 555
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
556 556
             </label>
557 557
             <?php
558
-            $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
559
-            $select_options = '';
560
-            if (!empty($option_values_arr)) {
561
-                foreach ($option_values_arr as $option_row) {
562
-                    if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
564
-
565
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
566
-                    } else {
567
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
568
-                        $option_value = isset($option_row['value']) ? $option_row['value'] : '';
569
-                        $selected = $option_value == $value ? 'selected="selected"' : '';
570
-
571
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
572
-                    }
573
-                }
574
-            }
575
-            ?>
558
+			$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
559
+			$select_options = '';
560
+			if (!empty($option_values_arr)) {
561
+				foreach ($option_values_arr as $option_row) {
562
+					if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
564
+
565
+						$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
566
+					} else {
567
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
568
+						$option_value = isset($option_row['value']) ? $option_row['value'] : '';
569
+						$selected = $option_value == $value ? 'selected="selected"' : '';
570
+
571
+						$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
572
+					}
573
+				}
574
+			}
575
+			?>
576 576
             <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
577 577
                     class="geodir_textfield textfield_x chosen_select"
578 578
                     data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
         </div>
585 585
 
586 586
         <?php
587
-        $html = ob_get_clean();
588
-    }
587
+		$html = ob_get_clean();
588
+	}
589 589
 
590
-    return $html;
590
+	return $html;
591 591
 }
592 592
 add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
593 593
 
@@ -603,36 +603,36 @@  discard block
 block discarded – undo
603 603
  */
604 604
 function geodir_cfi_multiselect($html,$cf){
605 605
 
606
-    $html_var = $cf['htmlvar_name'];
607
-
608
-    // Check if there is a custom field specific filter.
609
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
610
-        /**
611
-         * Filter the multiselect html by individual custom field.
612
-         *
613
-         * @param string $html The html to filter.
614
-         * @param array $cf The custom field array.
615
-         * @since 1.6.6
616
-         */
617
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
618
-    }
619
-
620
-    // If no html then we run the standard output.
621
-    if(empty($html)) {
622
-
623
-        ob_start(); // Start  buffering;
624
-        $value = geodir_get_cf_value($cf);
625
-
626
-        $multi_display = 'select';
627
-        if (!empty($cf['extra_fields'])) {
628
-            $multi_display = unserialize($cf['extra_fields']);
629
-        }
630
-        ?>
606
+	$html_var = $cf['htmlvar_name'];
607
+
608
+	// Check if there is a custom field specific filter.
609
+	if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
610
+		/**
611
+		 * Filter the multiselect html by individual custom field.
612
+		 *
613
+		 * @param string $html The html to filter.
614
+		 * @param array $cf The custom field array.
615
+		 * @since 1.6.6
616
+		 */
617
+		$html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
618
+	}
619
+
620
+	// If no html then we run the standard output.
621
+	if(empty($html)) {
622
+
623
+		ob_start(); // Start  buffering;
624
+		$value = geodir_get_cf_value($cf);
625
+
626
+		$multi_display = 'select';
627
+		if (!empty($cf['extra_fields'])) {
628
+			$multi_display = unserialize($cf['extra_fields']);
629
+		}
630
+		?>
631 631
         <div id="<?php echo $cf['name']; ?>_row"
632 632
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
633 633
             <label>
634 634
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
635
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
635
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
636 636
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
637 637
             </label>
638 638
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
@@ -643,61 +643,61 @@  discard block
 block discarded – undo
643 643
                         data-placeholder="<?php _e('Select', 'geodirectory'); ?>"
644 644
                         option-ajaxchosen="false">
645 645
                     <?php
646
-                    } else {
647
-                        echo '<ul class="gd_multi_choice">';
648
-                    }
649
-
650
-                    $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
651
-                    $select_options = '';
652
-                    if (!empty($option_values_arr)) {
653
-                        foreach ($option_values_arr as $option_row) {
654
-                            if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
655
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
656
-
657
-                                if ($multi_display == 'select') {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
659
-                                } else {
660
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
661
-                                }
662
-                            } else {
663
-                                if (!is_array($value) && $value != '') {
664
-                                    $value = trim($value);
665
-                                }
646
+					} else {
647
+						echo '<ul class="gd_multi_choice">';
648
+					}
649
+
650
+					$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
651
+					$select_options = '';
652
+					if (!empty($option_values_arr)) {
653
+						foreach ($option_values_arr as $option_row) {
654
+							if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
655
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
656
+
657
+								if ($multi_display == 'select') {
658
+									$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
659
+								} else {
660
+									$select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
661
+								}
662
+							} else {
663
+								if (!is_array($value) && $value != '') {
664
+									$value = trim($value);
665
+								}
666 666
                                 
667
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
668
-                                $option_value = isset($option_row['value']) ? $option_row['value'] : '';
669
-                                $selected = $option_value == $value ? 'selected="selected"' : '';
670
-                                $selected = '';
671
-                                $checked = '';
672
-
673
-                                if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
674
-                                    if (!is_array($value)) {
675
-                                        $value_array = explode(',', $value);
676
-                                    } else {
677
-                                        $value_array = $value;
678
-                                    }
679
-
680
-                                    if (is_array($value_array)) {
681
-                                        $value_array = array_map('trim', $value_array);
667
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
668
+								$option_value = isset($option_row['value']) ? $option_row['value'] : '';
669
+								$selected = $option_value == $value ? 'selected="selected"' : '';
670
+								$selected = '';
671
+								$checked = '';
672
+
673
+								if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
674
+									if (!is_array($value)) {
675
+										$value_array = explode(',', $value);
676
+									} else {
677
+										$value_array = $value;
678
+									}
679
+
680
+									if (is_array($value_array)) {
681
+										$value_array = array_map('trim', $value_array);
682 682
                                         
683
-                                        if (in_array($option_value, $value_array)) {
684
-                                            $selected = 'selected="selected"';
685
-                                            $checked = 'checked="checked"';
686
-                                        }
687
-                                    }
688
-                                }
689
-
690
-                                if ($multi_display == 'select') {
691
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
692
-                                } else {
693
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
694
-                                }
695
-                            }
696
-                        }
697
-                    }
698
-                    echo $select_options;
699
-
700
-                    if ($multi_display == 'select') { ?></select></div>
683
+										if (in_array($option_value, $value_array)) {
684
+											$selected = 'selected="selected"';
685
+											$checked = 'checked="checked"';
686
+										}
687
+									}
688
+								}
689
+
690
+								if ($multi_display == 'select') {
691
+									$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
692
+								} else {
693
+									$select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
694
+								}
695
+							}
696
+						}
697
+					}
698
+					echo $select_options;
699
+
700
+					if ($multi_display == 'select') { ?></select></div>
701 701
         <?php } else { ?></ul><?php } ?>
702 702
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
703 703
             <?php if ($cf['is_required']) { ?>
@@ -705,10 +705,10 @@  discard block
 block discarded – undo
705 705
             <?php } ?>
706 706
         </div>
707 707
         <?php
708
-        $html = ob_get_clean();
709
-    }
708
+		$html = ob_get_clean();
709
+	}
710 710
 
711
-    return $html;
711
+	return $html;
712 712
 }
713 713
 add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
714 714
 
@@ -724,32 +724,32 @@  discard block
 block discarded – undo
724 724
  */
725 725
 function geodir_cfi_html($html,$cf){
726 726
 
727
-    $html_var = $cf['htmlvar_name'];
727
+	$html_var = $cf['htmlvar_name'];
728 728
 
729
-    // Check if there is a custom field specific filter.
730
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
731
-        /**
732
-         * Filter the html html by individual custom field.
733
-         *
734
-         * @param string $html The html to filter.
735
-         * @param array $cf The custom field array.
736
-         * @since 1.6.6
737
-         */
738
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
739
-    }
729
+	// Check if there is a custom field specific filter.
730
+	if(has_filter("geodir_custom_field_input_html_{$html_var}")){
731
+		/**
732
+		 * Filter the html html by individual custom field.
733
+		 *
734
+		 * @param string $html The html to filter.
735
+		 * @param array $cf The custom field array.
736
+		 * @since 1.6.6
737
+		 */
738
+		$html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
739
+	}
740 740
 
741
-    // If no html then we run the standard output.
742
-    if(empty($html)) {
741
+	// If no html then we run the standard output.
742
+	if(empty($html)) {
743 743
 
744
-        ob_start(); // Start  buffering;
745
-        $value = geodir_get_cf_value($cf);
746
-        ?>
744
+		ob_start(); // Start  buffering;
745
+		$value = geodir_get_cf_value($cf);
746
+		?>
747 747
 
748 748
         <div id="<?php echo $cf['name']; ?>_row"
749 749
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
750 750
             <label>
751 751
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
752
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
752
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
753 753
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
754 754
             </label>
755 755
 
@@ -767,10 +767,10 @@  discard block
 block discarded – undo
767 767
         </div>
768 768
 
769 769
         <?php
770
-        $html = ob_get_clean();
771
-    }
770
+		$html = ob_get_clean();
771
+	}
772 772
 
773
-    return $html;
773
+	return $html;
774 774
 }
775 775
 add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
776 776
 
@@ -787,68 +787,68 @@  discard block
 block discarded – undo
787 787
  */
788 788
 function geodir_cfi_datepicker($html,$cf){
789 789
 
790
-    $html_var = $cf['htmlvar_name'];
790
+	$html_var = $cf['htmlvar_name'];
791 791
 
792
-    // Check if there is a custom field specific filter.
793
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
794
-        /**
795
-         * Filter the datepicker html by individual custom field.
796
-         *
797
-         * @param string $html The html to filter.
798
-         * @param array $cf The custom field array.
799
-         * @since 1.6.6
800
-         */
801
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
802
-    }
792
+	// Check if there is a custom field specific filter.
793
+	if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
794
+		/**
795
+		 * Filter the datepicker html by individual custom field.
796
+		 *
797
+		 * @param string $html The html to filter.
798
+		 * @param array $cf The custom field array.
799
+		 * @since 1.6.6
800
+		 */
801
+		$html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
802
+	}
803 803
 
804
-    // If no html then we run the standard output.
805
-    if(empty($html)) {
804
+	// If no html then we run the standard output.
805
+	if(empty($html)) {
806 806
 
807
-        ob_start(); // Start  buffering;
808
-        $value = geodir_get_cf_value($cf);
807
+		ob_start(); // Start  buffering;
808
+		$value = geodir_get_cf_value($cf);
809 809
 
810
-        $extra_fields = unserialize($cf['extra_fields']);
811
-        $name = $cf['name'];
810
+		$extra_fields = unserialize($cf['extra_fields']);
811
+		$name = $cf['name'];
812 812
 
813
-        if ($extra_fields['date_format'] == '')
814
-            $extra_fields['date_format'] = 'yy-mm-dd';
813
+		if ($extra_fields['date_format'] == '')
814
+			$extra_fields['date_format'] = 'yy-mm-dd';
815 815
 
816
-        $date_format = $extra_fields['date_format'];
817
-        $jquery_date_format  = $date_format;
816
+		$date_format = $extra_fields['date_format'];
817
+		$jquery_date_format  = $date_format;
818 818
 
819 819
 
820
-        // check if we need to change the format or not
821
-        $date_format_len = strlen(str_replace(' ', '', $date_format));
822
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
820
+		// check if we need to change the format or not
821
+		$date_format_len = strlen(str_replace(' ', '', $date_format));
822
+		if($date_format_len>5){// if greater then 5 then it's the old style format.
823 823
 
824
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
825
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
824
+			$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
825
+			$replace = array('d','j','l','m','n','F','Y');//PHP date format
826 826
 
827
-            $date_format = str_replace($search, $replace, $date_format);
828
-        }else{
829
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
830
-        }
827
+			$date_format = str_replace($search, $replace, $date_format);
828
+		}else{
829
+			$jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
830
+		}
831 831
 
832
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
833
-        if($value && !isset($_REQUEST['backandedit'])) {
834
-            //$time = strtotime($value);
835
-            //$value = date_i18n($date_format, $time);
836
-        }
837
-        $value = geodir_date($value, 'Y-m-d', $date_format);
832
+		if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
833
+		if($value && !isset($_REQUEST['backandedit'])) {
834
+			//$time = strtotime($value);
835
+			//$value = date_i18n($date_format, $time);
836
+		}
837
+		$value = geodir_date($value, 'Y-m-d', $date_format);
838 838
 
839
-        ?>
839
+		?>
840 840
         <script type="text/javascript">
841 841
 
842 842
             jQuery(function () {
843 843
 
844 844
                 jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
845
-                    /**
846
-                     * Used to add extra option to datepicker per custom field.
847
-                     *
848
-                     * @since 1.5.7
849
-                     * @param string $name The custom field name.
850
-                     */
851
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
845
+					/**
846
+					 * Used to add extra option to datepicker per custom field.
847
+					 *
848
+					 * @since 1.5.7
849
+					 * @param string $name The custom field name.
850
+					 */
851
+					echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
852 852
 
853 853
                 jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
854 854
 
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
             <label>
865 865
 
866 866
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
867
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
867
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
868 868
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
869 869
             </label>
870 870
 
@@ -878,10 +878,10 @@  discard block
 block discarded – undo
878 878
         </div>
879 879
 
880 880
         <?php
881
-        $html = ob_get_clean();
882
-    }
881
+		$html = ob_get_clean();
882
+	}
883 883
 
884
-    return $html;
884
+	return $html;
885 885
 }
886 886
 add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
887 887
 
@@ -897,31 +897,31 @@  discard block
 block discarded – undo
897 897
  */
898 898
 function geodir_cfi_time($html,$cf){
899 899
 
900
-    $html_var = $cf['htmlvar_name'];
900
+	$html_var = $cf['htmlvar_name'];
901 901
 
902
-    // Check if there is a custom field specific filter.
903
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
904
-        /**
905
-         * Filter the time html by individual custom field.
906
-         *
907
-         * @param string $html The html to filter.
908
-         * @param array $cf The custom field array.
909
-         * @since 1.6.6
910
-         */
911
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
912
-    }
902
+	// Check if there is a custom field specific filter.
903
+	if(has_filter("geodir_custom_field_input_time_{$html_var}")){
904
+		/**
905
+		 * Filter the time html by individual custom field.
906
+		 *
907
+		 * @param string $html The html to filter.
908
+		 * @param array $cf The custom field array.
909
+		 * @since 1.6.6
910
+		 */
911
+		$html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
912
+	}
913 913
 
914
-    // If no html then we run the standard output.
915
-    if(empty($html)) {
914
+	// If no html then we run the standard output.
915
+	if(empty($html)) {
916 916
 
917
-        ob_start(); // Start  buffering;
918
-        $value = geodir_get_cf_value($cf);
917
+		ob_start(); // Start  buffering;
918
+		$value = geodir_get_cf_value($cf);
919 919
 
920
-        $name = $cf['name'];
920
+		$name = $cf['name'];
921 921
 
922
-        if ($value != '')
923
-            $value = date('H:i', strtotime($value));
924
-        ?>
922
+		if ($value != '')
923
+			$value = date('H:i', strtotime($value));
924
+		?>
925 925
         <script type="text/javascript">
926 926
             jQuery(document).ready(function () {
927 927
 
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             <label>
938 938
 
939 939
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
940
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
940
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
941 941
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
942 942
             </label>
943 943
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
@@ -949,10 +949,10 @@  discard block
 block discarded – undo
949 949
             <?php } ?>
950 950
         </div>
951 951
         <?php
952
-        $html = ob_get_clean();
953
-    }
952
+		$html = ob_get_clean();
953
+	}
954 954
 
955
-    return $html;
955
+	return $html;
956 956
 }
957 957
 add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
958 958
 
@@ -968,100 +968,100 @@  discard block
 block discarded – undo
968 968
  */
969 969
 function geodir_cfi_address($html,$cf){
970 970
 
971
-    $html_var = $cf['htmlvar_name'];
972
-
973
-    // Check if there is a custom field specific filter.
974
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
975
-        /**
976
-         * Filter the address html by individual custom field.
977
-         *
978
-         * @param string $html The html to filter.
979
-         * @param array $cf The custom field array.
980
-         * @since 1.6.6
981
-         */
982
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
983
-    }
984
-
985
-    // If no html then we run the standard output.
986
-    if(empty($html)) {
987
-
988
-        global $gd_session;
989
-        ob_start(); // Start  buffering;
990
-        $value = geodir_get_cf_value($cf);
991
-        $name = $cf['name'];
992
-        $type = $cf['type'];
993
-        $admin_desc = $cf['desc'];
994
-        $is_required = $cf['is_required'];
995
-        $required_msg = $cf['required_msg'];
996
-        $site_title = $cf['site_title'];
997
-        $is_admin = $cf['is_admin'];
998
-        $extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
999
-        $prefix = $name . '_';
1000
-
1001
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
1002
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
1003
-        ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
1004
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
1005
-
1006
-        $address = '';
1007
-        $zip = '';
1008
-        $mapview = '';
1009
-        $mapzoom = '';
1010
-        $lat = '';
1011
-        $lng = '';
1012
-
1013
-        if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1014
-            $post = $gd_ses_listing;
1015
-            $address = $post[$prefix . 'address'];
1016
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1017
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1018
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1019
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1020
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1021
-        } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1022
-            $post_info = (array)$post_info;
1023
-
1024
-            $address = $post_info[$prefix . 'address'];
1025
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1026
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1027
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1028
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1029
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1030
-        }
1031
-
1032
-        $location = geodir_get_default_location();
1033
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1034
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1035
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1036
-
1037
-        $lat_lng_blank = false;
1038
-        if (empty($lat) && empty($lng)) {
1039
-            $lat_lng_blank = true;
1040
-        }
1041
-
1042
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1043
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1044
-
1045
-        /**
1046
-         * Filter the default latitude.
1047
-         *
1048
-         * @since 1.0.0
1049
-         *
1050
-         * @param float $lat Default latitude.
1051
-         * @param bool $is_admin For admin use only?.
1052
-         */
1053
-        $lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1054
-        /**
1055
-         * Filter the default longitude.
1056
-         *
1057
-         * @since 1.0.0
1058
-         *
1059
-         * @param float $lat Default longitude.
1060
-         * @param bool $is_admin For admin use only?.
1061
-         */
1062
-        $lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1063
-
1064
-        ?>
971
+	$html_var = $cf['htmlvar_name'];
972
+
973
+	// Check if there is a custom field specific filter.
974
+	if(has_filter("geodir_custom_field_input_address_{$html_var}")){
975
+		/**
976
+		 * Filter the address html by individual custom field.
977
+		 *
978
+		 * @param string $html The html to filter.
979
+		 * @param array $cf The custom field array.
980
+		 * @since 1.6.6
981
+		 */
982
+		$html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
983
+	}
984
+
985
+	// If no html then we run the standard output.
986
+	if(empty($html)) {
987
+
988
+		global $gd_session;
989
+		ob_start(); // Start  buffering;
990
+		$value = geodir_get_cf_value($cf);
991
+		$name = $cf['name'];
992
+		$type = $cf['type'];
993
+		$admin_desc = $cf['desc'];
994
+		$is_required = $cf['is_required'];
995
+		$required_msg = $cf['required_msg'];
996
+		$site_title = $cf['site_title'];
997
+		$is_admin = $cf['is_admin'];
998
+		$extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
999
+		$prefix = $name . '_';
1000
+
1001
+		($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
1002
+		($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
1003
+		($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
1004
+		($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
1005
+
1006
+		$address = '';
1007
+		$zip = '';
1008
+		$mapview = '';
1009
+		$mapzoom = '';
1010
+		$lat = '';
1011
+		$lng = '';
1012
+
1013
+		if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1014
+			$post = $gd_ses_listing;
1015
+			$address = $post[$prefix . 'address'];
1016
+			$zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1017
+			$lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1018
+			$lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1019
+			$mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1020
+			$mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1021
+		} else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1022
+			$post_info = (array)$post_info;
1023
+
1024
+			$address = $post_info[$prefix . 'address'];
1025
+			$zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1026
+			$lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1027
+			$lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1028
+			$mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1029
+			$mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1030
+		}
1031
+
1032
+		$location = geodir_get_default_location();
1033
+		if (empty($city)) $city = isset($location->city) ? $location->city : '';
1034
+		if (empty($region)) $region = isset($location->region) ? $location->region : '';
1035
+		if (empty($country)) $country = isset($location->country) ? $location->country : '';
1036
+
1037
+		$lat_lng_blank = false;
1038
+		if (empty($lat) && empty($lng)) {
1039
+			$lat_lng_blank = true;
1040
+		}
1041
+
1042
+		if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1043
+		if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1044
+
1045
+		/**
1046
+		 * Filter the default latitude.
1047
+		 *
1048
+		 * @since 1.0.0
1049
+		 *
1050
+		 * @param float $lat Default latitude.
1051
+		 * @param bool $is_admin For admin use only?.
1052
+		 */
1053
+		$lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1054
+		/**
1055
+		 * Filter the default longitude.
1056
+		 *
1057
+		 * @since 1.0.0
1058
+		 *
1059
+		 * @param float $lat Default longitude.
1060
+		 * @param bool $is_admin For admin use only?.
1061
+		 */
1062
+		$lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1063
+
1064
+		?>
1065 1065
 
1066 1066
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1067 1067
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1080,17 +1080,17 @@  discard block
 block discarded – undo
1080 1080
 
1081 1081
 
1082 1082
         <?php
1083
-        /**
1084
-         * Called after the address input on the add listings.
1085
-         *
1086
-         * This is used by the location manage to add further locations info etc.
1087
-         *
1088
-         * @since 1.0.0
1089
-         * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1090
-         */
1091
-        do_action('geodir_address_extra_listing_fields', $cf);
1092
-
1093
-        if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1083
+		/**
1084
+		 * Called after the address input on the add listings.
1085
+		 *
1086
+		 * This is used by the location manage to add further locations info etc.
1087
+		 *
1088
+		 * @since 1.0.0
1089
+		 * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1090
+		 */
1091
+		do_action('geodir_address_extra_listing_fields', $cf);
1092
+
1093
+		if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1094 1094
 
1095 1095
             <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1096 1096
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
@@ -1111,22 +1111,22 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
             <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1113 1113
                 <?php
1114
-                /**
1115
-                 * Contains add listing page map functions.
1116
-                 *
1117
-                 * @since 1.0.0
1118
-                 */
1119
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1120
-                if ($lat_lng_blank) {
1121
-                    $lat = '';
1122
-                    $lng = '';
1123
-                }
1124
-                ?>
1114
+				/**
1115
+				 * Contains add listing page map functions.
1116
+				 *
1117
+				 * @since 1.0.0
1118
+				 */
1119
+				include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1120
+				if ($lat_lng_blank) {
1121
+					$lat = '';
1122
+					$lng = '';
1123
+				}
1124
+				?>
1125 1125
                 <span class="geodir_message_note"><?php echo stripslashes(GET_MAP_MSG); ?></span>
1126 1126
             </div>
1127 1127
             <?php
1128
-            /* show lat lng */
1129
-            $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1128
+			/* show lat lng */
1129
+			$style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1130 1130
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1131 1131
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1132 1132
                 <label>
@@ -1167,27 +1167,27 @@  discard block
 block discarded – undo
1167 1167
                                                             class="gd-checkbox"
1168 1168
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1169 1169
                                                             id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1170
-                            echo 'checked="checked"';
1171
-                        } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1170
+							echo 'checked="checked"';
1171
+						} ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1172 1172
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1173 1173
                                                              class="gd-checkbox"
1174 1174
                                                              name="<?php echo $prefix . 'mapview'; ?>"
1175 1175
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1176
-                            echo 'checked="checked"';
1177
-                        } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1176
+							echo 'checked="checked"';
1177
+						} ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1178 1178
 
1179 1179
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1180 1180
                                                             class="gd-checkbox"
1181 1181
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1182 1182
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1183
-                            echo 'checked="checked"';
1184
-                        } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1183
+							echo 'checked="checked"';
1184
+						} ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1185 1185
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1186 1186
                                                             class="gd-checkbox"
1187 1187
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1188 1188
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1189
-                            echo 'checked="checked"';
1190
-                        } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1189
+							echo 'checked="checked"';
1190
+						} ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1191 1191
 
1192 1192
 
1193 1193
             </div>
@@ -1195,14 +1195,14 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1197 1197
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1198
-                echo esc_attr($mapzoom);
1199
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1198
+				echo esc_attr($mapzoom);
1199
+			} ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1200 1200
         <?php }
1201 1201
 
1202
-        $html = ob_get_clean();
1203
-    }
1202
+		$html = ob_get_clean();
1203
+	}
1204 1204
 
1205
-    return $html;
1205
+	return $html;
1206 1206
 }
1207 1207
 add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1208 1208
 
@@ -1219,137 +1219,137 @@  discard block
 block discarded – undo
1219 1219
  */
1220 1220
 function geodir_cfi_taxonomy($html,$cf){
1221 1221
 
1222
-    $html_var = $cf['htmlvar_name'];
1223
-
1224
-    // Check if there is a custom field specific filter.
1225
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1226
-        /**
1227
-         * Filter the taxonomy html by individual custom field.
1228
-         *
1229
-         * @param string $html The html to filter.
1230
-         * @param array $cf The custom field array.
1231
-         * @since 1.6.6
1232
-         */
1233
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1234
-    }
1235
-
1236
-    // If no html then we run the standard output.
1237
-    if(empty($html)) {
1238
-
1239
-        ob_start(); // Start  buffering;
1240
-        $value = geodir_get_cf_value($cf);
1241
-
1242
-        $name = $cf['name'];
1243
-        $site_title = $cf['site_title'];
1244
-        $admin_desc = $cf['desc'];
1245
-        $is_required = $cf['is_required'];
1246
-        $is_admin = $cf['is_admin'];
1247
-        $required_msg = $cf['required_msg'];
1248
-
1249
-        if ($value == $cf['default']) {
1250
-            $value = '';
1251
-        } ?>
1222
+	$html_var = $cf['htmlvar_name'];
1223
+
1224
+	// Check if there is a custom field specific filter.
1225
+	if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1226
+		/**
1227
+		 * Filter the taxonomy html by individual custom field.
1228
+		 *
1229
+		 * @param string $html The html to filter.
1230
+		 * @param array $cf The custom field array.
1231
+		 * @since 1.6.6
1232
+		 */
1233
+		$html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1234
+	}
1235
+
1236
+	// If no html then we run the standard output.
1237
+	if(empty($html)) {
1238
+
1239
+		ob_start(); // Start  buffering;
1240
+		$value = geodir_get_cf_value($cf);
1241
+
1242
+		$name = $cf['name'];
1243
+		$site_title = $cf['site_title'];
1244
+		$admin_desc = $cf['desc'];
1245
+		$is_required = $cf['is_required'];
1246
+		$is_admin = $cf['is_admin'];
1247
+		$required_msg = $cf['required_msg'];
1248
+
1249
+		if ($value == $cf['default']) {
1250
+			$value = '';
1251
+		} ?>
1252 1252
         <div id="<?php echo $name;?>_row"
1253 1253
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1254 1254
             <label>
1255 1255
                 <?php $site_title = __($site_title, 'geodirectory');
1256
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1256
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1257 1257
                 <?php if ($is_required) echo '<span>*</span>';?>
1258 1258
             </label>
1259 1259
 
1260 1260
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1261 1261
                 <?php
1262
-                global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1262
+				global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1263 1263
 
1264
-                $exclude_cats = array();
1264
+				$exclude_cats = array();
1265 1265
 
1266
-                if ($is_admin == '1') {
1266
+				if ($is_admin == '1') {
1267 1267
 
1268
-                    $post_type = get_post_type();
1268
+					$post_type = get_post_type();
1269 1269
 
1270
-                    $package_info = array();
1270
+					$package_info = array();
1271 1271
 
1272
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1272
+					$package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1273 1273
 
1274
-                    if (!empty($package_info)) {
1274
+					if (!empty($package_info)) {
1275 1275
 
1276
-                        if (isset($package_info['cat']) && $package_info['cat'] != '') {
1276
+						if (isset($package_info['cat']) && $package_info['cat'] != '') {
1277 1277
 
1278
-                            $exclude_cats = explode(',', $package_info['cat']);
1278
+							$exclude_cats = explode(',', $package_info['cat']);
1279 1279
 
1280
-                        }
1281
-                    }
1282
-                }
1280
+						}
1281
+					}
1282
+				}
1283 1283
 
1284
-                $cat_display = unserialize($cf['extra_fields']);
1284
+				$cat_display = unserialize($cf['extra_fields']);
1285 1285
 
1286
-                if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1286
+				if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1287 1287
 
1288
-                    $post_cat = implode(",", $post_cat[$name]);
1288
+					$post_cat = implode(",", $post_cat[$name]);
1289 1289
 
1290
-                } else {
1291
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1292
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1293
-                }
1290
+				} else {
1291
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1292
+						$post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1293
+				}
1294 1294
 
1295 1295
 
1296
-                global $geodir_addon_list;
1297
-                if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1296
+				global $geodir_addon_list;
1297
+				if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1298 1298
 
1299
-                    $catadd_limit = $wpdb->get_var(
1300
-                        $wpdb->prepare(
1301
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1302
-                            array($package_id)
1303
-                        )
1304
-                    );
1299
+					$catadd_limit = $wpdb->get_var(
1300
+						$wpdb->prepare(
1301
+							"SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1302
+							array($package_id)
1303
+						)
1304
+					);
1305 1305
 
1306 1306
 
1307
-                } else {
1308
-                    $catadd_limit = 0;
1309
-                }
1307
+				} else {
1308
+					$catadd_limit = 0;
1309
+				}
1310 1310
 
1311 1311
 
1312
-                if ($cat_display != '' && $cat_display != 'ajax_chained') {
1312
+				if ($cat_display != '' && $cat_display != 'ajax_chained') {
1313 1313
 
1314
-                    $required_limit_msg = '';
1315
-                    if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1314
+					$required_limit_msg = '';
1315
+					if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1316 1316
 
1317
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1317
+						$required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1318 1318
 
1319
-                    } else {
1320
-                        $required_limit_msg = $required_msg;
1321
-                    }
1319
+					} else {
1320
+						$required_limit_msg = $required_msg;
1321
+					}
1322 1322
 
1323
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1323
+					echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1324 1324
 
1325 1325
 
1326
-                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1326
+					if ($cat_display == 'select' || $cat_display == 'multiselect') {
1327 1327
 
1328
-                        $cat_display == '';
1329
-                        $multiple = '';
1330
-                        if ($cat_display == 'multiselect')
1331
-                            $multiple = 'multiple="multiple"';
1328
+						$cat_display == '';
1329
+						$multiple = '';
1330
+						if ($cat_display == 'multiselect')
1331
+							$multiple = 'multiple="multiple"';
1332 1332
 
1333
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1333
+						echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1334 1334
 
1335 1335
 
1336
-                        if ($cat_display == 'select')
1337
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1336
+						if ($cat_display == 'select')
1337
+							echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1338 1338
 
1339
-                    }
1339
+					}
1340 1340
 
1341
-                    echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1341
+					echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1342 1342
 
1343
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1344
-                        echo '</select>';
1343
+					if ($cat_display == 'select' || $cat_display == 'multiselect')
1344
+						echo '</select>';
1345 1345
 
1346
-                } else {
1346
+				} else {
1347 1347
 
1348
-                    echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1348
+					echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1349 1349
 
1350
-                }
1350
+				}
1351 1351
 
1352
-                ?>
1352
+				?>
1353 1353
             </div>
1354 1354
 
1355 1355
             <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
@@ -1359,10 +1359,10 @@  discard block
 block discarded – undo
1359 1359
         </div>
1360 1360
 
1361 1361
         <?php
1362
-        $html = ob_get_clean();
1363
-    }
1362
+		$html = ob_get_clean();
1363
+	}
1364 1364
 
1365
-    return $html;
1365
+	return $html;
1366 1366
 }
1367 1367
 add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1368 1368
 
@@ -1378,74 +1378,74 @@  discard block
 block discarded – undo
1378 1378
  */
1379 1379
 function geodir_cfi_file($html,$cf){
1380 1380
 
1381
-    $html_var = $cf['htmlvar_name'];
1381
+	$html_var = $cf['htmlvar_name'];
1382 1382
 
1383
-    // Check if there is a custom field specific filter.
1384
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1385
-        /**
1386
-         * Filter the file html by individual custom field.
1387
-         *
1388
-         * @param string $html The html to filter.
1389
-         * @param array $cf The custom field array.
1390
-         * @since 1.6.6
1391
-         */
1392
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1393
-    }
1383
+	// Check if there is a custom field specific filter.
1384
+	if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1385
+		/**
1386
+		 * Filter the file html by individual custom field.
1387
+		 *
1388
+		 * @param string $html The html to filter.
1389
+		 * @param array $cf The custom field array.
1390
+		 * @since 1.6.6
1391
+		 */
1392
+		$html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1393
+	}
1394 1394
 
1395
-    // If no html then we run the standard output.
1396
-    if(empty($html)) {
1395
+	// If no html then we run the standard output.
1396
+	if(empty($html)) {
1397 1397
 
1398
-        ob_start(); // Start  buffering;
1399
-        $value = geodir_get_cf_value($cf);
1398
+		ob_start(); // Start  buffering;
1399
+		$value = geodir_get_cf_value($cf);
1400 1400
 
1401
-        $name = $cf['name'];
1402
-        $site_title = $cf['site_title'];
1403
-        $admin_desc = $cf['desc'];
1404
-        $is_required = $cf['is_required'];
1405
-        $required_msg = $cf['required_msg'];
1406
-        $extra_fields = unserialize($cf['extra_fields']);
1401
+		$name = $cf['name'];
1402
+		$site_title = $cf['site_title'];
1403
+		$admin_desc = $cf['desc'];
1404
+		$is_required = $cf['is_required'];
1405
+		$required_msg = $cf['required_msg'];
1406
+		$extra_fields = unserialize($cf['extra_fields']);
1407 1407
 
1408 1408
 
1409
-        // adjust values here
1410
-        $file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1409
+		// adjust values here
1410
+		$file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1411 1411
 
1412
-        if ($value != '') {
1412
+		if ($value != '') {
1413 1413
 
1414
-            $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1414
+			$file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1415 1415
 
1416
-        } else
1417
-            $file_value = '';
1416
+		} else
1417
+			$file_value = '';
1418 1418
 
1419
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1420
-            $file_multiple = true; // allow multiple files upload
1421
-        else
1422
-            $file_multiple = false;
1419
+		if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1420
+			$file_multiple = true; // allow multiple files upload
1421
+		else
1422
+			$file_multiple = false;
1423 1423
 
1424
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1425
-            $file_image_limit = $extra_fields['image_limit'];
1426
-        else
1427
-            $file_image_limit = 1;
1424
+		if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1425
+			$file_image_limit = $extra_fields['image_limit'];
1426
+		else
1427
+			$file_image_limit = 1;
1428 1428
 
1429
-        $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1429
+		$file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1430 1430
 
1431
-        $file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1431
+		$file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1432 1432
 
1433
-        if (!empty($file_value)) {
1434
-            $curImages = explode(',', $file_value);
1435
-            if (!empty($curImages))
1436
-                $file_totImg = count($curImages);
1437
-        }
1433
+		if (!empty($file_value)) {
1434
+			$curImages = explode(',', $file_value);
1435
+			if (!empty($curImages))
1436
+				$file_totImg = count($curImages);
1437
+		}
1438 1438
 
1439
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1440
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1439
+		$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1440
+		$display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1441 1441
 
1442
-        ?>
1442
+		?>
1443 1443
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
1444 1444
 				 <?php if($file_image_limit!=0 && $file_image_limit==1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('image with this package').')</small>';} ?>
1445 1445
 				 <?php if($file_image_limit!=0 && $file_image_limit>1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('images with this package').')</small>';} ?>
1446 1446
 				 <?php if($file_image_limit==0){echo '<br /><small>('.__('You can upload unlimited images with this package').')</small>';} ?>
1447 1447
 			</h5>   <?php */
1448
-        ?>
1448
+		?>
1449 1449
 
1450 1450
         <div id="<?php echo $name;?>_row"
1451 1451
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1454 1454
                 <label
1455 1455
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1456
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1456
+					echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1457 1457
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1458 1458
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1459 1459
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1465,17 +1465,17 @@  discard block
 block discarded – undo
1465 1465
                 <?php } ?>
1466 1466
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1467 1467
                        value="<?php if (isset($file_totImg)) {
1468
-                           echo esc_attr($file_totImg);
1469
-                       } else {
1470
-                           echo '0';
1471
-                       } ?>"/>
1468
+						   echo esc_attr($file_totImg);
1469
+					   } else {
1470
+						   echo '0';
1471
+					   } ?>"/>
1472 1472
 
1473 1473
                 <div style="float:left; width:55%;">
1474 1474
                     <div
1475 1475
                         class="plupload-upload-uic hide-if-no-js <?php if ($file_multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
1476 1476
                         id="<?php echo $file_id; ?>plupload-upload-ui" style="float:left; width:30%;">
1477 1477
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1478
-                        ?>
1478
+						?>
1479 1479
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1480 1480
                                value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1481 1481
                                class="geodir_button" style="margin-top:10px;"/>
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
                         style=" clear:inherit; margin-top:0; margin-left:15px; padding-top:10px; float:left; width:50%;">
1495 1495
                     </div>
1496 1496
                     <?php /*?><span id="upload-msg" ><?php _e('Please drag &amp; drop the images to rearrange the order');?></span><?php */
1497
-                    ?>
1497
+					?>
1498 1498
 
1499 1499
                     <span id="<?php echo $file_id; ?>upload-error" style="display:none"></span>
1500 1500
 
@@ -1508,9 +1508,9 @@  discard block
 block discarded – undo
1508 1508
 
1509 1509
 
1510 1510
         <?php
1511
-        $html = ob_get_clean();
1512
-    }
1511
+		$html = ob_get_clean();
1512
+	}
1513 1513
 
1514
-    return $html;
1514
+	return $html;
1515 1515
 }
1516 1516
 add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1517 1517
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42
-            gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __( $cf['site_title'], 'geodirectory' ); ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>';
42
+            gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __($cf['site_title'], 'geodirectory'); ?>
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.__($cf['desc'], 'geodirectory').' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -411,22 +411,22 @@  discard block
 block discarded – undo
411 411
         }
412 412
         ?>
413 413
 
414
-        <div id="<?php echo $cf['name'];?>_row"
415
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
414
+        <div id="<?php echo $cf['name']; ?>_row"
415
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
416 416
             <label>
417 417
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
418 418
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
419
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
419
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
420 420
             </label>
421 421
             <?php if ($value != '1') {
422 422
                 $value = '0';
423 423
             }?>
424
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
424
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
425 425
             <input  <?php if ($value == '1') {
426 426
                 echo 'checked="checked"';
427
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
428
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
429
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
427
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
428
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
429
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
430 430
             <?php if ($cf['is_required']) { ?>
431 431
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
432 432
             <?php } ?>
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
     return $html;
440 440
 }
441
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
441
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
442 442
 
443 443
 
444 444
 /**
@@ -450,12 +450,12 @@  discard block
 block discarded – undo
450 450
  *
451 451
  * @return string The html to output for the custom field.
452 452
  */
453
-function geodir_cfi_textarea($html,$cf){
453
+function geodir_cfi_textarea($html, $cf) {
454 454
 
455 455
     $html_var = $cf['htmlvar_name'];
456 456
 
457 457
     // Check if there is a custom field specific filter.
458
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
458
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
459 459
         /**
460 460
          * Filter the textarea html by individual custom field.
461 461
          *
@@ -463,11 +463,11 @@  discard block
 block discarded – undo
463 463
          * @param array $cf The custom field array.
464 464
          * @since 1.6.6
465 465
          */
466
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
466
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
467 467
     }
468 468
 
469 469
     // If no html then we run the standard output.
470
-    if(empty($html)) {
470
+    if (empty($html)) {
471 471
 
472 472
         ob_start(); // Start  buffering;
473 473
         $value = geodir_get_cf_value($cf);
@@ -475,32 +475,32 @@  discard block
 block discarded – undo
475 475
         $extra_fields = unserialize($cf['extra_fields']);
476 476
         ?>
477 477
 
478
-        <div id="<?php echo $cf['name'];?>_row"
479
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
478
+        <div id="<?php echo $cf['name']; ?>_row"
479
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
480 480
             <label>
481 481
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
482 482
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
483
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
483
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
484 484
             </label><?php
485 485
 
486 486
 
487 487
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
488 488
 
489
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
489
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
490 490
 
491
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
491
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
492 492
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
493 493
                 </div><?php
494 494
 
495 495
             } else {
496 496
 
497
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
498
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
497
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
498
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
499 499
 
500 500
             }?>
501 501
 
502 502
 
503
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
503
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
504 504
             <?php if ($cf['is_required']) { ?>
505 505
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
506 506
             <?php } ?>
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
     return $html;
514 514
 }
515
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
515
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
516 516
 
517 517
 
518 518
 /**
@@ -524,12 +524,12 @@  discard block
 block discarded – undo
524 524
  *
525 525
  * @return string The html to output for the custom field.
526 526
  */
527
-function geodir_cfi_select($html,$cf){
527
+function geodir_cfi_select($html, $cf) {
528 528
 
529 529
     $html_var = $cf['htmlvar_name'];
530 530
 
531 531
     // Check if there is a custom field specific filter.
532
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
532
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
533 533
         /**
534 534
          * Filter the select html by individual custom field.
535 535
          *
@@ -537,22 +537,22 @@  discard block
 block discarded – undo
537 537
          * @param array $cf The custom field array.
538 538
          * @since 1.6.6
539 539
          */
540
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
540
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
541 541
     }
542 542
 
543 543
     // If no html then we run the standard output.
544
-    if(empty($html)) {
544
+    if (empty($html)) {
545 545
 
546 546
         ob_start(); // Start  buffering;
547 547
         $value = geodir_get_cf_value($cf);
548 548
 
549 549
         ?>
550
-        <div id="<?php echo $cf['name'];?>_row"
551
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550
+        <div id="<?php echo $cf['name']; ?>_row"
551
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
552 552
             <label>
553 553
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
554 554
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
555
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
555
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
556 556
             </label>
557 557
             <?php
558 558
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -562,22 +562,22 @@  discard block
 block discarded – undo
562 562
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563 563
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
564 564
 
565
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
565
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
566 566
                     } else {
567 567
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
568 568
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
569 569
                         $selected = $option_value == $value ? 'selected="selected"' : '';
570 570
 
571
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
571
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
572 572
                     }
573 573
                 }
574 574
             }
575 575
             ?>
576
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
576
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
577 577
                     class="geodir_textfield textfield_x chosen_select"
578
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
579
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
580
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
578
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
579
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
580
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
581 581
             <?php if ($cf['is_required']) { ?>
582 582
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
583 583
             <?php } ?>
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 
590 590
     return $html;
591 591
 }
592
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
592
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
593 593
 
594 594
 
595 595
 /**
@@ -601,12 +601,12 @@  discard block
 block discarded – undo
601 601
  *
602 602
  * @return string The html to output for the custom field.
603 603
  */
604
-function geodir_cfi_multiselect($html,$cf){
604
+function geodir_cfi_multiselect($html, $cf) {
605 605
 
606 606
     $html_var = $cf['htmlvar_name'];
607 607
 
608 608
     // Check if there is a custom field specific filter.
609
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
609
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
610 610
         /**
611 611
          * Filter the multiselect html by individual custom field.
612 612
          *
@@ -614,11 +614,11 @@  discard block
 block discarded – undo
614 614
          * @param array $cf The custom field array.
615 615
          * @since 1.6.6
616 616
          */
617
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
617
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
618 618
     }
619 619
 
620 620
     // If no html then we run the standard output.
621
-    if(empty($html)) {
621
+    if (empty($html)) {
622 622
 
623 623
         ob_start(); // Start  buffering;
624 624
         $value = geodir_get_cf_value($cf);
@@ -655,9 +655,9 @@  discard block
 block discarded – undo
655 655
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
656 656
 
657 657
                                 if ($multi_display == 'select') {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
659 659
                                 } else {
660
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
660
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
661 661
                                 }
662 662
                             } else {
663 663
                                 if (!is_array($value) && $value != '') {
@@ -688,9 +688,9 @@  discard block
 block discarded – undo
688 688
                                 }
689 689
 
690 690
                                 if ($multi_display == 'select') {
691
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
691
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
692 692
                                 } else {
693
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
693
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
694 694
                                 }
695 695
                             }
696 696
                         }
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 
711 711
     return $html;
712 712
 }
713
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
713
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
714 714
 
715 715
 
716 716
 /**
@@ -722,12 +722,12 @@  discard block
 block discarded – undo
722 722
  *
723 723
  * @return string The html to output for the custom field.
724 724
  */
725
-function geodir_cfi_html($html,$cf){
725
+function geodir_cfi_html($html, $cf) {
726 726
 
727 727
     $html_var = $cf['htmlvar_name'];
728 728
 
729 729
     // Check if there is a custom field specific filter.
730
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
730
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
731 731
         /**
732 732
          * Filter the html html by individual custom field.
733 733
          *
@@ -735,11 +735,11 @@  discard block
 block discarded – undo
735 735
          * @param array $cf The custom field array.
736 736
          * @since 1.6.6
737 737
          */
738
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
738
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
739 739
     }
740 740
 
741 741
     // If no html then we run the standard output.
742
-    if(empty($html)) {
742
+    if (empty($html)) {
743 743
 
744 744
         ob_start(); // Start  buffering;
745 745
         $value = geodir_get_cf_value($cf);
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 
773 773
     return $html;
774 774
 }
775
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
775
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
776 776
 
777 777
 
778 778
 
@@ -785,12 +785,12 @@  discard block
 block discarded – undo
785 785
  *
786 786
  * @return string The html to output for the custom field.
787 787
  */
788
-function geodir_cfi_datepicker($html,$cf){
788
+function geodir_cfi_datepicker($html, $cf) {
789 789
 
790 790
     $html_var = $cf['htmlvar_name'];
791 791
 
792 792
     // Check if there is a custom field specific filter.
793
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
793
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
794 794
         /**
795 795
          * Filter the datepicker html by individual custom field.
796 796
          *
@@ -798,11 +798,11 @@  discard block
 block discarded – undo
798 798
          * @param array $cf The custom field array.
799 799
          * @since 1.6.6
800 800
          */
801
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
801
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
802 802
     }
803 803
 
804 804
     // If no html then we run the standard output.
805
-    if(empty($html)) {
805
+    if (empty($html)) {
806 806
 
807 807
         ob_start(); // Start  buffering;
808 808
         $value = geodir_get_cf_value($cf);
@@ -814,23 +814,23 @@  discard block
 block discarded – undo
814 814
             $extra_fields['date_format'] = 'yy-mm-dd';
815 815
 
816 816
         $date_format = $extra_fields['date_format'];
817
-        $jquery_date_format  = $date_format;
817
+        $jquery_date_format = $date_format;
818 818
 
819 819
 
820 820
         // check if we need to change the format or not
821 821
         $date_format_len = strlen(str_replace(' ', '', $date_format));
822
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
822
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
823 823
 
824
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
825
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
824
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
825
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
826 826
 
827 827
             $date_format = str_replace($search, $replace, $date_format);
828
-        }else{
829
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
828
+        } else {
829
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
830 830
         }
831 831
 
832
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
833
-        if($value && !isset($_REQUEST['backandedit'])) {
832
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
833
+        if ($value && !isset($_REQUEST['backandedit'])) {
834 834
             //$time = strtotime($value);
835 835
             //$value = date_i18n($date_format, $time);
836 836
         }
@@ -841,37 +841,37 @@  discard block
 block discarded – undo
841 841
 
842 842
             jQuery(function () {
843 843
 
844
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
844
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
845 845
                     /**
846 846
                      * Used to add extra option to datepicker per custom field.
847 847
                      *
848 848
                      * @since 1.5.7
849 849
                      * @param string $name The custom field name.
850 850
                      */
851
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
851
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
852 852
 
853
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
853
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
854 854
 
855
-                <?php if(!empty($value)){?>
856
-                jQuery("#<?php echo $name;?>").datepicker("setDate", '<?php echo $value;?>');
855
+                <?php if (!empty($value)) {?>
856
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", '<?php echo $value; ?>');
857 857
                 <?php } ?>
858 858
 
859 859
             });
860 860
 
861 861
         </script>
862
-        <div id="<?php echo $name;?>_row"
863
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
862
+        <div id="<?php echo $name; ?>_row"
863
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
864 864
             <label>
865 865
 
866 866
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
867 867
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
868
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
868
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
869 869
             </label>
870 870
 
871
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
872
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
871
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
872
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
873 873
 
874
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
874
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
875 875
             <?php if ($cf['is_required']) { ?>
876 876
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
877 877
             <?php } ?>
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
 
884 884
     return $html;
885 885
 }
886
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
886
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
887 887
 
888 888
 
889 889
 /**
@@ -895,12 +895,12 @@  discard block
 block discarded – undo
895 895
  *
896 896
  * @return string The html to output for the custom field.
897 897
  */
898
-function geodir_cfi_time($html,$cf){
898
+function geodir_cfi_time($html, $cf) {
899 899
 
900 900
     $html_var = $cf['htmlvar_name'];
901 901
 
902 902
     // Check if there is a custom field specific filter.
903
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
903
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
904 904
         /**
905 905
          * Filter the time html by individual custom field.
906 906
          *
@@ -908,11 +908,11 @@  discard block
 block discarded – undo
908 908
          * @param array $cf The custom field array.
909 909
          * @since 1.6.6
910 910
          */
911
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
911
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
912 912
     }
913 913
 
914 914
     // If no html then we run the standard output.
915
-    if(empty($html)) {
915
+    if (empty($html)) {
916 916
 
917 917
         ob_start(); // Start  buffering;
918 918
         $value = geodir_get_cf_value($cf);
@@ -925,25 +925,25 @@  discard block
 block discarded – undo
925 925
         <script type="text/javascript">
926 926
             jQuery(document).ready(function () {
927 927
 
928
-                jQuery('#<?php echo $name;?>').timepicker({
928
+                jQuery('#<?php echo $name; ?>').timepicker({
929 929
                     showPeriod: true,
930 930
                     showLeadingZero: true,
931 931
                     showPeriod: true,
932 932
                 });
933 933
             });
934 934
         </script>
935
-        <div id="<?php echo $name;?>_row"
936
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
935
+        <div id="<?php echo $name; ?>_row"
936
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
937 937
             <label>
938 938
 
939 939
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
940 940
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
941
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
941
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
942 942
             </label>
943
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
944
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
943
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
944
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
945 945
 
946
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
946
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
947 947
             <?php if ($cf['is_required']) { ?>
948 948
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
949 949
             <?php } ?>
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 
955 955
     return $html;
956 956
 }
957
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
957
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
958 958
 
959 959
 
960 960
 /**
@@ -966,12 +966,12 @@  discard block
 block discarded – undo
966 966
  *
967 967
  * @return string The html to output for the custom field.
968 968
  */
969
-function geodir_cfi_address($html,$cf){
969
+function geodir_cfi_address($html, $cf) {
970 970
 
971 971
     $html_var = $cf['htmlvar_name'];
972 972
 
973 973
     // Check if there is a custom field specific filter.
974
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
974
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
975 975
         /**
976 976
          * Filter the address html by individual custom field.
977 977
          *
@@ -979,11 +979,11 @@  discard block
 block discarded – undo
979 979
          * @param array $cf The custom field array.
980 980
          * @since 1.6.6
981 981
          */
982
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
982
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
983 983
     }
984 984
 
985 985
     // If no html then we run the standard output.
986
-    if(empty($html)) {
986
+    if (empty($html)) {
987 987
 
988 988
         global $gd_session;
989 989
         ob_start(); // Start  buffering;
@@ -996,12 +996,12 @@  discard block
 block discarded – undo
996 996
         $site_title = $cf['site_title'];
997 997
         $is_admin = $cf['is_admin'];
998 998
         $extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));
999
-        $prefix = $name . '_';
999
+        $prefix = $name.'_';
1000 1000
 
1001
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
1002
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
1001
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
1002
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
1003 1003
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
1004
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
1004
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
1005 1005
 
1006 1006
         $address = '';
1007 1007
         $zip = '';
@@ -1012,21 +1012,21 @@  discard block
 block discarded – undo
1012 1012
 
1013 1013
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1014 1014
             $post = $gd_ses_listing;
1015
-            $address = $post[$prefix . 'address'];
1016
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1017
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1018
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1019
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1020
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1015
+            $address = $post[$prefix.'address'];
1016
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1017
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1018
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1019
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1020
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1021 1021
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1022
-            $post_info = (array)$post_info;
1023
-
1024
-            $address = $post_info[$prefix . 'address'];
1025
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1026
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1027
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1028
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1029
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1022
+            $post_info = (array) $post_info;
1023
+
1024
+            $address = $post_info[$prefix.'address'];
1025
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1026
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1027
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1028
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1029
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1030 1030
         }
1031 1031
 
1032 1032
         $location = geodir_get_default_location();
@@ -1063,16 +1063,16 @@  discard block
 block discarded – undo
1063 1063
 
1064 1064
         ?>
1065 1065
 
1066
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1067
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1066
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1067
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1068 1068
             <label>
1069 1069
                 <?php _e($address_title, 'geodirectory'); ?>
1070
-                <?php if ($is_required) echo '<span>*</span>';?>
1070
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1071 1071
             </label>
1072
-            <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1073
-                   id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1072
+            <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1073
+                   id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1074 1074
                    value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1075
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1075
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1076 1076
             <?php if ($is_required) { ?>
1077 1077
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1078 1078
             <?php } ?>
@@ -1092,14 +1092,14 @@  discard block
 block discarded – undo
1092 1092
 
1093 1093
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1094 1094
 
1095
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1095
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1096 1096
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1097 1097
                 <label>
1098 1098
                     <?php _e($zip_title, 'geodirectory'); ?>
1099 1099
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1100 1100
                 </label>
1101
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1102
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1101
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1102
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1103 1103
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1104 1104
                 <?php /*if($is_required) {?>
1105 1105
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1109,14 +1109,14 @@  discard block
 block discarded – undo
1109 1109
 
1110 1110
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1111 1111
 
1112
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1112
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1113 1113
                 <?php
1114 1114
                 /**
1115 1115
                  * Contains add listing page map functions.
1116 1116
                  *
1117 1117
                  * @since 1.0.0
1118 1118
                  */
1119
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1119
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1120 1120
                 if ($lat_lng_blank) {
1121 1121
                     $lat = '';
1122 1122
                     $lng = '';
@@ -1127,14 +1127,14 @@  discard block
 block discarded – undo
1127 1127
             <?php
1128 1128
             /* show lat lng */
1129 1129
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1130
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1130
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1131 1131
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1132 1132
                 <label>
1133 1133
                     <?php echo PLACE_ADDRESS_LAT; ?>
1134 1134
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1135 1135
                 </label>
1136
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1137
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1136
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1137
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1138 1138
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1139 1139
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1140 1140
                 <?php if ($is_required) { ?>
@@ -1142,14 +1142,14 @@  discard block
 block discarded – undo
1142 1142
                 <?php } ?>
1143 1143
             </div>
1144 1144
 
1145
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1145
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1146 1146
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1147 1147
                 <label>
1148 1148
                     <?php echo PLACE_ADDRESS_LNG; ?>
1149 1149
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1150 1150
                 </label>
1151
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1152
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1151
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1152
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1153 1153
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1154 1154
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1155 1155
                 <?php if ($is_required) { ?>
@@ -1159,32 +1159,32 @@  discard block
 block discarded – undo
1159 1159
         <?php } ?>
1160 1160
 
1161 1161
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1162
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1162
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1163 1163
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1164 1164
 
1165 1165
 
1166 1166
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1167 1167
                                                             class="gd-checkbox"
1168
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1169
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1168
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1169
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1170 1170
                             echo 'checked="checked"';
1171 1171
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1172 1172
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1173 1173
                                                              class="gd-checkbox"
1174
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1174
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1175 1175
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1176 1176
                             echo 'checked="checked"';
1177 1177
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1178 1178
 
1179 1179
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1180 1180
                                                             class="gd-checkbox"
1181
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1181
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1182 1182
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1183 1183
                             echo 'checked="checked"';
1184 1184
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1185 1185
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1186 1186
                                                             class="gd-checkbox"
1187
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1187
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1188 1188
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1189 1189
                             echo 'checked="checked"';
1190 1190
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1197 1197
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1198 1198
                 echo esc_attr($mapzoom);
1199
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1199
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1200 1200
         <?php }
1201 1201
 
1202 1202
         $html = ob_get_clean();
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
 
1205 1205
     return $html;
1206 1206
 }
1207
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1207
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1208 1208
 
1209 1209
 
1210 1210
 
@@ -1217,12 +1217,12 @@  discard block
 block discarded – undo
1217 1217
  *
1218 1218
  * @return string The html to output for the custom field.
1219 1219
  */
1220
-function geodir_cfi_taxonomy($html,$cf){
1220
+function geodir_cfi_taxonomy($html, $cf) {
1221 1221
 
1222 1222
     $html_var = $cf['htmlvar_name'];
1223 1223
 
1224 1224
     // Check if there is a custom field specific filter.
1225
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1225
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1226 1226
         /**
1227 1227
          * Filter the taxonomy html by individual custom field.
1228 1228
          *
@@ -1230,11 +1230,11 @@  discard block
 block discarded – undo
1230 1230
          * @param array $cf The custom field array.
1231 1231
          * @since 1.6.6
1232 1232
          */
1233
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1233
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1234 1234
     }
1235 1235
 
1236 1236
     // If no html then we run the standard output.
1237
-    if(empty($html)) {
1237
+    if (empty($html)) {
1238 1238
 
1239 1239
         ob_start(); // Start  buffering;
1240 1240
         $value = geodir_get_cf_value($cf);
@@ -1249,15 +1249,15 @@  discard block
 block discarded – undo
1249 1249
         if ($value == $cf['default']) {
1250 1250
             $value = '';
1251 1251
         } ?>
1252
-        <div id="<?php echo $name;?>_row"
1253
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1252
+        <div id="<?php echo $name; ?>_row"
1253
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1254 1254
             <label>
1255 1255
                 <?php $site_title = __($site_title, 'geodirectory');
1256 1256
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1257
-                <?php if ($is_required) echo '<span>*</span>';?>
1257
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1258 1258
             </label>
1259 1259
 
1260
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1260
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1261 1261
                 <?php
1262 1262
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1263 1263
 
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 
1270 1270
                     $package_info = array();
1271 1271
 
1272
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1272
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1273 1273
 
1274 1274
                     if (!empty($package_info)) {
1275 1275
 
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
 
1299 1299
                     $catadd_limit = $wpdb->get_var(
1300 1300
                         $wpdb->prepare(
1301
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1301
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1302 1302
                             array($package_id)
1303 1303
                         )
1304 1304
                     );
@@ -1314,13 +1314,13 @@  discard block
 block discarded – undo
1314 1314
                     $required_limit_msg = '';
1315 1315
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1316 1316
 
1317
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1317
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1318 1318
 
1319 1319
                     } else {
1320 1320
                         $required_limit_msg = $required_msg;
1321 1321
                     }
1322 1322
 
1323
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1323
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1324 1324
 
1325 1325
 
1326 1326
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1330,11 +1330,11 @@  discard block
 block discarded – undo
1330 1330
                         if ($cat_display == 'multiselect')
1331 1331
                             $multiple = 'multiple="multiple"';
1332 1332
 
1333
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1333
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1334 1334
 
1335 1335
 
1336 1336
                         if ($cat_display == 'select')
1337
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1337
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1338 1338
 
1339 1339
                     }
1340 1340
 
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
                 ?>
1353 1353
             </div>
1354 1354
 
1355
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1355
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1356 1356
             <?php if ($is_required) { ?>
1357 1357
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1358 1358
             <?php } ?>
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 
1365 1365
     return $html;
1366 1366
 }
1367
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1367
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1368 1368
 
1369 1369
 
1370 1370
 /**
@@ -1376,12 +1376,12 @@  discard block
 block discarded – undo
1376 1376
  *
1377 1377
  * @return string The html to output for the custom field.
1378 1378
  */
1379
-function geodir_cfi_file($html,$cf){
1379
+function geodir_cfi_file($html, $cf) {
1380 1380
 
1381 1381
     $html_var = $cf['htmlvar_name'];
1382 1382
 
1383 1383
     // Check if there is a custom field specific filter.
1384
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1384
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1385 1385
         /**
1386 1386
          * Filter the file html by individual custom field.
1387 1387
          *
@@ -1389,11 +1389,11 @@  discard block
 block discarded – undo
1389 1389
          * @param array $cf The custom field array.
1390 1390
          * @since 1.6.6
1391 1391
          */
1392
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1392
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1393 1393
     }
1394 1394
 
1395 1395
     // If no html then we run the standard output.
1396
-    if(empty($html)) {
1396
+    if (empty($html)) {
1397 1397
 
1398 1398
         ob_start(); // Start  buffering;
1399 1399
         $value = geodir_get_cf_value($cf);
@@ -1436,8 +1436,8 @@  discard block
 block discarded – undo
1436 1436
                 $file_totImg = count($curImages);
1437 1437
         }
1438 1438
 
1439
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1440
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1439
+        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : '';
1440
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1441 1441
 
1442 1442
         ?>
1443 1443
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1447,13 +1447,13 @@  discard block
 block discarded – undo
1447 1447
 			</h5>   <?php */
1448 1448
         ?>
1449 1449
 
1450
-        <div id="<?php echo $name;?>_row"
1451
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1450
+        <div id="<?php echo $name; ?>_row"
1451
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1452 1452
 
1453 1453
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1454 1454
                 <label
1455 1455
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1456
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1456
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1457 1457
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1458 1458
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1459 1459
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1462 1462
                 <?php if ($allowed_file_types != '') { ?>
1463 1463
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1464
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1464
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1465 1465
                 <?php } ?>
1466 1466
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1467 1467
                        value="<?php if (isset($file_totImg)) {
@@ -1477,10 +1477,10 @@  discard block
 block discarded – undo
1477 1477
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1478 1478
                         ?>
1479 1479
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1480
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1480
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1481 1481
                                class="geodir_button" style="margin-top:10px;"/>
1482 1482
                             <span class="ajaxnonceplu"
1483
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1483
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1484 1484
                         <?php if ($file_width && $file_height): ?>
1485 1485
                             <span class="plupload-resize"></span>
1486 1486
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
 
1501 1501
                 </div>
1502 1502
             </div>
1503
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1503
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1504 1504
             <?php if ($is_required) { ?>
1505 1505
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1506 1506
             <?php } ?>
@@ -1513,4 +1513,4 @@  discard block
 block discarded – undo
1513 1513
 
1514 1514
     return $html;
1515 1515
 }
1516
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1517 1516
\ No newline at end of file
1517
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1518 1518
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +191 added lines, -68 removed lines patch added patch discarded remove patch
@@ -86,26 +86,31 @@  discard block
 block discarded – undo
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';} elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91 90
 
92 91
         //validation
93 92
         if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94 93
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
94
+        } else{$validation='';}
96 95
 
97 96
         // validation message
98 97
         if(isset($cf['validation_msg']) && $cf['validation_msg']){
99 98
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
99
+        } else{$validation_msg='';}
101 100
         ?>
102 101
 
103 102
         <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+             class="<?php if ($cf['is_required']) {
104
+	echo 'required_field';
105
+}
106
+?> geodir_form_row clearfix gd-fieldset-details">
105 107
             <label>
106 108
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 109
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
110
+                <?php if ($cf['is_required']) {
111
+	echo '<span>*</span>';
112
+}
113
+?>
109 114
             </label>
110 115
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111 116
                    value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
@@ -160,11 +165,17 @@  discard block
 block discarded – undo
160 165
         }?>
161 166
 
162 167
         <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
168
+             class="<?php if ($cf['is_required']) {
169
+	echo 'required_field';
170
+}
171
+?> geodir_form_row clearfix gd-fieldset-details">
164 172
             <label>
165 173
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 174
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
175
+                <?php if ($cf['is_required']) {
176
+	echo '<span>*</span>';
177
+}
178
+?>
168 179
             </label>
169 180
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170 181
                    value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
@@ -220,11 +231,17 @@  discard block
 block discarded – undo
220 231
         }?>
221 232
 
222 233
         <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
234
+             class="<?php if ($cf['is_required']) {
235
+	echo 'required_field';
236
+}
237
+?> geodir_form_row clearfix gd-fieldset-details">
224 238
             <label>
225 239
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 240
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
241
+                <?php if ($cf['is_required']) {
242
+	echo '<span>*</span>';
243
+}
244
+?>
228 245
             </label>
229 246
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230 247
                    value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
@@ -280,11 +297,17 @@  discard block
 block discarded – undo
280 297
         }?>
281 298
 
282 299
         <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
300
+             class="<?php if ($cf['is_required']) {
301
+	echo 'required_field';
302
+}
303
+?> geodir_form_row clearfix gd-fieldset-details">
284 304
             <label>
285 305
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 306
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
307
+                <?php if ($cf['is_required']) {
308
+	echo '<span>*</span>';
309
+}
310
+?>
288 311
             </label>
289 312
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290 313
                    value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
@@ -339,11 +362,17 @@  discard block
 block discarded – undo
339 362
 
340 363
         ?>
341 364
         <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
365
+             class="<?php if ($cf['is_required']) {
366
+	echo 'required_field';
367
+}
368
+?> geodir_form_row clearfix gd-fieldset-details">
343 369
             <label>
344 370
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 371
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
372
+                <?php if ($cf['is_required']) {
373
+	echo '<span>*</span>';
374
+}
375
+?>
347 376
             </label>
348 377
             <?php if ($cf['option_values']) {
349 378
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -412,11 +441,17 @@  discard block
 block discarded – undo
412 441
         ?>
413 442
 
414 443
         <div id="<?php echo $cf['name'];?>_row"
415
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
444
+             class="<?php if ($cf['is_required']) {
445
+	echo 'required_field';
446
+}
447
+?> geodir_form_row clearfix gd-fieldset-details">
416 448
             <label>
417 449
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
418 450
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
419
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
451
+                <?php if ($cf['is_required']) {
452
+	echo '<span>*</span>';
453
+}
454
+?>
420 455
             </label>
421 456
             <?php if ($value != '1') {
422 457
                 $value = '0';
@@ -476,11 +511,17 @@  discard block
 block discarded – undo
476 511
         ?>
477 512
 
478 513
         <div id="<?php echo $cf['name'];?>_row"
479
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
514
+             class="<?php if ($cf['is_required']) {
515
+	echo 'required_field';
516
+}
517
+?> geodir_form_row clearfix gd-fieldset-details">
480 518
             <label>
481 519
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
482 520
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
483
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
521
+                <?php if ($cf['is_required']) {
522
+	echo '<span>*</span>';
523
+}
524
+?>
484 525
             </label><?php
485 526
 
486 527
 
@@ -548,11 +589,17 @@  discard block
 block discarded – undo
548 589
 
549 590
         ?>
550 591
         <div id="<?php echo $cf['name'];?>_row"
551
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
592
+             class="<?php if ($cf['is_required']) {
593
+	echo 'required_field';
594
+}
595
+?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
552 596
             <label>
553 597
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
554 598
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
555
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
599
+                <?php if ($cf['is_required']) {
600
+	echo '<span>*</span>';
601
+}
602
+?>
556 603
             </label>
557 604
             <?php
558 605
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -629,11 +676,17 @@  discard block
 block discarded – undo
629 676
         }
630 677
         ?>
631 678
         <div id="<?php echo $cf['name']; ?>_row"
632
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
679
+             class="<?php if ($cf['is_required']) {
680
+	echo 'required_field';
681
+}
682
+?> geodir_form_row clearfix gd-fieldset-details">
633 683
             <label>
634 684
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
635 685
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
636
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
686
+                <?php if ($cf['is_required']) {
687
+	echo '<span>*</span>';
688
+}
689
+?>
637 690
             </label>
638 691
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
639 692
             <?php if ($multi_display == 'select') { ?>
@@ -746,11 +799,17 @@  discard block
 block discarded – undo
746 799
         ?>
747 800
 
748 801
         <div id="<?php echo $cf['name']; ?>_row"
749
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
802
+             class="<?php if ($cf['is_required']) {
803
+	echo 'required_field';
804
+}
805
+?> geodir_form_row clearfix gd-fieldset-details">
750 806
             <label>
751 807
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
752 808
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
753
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
809
+                <?php if ($cf['is_required']) {
810
+	echo '<span>*</span>';
811
+}
812
+?>
754 813
             </label>
755 814
 
756 815
             <?php $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
@@ -810,8 +869,9 @@  discard block
 block discarded – undo
810 869
         $extra_fields = unserialize($cf['extra_fields']);
811 870
         $name = $cf['name'];
812 871
 
813
-        if ($extra_fields['date_format'] == '')
814
-            $extra_fields['date_format'] = 'yy-mm-dd';
872
+        if ($extra_fields['date_format'] == '') {
873
+                    $extra_fields['date_format'] = 'yy-mm-dd';
874
+        }
815 875
 
816 876
         $date_format = $extra_fields['date_format'];
817 877
         $jquery_date_format  = $date_format;
@@ -825,7 +885,7 @@  discard block
 block discarded – undo
825 885
             $replace = array('d','j','l','m','n','F','Y');//PHP date format
826 886
 
827 887
             $date_format = str_replace($search, $replace, $date_format);
828
-        }else{
888
+        } else{
829 889
             $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
830 890
         }
831 891
 
@@ -860,12 +920,18 @@  discard block
 block discarded – undo
860 920
 
861 921
         </script>
862 922
         <div id="<?php echo $name;?>_row"
863
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
923
+             class="<?php if ($cf['is_required']) {
924
+	echo 'required_field';
925
+}
926
+?> geodir_form_row clearfix gd-fieldset-details">
864 927
             <label>
865 928
 
866 929
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
867 930
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
868
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
931
+                <?php if ($cf['is_required']) {
932
+	echo '<span>*</span>';
933
+}
934
+?>
869 935
             </label>
870 936
 
871 937
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
@@ -919,8 +985,9 @@  discard block
 block discarded – undo
919 985
 
920 986
         $name = $cf['name'];
921 987
 
922
-        if ($value != '')
923
-            $value = date('H:i', strtotime($value));
988
+        if ($value != '') {
989
+                    $value = date('H:i', strtotime($value));
990
+        }
924 991
         ?>
925 992
         <script type="text/javascript">
926 993
             jQuery(document).ready(function () {
@@ -933,12 +1000,18 @@  discard block
 block discarded – undo
933 1000
             });
934 1001
         </script>
935 1002
         <div id="<?php echo $name;?>_row"
936
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1003
+             class="<?php if ($cf['is_required']) {
1004
+	echo 'required_field';
1005
+}
1006
+?> geodir_form_row clearfix gd-fieldset-details">
937 1007
             <label>
938 1008
 
939 1009
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
940 1010
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
941
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
1011
+                <?php if ($cf['is_required']) {
1012
+	echo '<span>*</span>';
1013
+}
1014
+?>
942 1015
             </label>
943 1016
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
944 1017
                    id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
@@ -1030,17 +1103,27 @@  discard block
 block discarded – undo
1030 1103
         }
1031 1104
 
1032 1105
         $location = geodir_get_default_location();
1033
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1034
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1035
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1106
+        if (empty($city)) {
1107
+        	$city = isset($location->city) ? $location->city : '';
1108
+        }
1109
+        if (empty($region)) {
1110
+        	$region = isset($location->region) ? $location->region : '';
1111
+        }
1112
+        if (empty($country)) {
1113
+        	$country = isset($location->country) ? $location->country : '';
1114
+        }
1036 1115
 
1037 1116
         $lat_lng_blank = false;
1038 1117
         if (empty($lat) && empty($lng)) {
1039 1118
             $lat_lng_blank = true;
1040 1119
         }
1041 1120
 
1042
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1043
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1121
+        if (empty($lat)) {
1122
+        	$lat = isset($location->city_latitude) ? $location->city_latitude : '';
1123
+        }
1124
+        if (empty($lng)) {
1125
+        	$lng = isset($location->city_longitude) ? $location->city_longitude : '';
1126
+        }
1044 1127
 
1045 1128
         /**
1046 1129
          * Filter the default latitude.
@@ -1064,10 +1147,16 @@  discard block
 block discarded – undo
1064 1147
         ?>
1065 1148
 
1066 1149
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1067
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1150
+             class="<?php if ($is_required) {
1151
+	echo 'required_field';
1152
+}
1153
+?> geodir_form_row clearfix gd-fieldset-details">
1068 1154
             <label>
1069 1155
                 <?php _e($address_title, 'geodirectory'); ?>
1070
-                <?php if ($is_required) echo '<span>*</span>';?>
1156
+                <?php if ($is_required) {
1157
+	echo '<span>*</span>';
1158
+}
1159
+?>
1071 1160
             </label>
1072 1161
             <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1073 1162
                    id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
@@ -1128,10 +1217,16 @@  discard block
 block discarded – undo
1128 1217
             /* show lat lng */
1129 1218
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1130 1219
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1131
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1220
+                 class="<?php if ($is_required) {
1221
+	echo 'required_field';
1222
+}
1223
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1132 1224
                 <label>
1133 1225
                     <?php echo PLACE_ADDRESS_LAT; ?>
1134
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1226
+                    <?php if ($is_required) {
1227
+	echo '<span>*</span>';
1228
+}
1229
+?>
1135 1230
                 </label>
1136 1231
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1137 1232
                        id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
@@ -1143,10 +1238,16 @@  discard block
 block discarded – undo
1143 1238
             </div>
1144 1239
 
1145 1240
             <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1146
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1241
+                 class="<?php if ($is_required) {
1242
+	echo 'required_field';
1243
+}
1244
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1147 1245
                 <label>
1148 1246
                     <?php echo PLACE_ADDRESS_LNG; ?>
1149
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1247
+                    <?php if ($is_required) {
1248
+	echo '<span>*</span>';
1249
+}
1250
+?>
1150 1251
                 </label>
1151 1252
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1152 1253
                        id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
@@ -1250,11 +1351,17 @@  discard block
 block discarded – undo
1250 1351
             $value = '';
1251 1352
         } ?>
1252 1353
         <div id="<?php echo $name;?>_row"
1253
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1354
+             class="<?php if ($is_required) {
1355
+	echo 'required_field';
1356
+}
1357
+?> geodir_form_row clearfix gd-fieldset-details">
1254 1358
             <label>
1255 1359
                 <?php $site_title = __($site_title, 'geodirectory');
1256 1360
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1257
-                <?php if ($is_required) echo '<span>*</span>';?>
1361
+                <?php if ($is_required) {
1362
+	echo '<span>*</span>';
1363
+}
1364
+?>
1258 1365
             </label>
1259 1366
 
1260 1367
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
@@ -1288,8 +1395,9 @@  discard block
 block discarded – undo
1288 1395
                     $post_cat = implode(",", $post_cat[$name]);
1289 1396
 
1290 1397
                 } else {
1291
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1292
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1398
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1399
+                                            $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1400
+                    }
1293 1401
                 }
1294 1402
 
1295 1403
 
@@ -1327,21 +1435,24 @@  discard block
 block discarded – undo
1327 1435
 
1328 1436
                         $cat_display == '';
1329 1437
                         $multiple = '';
1330
-                        if ($cat_display == 'multiselect')
1331
-                            $multiple = 'multiple="multiple"';
1438
+                        if ($cat_display == 'multiselect') {
1439
+                                                    $multiple = 'multiple="multiple"';
1440
+                        }
1332 1441
 
1333 1442
                         echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1334 1443
 
1335 1444
 
1336
-                        if ($cat_display == 'select')
1337
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1445
+                        if ($cat_display == 'select') {
1446
+                                                    echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1447
+                        }
1338 1448
 
1339 1449
                     }
1340 1450
 
1341 1451
                     echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1342 1452
 
1343
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1344
-                        echo '</select>';
1453
+                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1454
+                                            echo '</select>';
1455
+                    }
1345 1456
 
1346 1457
                 } else {
1347 1458
 
@@ -1413,18 +1524,23 @@  discard block
 block discarded – undo
1413 1524
 
1414 1525
             $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1415 1526
 
1416
-        } else
1417
-            $file_value = '';
1527
+        } else {
1528
+                    $file_value = '';
1529
+        }
1418 1530
 
1419
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1420
-            $file_multiple = true; // allow multiple files upload
1421
-        else
1422
-            $file_multiple = false;
1531
+        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple']) {
1532
+                    $file_multiple = true;
1533
+        }
1534
+        // allow multiple files upload
1535
+        else {
1536
+                    $file_multiple = false;
1537
+        }
1423 1538
 
1424
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1425
-            $file_image_limit = $extra_fields['image_limit'];
1426
-        else
1427
-            $file_image_limit = 1;
1539
+        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit']) {
1540
+                    $file_image_limit = $extra_fields['image_limit'];
1541
+        } else {
1542
+                    $file_image_limit = 1;
1543
+        }
1428 1544
 
1429 1545
         $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1430 1546
 
@@ -1432,8 +1548,9 @@  discard block
 block discarded – undo
1432 1548
 
1433 1549
         if (!empty($file_value)) {
1434 1550
             $curImages = explode(',', $file_value);
1435
-            if (!empty($curImages))
1436
-                $file_totImg = count($curImages);
1551
+            if (!empty($curImages)) {
1552
+                            $file_totImg = count($curImages);
1553
+            }
1437 1554
         }
1438 1555
 
1439 1556
         $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
@@ -1448,12 +1565,18 @@  discard block
 block discarded – undo
1448 1565
         ?>
1449 1566
 
1450 1567
         <div id="<?php echo $name;?>_row"
1451
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1568
+             class="<?php if ($is_required) {
1569
+	echo 'required_field';
1570
+}
1571
+?> geodir_form_row clearfix gd-fieldset-details">
1452 1572
 
1453 1573
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1454 1574
                 <label
1455 1575
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1456
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1576
+                    echo $site_title; ?><?php if ($is_required) {
1577
+                    	echo '<span>*</span>';
1578
+                    }
1579
+                    ?></label>
1457 1580
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1458 1581
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1459 1582
                        value="<?php echo esc_attr($file_value); ?>"/>
Please login to merge, or discard this patch.