@@ -17,12 +17,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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(stripslashes($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(stripslashes($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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 |
||
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 |
||
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 : ' '; ?> |
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 |
||
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 == stripslashes($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 . '…';?>" |
|
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.'…'; ?>" |
|
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 |
||
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 |
||
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 |
||
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 |
||
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 != '') { |
@@ -690,9 +690,9 @@ discard block |
||
690 | 690 | } |
691 | 691 | |
692 | 692 | if ($multi_display == 'select') { |
693 | - $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
693 | + $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>'; |
|
694 | 694 | } else { |
695 | - $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" /> ' . $option_label . ' </li>'; |
|
695 | + $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" /> '.$option_label.' </li>'; |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | } |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | |
713 | 713 | return $html; |
714 | 714 | } |
715 | -add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2); |
|
715 | +add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2); |
|
716 | 716 | |
717 | 717 | |
718 | 718 | /** |
@@ -724,12 +724,12 @@ discard block |
||
724 | 724 | * |
725 | 725 | * @return string The html to output for the custom field. |
726 | 726 | */ |
727 | -function geodir_cfi_html($html,$cf){ |
|
727 | +function geodir_cfi_html($html, $cf) { |
|
728 | 728 | |
729 | 729 | $html_var = $cf['htmlvar_name']; |
730 | 730 | |
731 | 731 | // Check if there is a custom field specific filter. |
732 | - if(has_filter("geodir_custom_field_input_html_{$html_var}")){ |
|
732 | + if (has_filter("geodir_custom_field_input_html_{$html_var}")) { |
|
733 | 733 | /** |
734 | 734 | * Filter the html html by individual custom field. |
735 | 735 | * |
@@ -737,11 +737,11 @@ discard block |
||
737 | 737 | * @param array $cf The custom field array. |
738 | 738 | * @since 1.6.6 |
739 | 739 | */ |
740 | - $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf); |
|
740 | + $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf); |
|
741 | 741 | } |
742 | 742 | |
743 | 743 | // If no html then we run the standard output. |
744 | - if(empty($html)) { |
|
744 | + if (empty($html)) { |
|
745 | 745 | |
746 | 746 | ob_start(); // Start buffering; |
747 | 747 | $value = geodir_get_cf_value($cf); |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | |
775 | 775 | return $html; |
776 | 776 | } |
777 | -add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2); |
|
777 | +add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2); |
|
778 | 778 | |
779 | 779 | |
780 | 780 | |
@@ -787,12 +787,12 @@ discard block |
||
787 | 787 | * |
788 | 788 | * @return string The html to output for the custom field. |
789 | 789 | */ |
790 | -function geodir_cfi_datepicker($html,$cf){ |
|
790 | +function geodir_cfi_datepicker($html, $cf) { |
|
791 | 791 | |
792 | 792 | $html_var = $cf['htmlvar_name']; |
793 | 793 | |
794 | 794 | // Check if there is a custom field specific filter. |
795 | - if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){ |
|
795 | + if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) { |
|
796 | 796 | /** |
797 | 797 | * Filter the datepicker html by individual custom field. |
798 | 798 | * |
@@ -800,11 +800,11 @@ discard block |
||
800 | 800 | * @param array $cf The custom field array. |
801 | 801 | * @since 1.6.6 |
802 | 802 | */ |
803 | - $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf); |
|
803 | + $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | // If no html then we run the standard output. |
807 | - if(empty($html)) { |
|
807 | + if (empty($html)) { |
|
808 | 808 | |
809 | 809 | ob_start(); // Start buffering; |
810 | 810 | $value = geodir_get_cf_value($cf); |
@@ -816,23 +816,23 @@ discard block |
||
816 | 816 | $extra_fields['date_format'] = 'yy-mm-dd'; |
817 | 817 | |
818 | 818 | $date_format = $extra_fields['date_format']; |
819 | - $jquery_date_format = $date_format; |
|
819 | + $jquery_date_format = $date_format; |
|
820 | 820 | |
821 | 821 | |
822 | 822 | // check if we need to change the format or not |
823 | 823 | $date_format_len = strlen(str_replace(' ', '', $date_format)); |
824 | - if($date_format_len>5){// if greater then 5 then it's the old style format. |
|
824 | + if ($date_format_len > 5) {// if greater then 5 then it's the old style format. |
|
825 | 825 | |
826 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
827 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
826 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
827 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
828 | 828 | |
829 | 829 | $date_format = str_replace($search, $replace, $date_format); |
830 | - }else{ |
|
831 | - $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format ); |
|
830 | + } else { |
|
831 | + $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format); |
|
832 | 832 | } |
833 | 833 | |
834 | - if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty |
|
835 | - if($value && !isset($_REQUEST['backandedit'])) { |
|
834 | + if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty |
|
835 | + if ($value && !isset($_REQUEST['backandedit'])) { |
|
836 | 836 | //$time = strtotime($value); |
837 | 837 | //$value = date_i18n($date_format, $time); |
838 | 838 | } |
@@ -843,37 +843,37 @@ discard block |
||
843 | 843 | |
844 | 844 | jQuery(function () { |
845 | 845 | |
846 | - jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php |
|
846 | + jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php |
|
847 | 847 | /** |
848 | 848 | * Used to add extra option to datepicker per custom field. |
849 | 849 | * |
850 | 850 | * @since 1.5.7 |
851 | 851 | * @param string $name The custom field name. |
852 | 852 | */ |
853 | - echo apply_filters("gd_datepicker_extra_{$name}",'');?>}); |
|
853 | + echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>}); |
|
854 | 854 | |
855 | - jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>'); |
|
855 | + jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>'); |
|
856 | 856 | |
857 | - <?php if(!empty($value)){?> |
|
858 | - jQuery("#<?php echo $name;?>").datepicker("setDate", '<?php echo $value;?>'); |
|
857 | + <?php if (!empty($value)) {?> |
|
858 | + jQuery("#<?php echo $name; ?>").datepicker("setDate", '<?php echo $value; ?>'); |
|
859 | 859 | <?php } ?> |
860 | 860 | |
861 | 861 | }); |
862 | 862 | |
863 | 863 | </script> |
864 | - <div id="<?php echo $name;?>_row" |
|
865 | - class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
|
864 | + <div id="<?php echo $name; ?>_row" |
|
865 | + class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
|
866 | 866 | <label> |
867 | 867 | |
868 | 868 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
869 | 869 | echo (trim($site_title)) ? $site_title : ' '; ?> |
870 | - <?php if ($cf['is_required']) echo '<span>*</span>';?> |
|
870 | + <?php if ($cf['is_required']) echo '<span>*</span>'; ?> |
|
871 | 871 | </label> |
872 | 872 | |
873 | - <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
874 | - value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/> |
|
873 | + <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
874 | + value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/> |
|
875 | 875 | |
876 | - <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> |
|
876 | + <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span> |
|
877 | 877 | <?php if ($cf['is_required']) { ?> |
878 | 878 | <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span> |
879 | 879 | <?php } ?> |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | |
886 | 886 | return $html; |
887 | 887 | } |
888 | -add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2); |
|
888 | +add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2); |
|
889 | 889 | |
890 | 890 | |
891 | 891 | /** |
@@ -897,12 +897,12 @@ discard block |
||
897 | 897 | * |
898 | 898 | * @return string The html to output for the custom field. |
899 | 899 | */ |
900 | -function geodir_cfi_time($html,$cf){ |
|
900 | +function geodir_cfi_time($html, $cf) { |
|
901 | 901 | |
902 | 902 | $html_var = $cf['htmlvar_name']; |
903 | 903 | |
904 | 904 | // Check if there is a custom field specific filter. |
905 | - if(has_filter("geodir_custom_field_input_time_{$html_var}")){ |
|
905 | + if (has_filter("geodir_custom_field_input_time_{$html_var}")) { |
|
906 | 906 | /** |
907 | 907 | * Filter the time html by individual custom field. |
908 | 908 | * |
@@ -910,11 +910,11 @@ discard block |
||
910 | 910 | * @param array $cf The custom field array. |
911 | 911 | * @since 1.6.6 |
912 | 912 | */ |
913 | - $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf); |
|
913 | + $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf); |
|
914 | 914 | } |
915 | 915 | |
916 | 916 | // If no html then we run the standard output. |
917 | - if(empty($html)) { |
|
917 | + if (empty($html)) { |
|
918 | 918 | |
919 | 919 | ob_start(); // Start buffering; |
920 | 920 | $value = geodir_get_cf_value($cf); |
@@ -927,25 +927,25 @@ discard block |
||
927 | 927 | <script type="text/javascript"> |
928 | 928 | jQuery(document).ready(function () { |
929 | 929 | |
930 | - jQuery('#<?php echo $name;?>').timepicker({ |
|
930 | + jQuery('#<?php echo $name; ?>').timepicker({ |
|
931 | 931 | showPeriod: true, |
932 | 932 | showLeadingZero: true, |
933 | 933 | showPeriod: true, |
934 | 934 | }); |
935 | 935 | }); |
936 | 936 | </script> |
937 | - <div id="<?php echo $name;?>_row" |
|
938 | - class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
|
937 | + <div id="<?php echo $name; ?>_row" |
|
938 | + class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
|
939 | 939 | <label> |
940 | 940 | |
941 | 941 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
942 | 942 | echo (trim($site_title)) ? $site_title : ' '; ?> |
943 | - <?php if ($cf['is_required']) echo '<span>*</span>';?> |
|
943 | + <?php if ($cf['is_required']) echo '<span>*</span>'; ?> |
|
944 | 944 | </label> |
945 | - <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" |
|
946 | - id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/> |
|
945 | + <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" |
|
946 | + id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/> |
|
947 | 947 | |
948 | - <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> |
|
948 | + <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span> |
|
949 | 949 | <?php if ($cf['is_required']) { ?> |
950 | 950 | <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span> |
951 | 951 | <?php } ?> |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | |
957 | 957 | return $html; |
958 | 958 | } |
959 | -add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2); |
|
959 | +add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2); |
|
960 | 960 | |
961 | 961 | |
962 | 962 | /** |
@@ -968,12 +968,12 @@ discard block |
||
968 | 968 | * |
969 | 969 | * @return string The html to output for the custom field. |
970 | 970 | */ |
971 | -function geodir_cfi_address($html,$cf){ |
|
971 | +function geodir_cfi_address($html, $cf) { |
|
972 | 972 | |
973 | 973 | $html_var = $cf['htmlvar_name']; |
974 | 974 | |
975 | 975 | // Check if there is a custom field specific filter. |
976 | - if(has_filter("geodir_custom_field_input_address_{$html_var}")){ |
|
976 | + if (has_filter("geodir_custom_field_input_address_{$html_var}")) { |
|
977 | 977 | /** |
978 | 978 | * Filter the address html by individual custom field. |
979 | 979 | * |
@@ -981,11 +981,11 @@ discard block |
||
981 | 981 | * @param array $cf The custom field array. |
982 | 982 | * @since 1.6.6 |
983 | 983 | */ |
984 | - $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf); |
|
984 | + $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf); |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | // If no html then we run the standard output. |
988 | - if(empty($html)) { |
|
988 | + if (empty($html)) { |
|
989 | 989 | |
990 | 990 | global $gd_session; |
991 | 991 | ob_start(); // Start buffering; |
@@ -998,12 +998,12 @@ discard block |
||
998 | 998 | $site_title = $cf['site_title']; |
999 | 999 | $is_admin = $cf['is_admin']; |
1000 | 1000 | $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
1001 | - $prefix = $name . '_'; |
|
1001 | + $prefix = $name.'_'; |
|
1002 | 1002 | |
1003 | - ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address'); |
|
1004 | - ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code '); |
|
1003 | + ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address'); |
|
1004 | + ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code '); |
|
1005 | 1005 | ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map'); |
1006 | - ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview'); |
|
1006 | + ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview'); |
|
1007 | 1007 | |
1008 | 1008 | $address = ''; |
1009 | 1009 | $zip = ''; |
@@ -1014,21 +1014,21 @@ discard block |
||
1014 | 1014 | |
1015 | 1015 | if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) { |
1016 | 1016 | $post = $gd_ses_listing; |
1017 | - $address = $post[$prefix . 'address']; |
|
1018 | - $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : ''; |
|
1019 | - $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : ''; |
|
1020 | - $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : ''; |
|
1021 | - $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : ''; |
|
1022 | - $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : ''; |
|
1017 | + $address = $post[$prefix.'address']; |
|
1018 | + $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : ''; |
|
1019 | + $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : ''; |
|
1020 | + $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : ''; |
|
1021 | + $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : ''; |
|
1022 | + $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : ''; |
|
1023 | 1023 | } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) { |
1024 | - $post_info = (array)$post_info; |
|
1025 | - |
|
1026 | - $address = $post_info[$prefix . 'address']; |
|
1027 | - $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : ''; |
|
1028 | - $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : ''; |
|
1029 | - $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : ''; |
|
1030 | - $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : ''; |
|
1031 | - $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : ''; |
|
1024 | + $post_info = (array) $post_info; |
|
1025 | + |
|
1026 | + $address = $post_info[$prefix.'address']; |
|
1027 | + $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : ''; |
|
1028 | + $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : ''; |
|
1029 | + $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : ''; |
|
1030 | + $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : ''; |
|
1031 | + $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : ''; |
|
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $location = geodir_get_default_location(); |
@@ -1066,18 +1066,18 @@ discard block |
||
1066 | 1066 | $locate_me = !empty($extra_fields['show_map']) && geodir_map_name() != 'none' ? true : false; |
1067 | 1067 | $locate_me_class = $locate_me ? ' gd-form-control' : ''; |
1068 | 1068 | ?> |
1069 | - <div id="geodir_<?php echo $prefix . 'address';?>_row" |
|
1070 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
|
1071 | - <label><?php _e($address_title, 'geodirectory'); ?> <?php if ($is_required) echo '<span>*</span>';?></label> |
|
1069 | + <div id="geodir_<?php echo $prefix.'address'; ?>_row" |
|
1070 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
|
1071 | + <label><?php _e($address_title, 'geodirectory'); ?> <?php if ($is_required) echo '<span>*</span>'; ?></label> |
|
1072 | 1072 | <?php if ($locate_me) { ?> |
1073 | 1073 | <div class="gd-input-group gd-locate-me"> |
1074 | 1074 | <?php } ?> |
1075 | - <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>" id="<?php echo $prefix . 'address';?>" class="geodir_textfield<?php echo $locate_me_class;?>" value="<?php echo esc_attr(stripslashes($address)); ?>" /> |
|
1075 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>" id="<?php echo $prefix.'address'; ?>" class="geodir_textfield<?php echo $locate_me_class; ?>" value="<?php echo esc_attr(stripslashes($address)); ?>" /> |
|
1076 | 1076 | <?php if ($locate_me) { ?> |
1077 | 1077 | <span onclick="gdGeoLocateMe(this, 'add-listing');" class="gd-locate-me-btn gd-input-group-addon" title="<?php esc_attr_e('My location', 'geodirlocation'); ?>"><i class="fa fa-crosshairs fa-fw" aria-hidden="true"></i></span> |
1078 | 1078 | </div> |
1079 | 1079 | <?php } ?> |
1080 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1080 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1081 | 1081 | <?php if ($is_required) { ?> |
1082 | 1082 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1083 | 1083 | <?php } ?> |
@@ -1096,14 +1096,14 @@ discard block |
||
1096 | 1096 | |
1097 | 1097 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?> |
1098 | 1098 | |
1099 | - <div id="geodir_<?php echo $prefix . 'zip'; ?>_row" |
|
1099 | + <div id="geodir_<?php echo $prefix.'zip'; ?>_row" |
|
1100 | 1100 | class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details"> |
1101 | 1101 | <label> |
1102 | 1102 | <?php _e($zip_title, 'geodirectory'); ?> |
1103 | 1103 | <?php /*if($is_required) echo '<span>*</span>';*/ ?> |
1104 | 1104 | </label> |
1105 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>" |
|
1106 | - id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill" |
|
1105 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>" |
|
1106 | + id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill" |
|
1107 | 1107 | value="<?php echo esc_attr(stripslashes($zip)); ?>"/> |
1108 | 1108 | <?php /*if($is_required) {?> |
1109 | 1109 | <span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span> |
@@ -1113,14 +1113,14 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?> |
1115 | 1115 | |
1116 | - <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details"> |
|
1116 | + <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details"> |
|
1117 | 1117 | <?php |
1118 | 1118 | /** |
1119 | 1119 | * Contains add listing page map functions. |
1120 | 1120 | * |
1121 | 1121 | * @since 1.0.0 |
1122 | 1122 | */ |
1123 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1123 | + include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1124 | 1124 | if ($lat_lng_blank) { |
1125 | 1125 | $lat = ''; |
1126 | 1126 | $lng = ''; |
@@ -1131,14 +1131,14 @@ discard block |
||
1131 | 1131 | <?php |
1132 | 1132 | /* show lat lng */ |
1133 | 1133 | $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?> |
1134 | - <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row" |
|
1134 | + <div id="geodir_<?php echo $prefix.'latitude'; ?>_row" |
|
1135 | 1135 | class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>> |
1136 | 1136 | <label> |
1137 | 1137 | <?php echo PLACE_ADDRESS_LAT; ?> |
1138 | 1138 | <?php if ($is_required) echo '<span>*</span>'; ?> |
1139 | 1139 | </label> |
1140 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>" |
|
1141 | - id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield" |
|
1140 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>" |
|
1141 | + id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield" |
|
1142 | 1142 | value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/> |
1143 | 1143 | <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span> |
1144 | 1144 | <?php if ($is_required) { ?> |
@@ -1146,14 +1146,14 @@ discard block |
||
1146 | 1146 | <?php } ?> |
1147 | 1147 | </div> |
1148 | 1148 | |
1149 | - <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row" |
|
1149 | + <div id="geodir_<?php echo $prefix.'longitude'; ?>_row" |
|
1150 | 1150 | class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>> |
1151 | 1151 | <label> |
1152 | 1152 | <?php echo PLACE_ADDRESS_LNG; ?> |
1153 | 1153 | <?php if ($is_required) echo '<span>*</span>'; ?> |
1154 | 1154 | </label> |
1155 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>" |
|
1156 | - id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield" |
|
1155 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>" |
|
1156 | + id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield" |
|
1157 | 1157 | value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/> |
1158 | 1158 | <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span> |
1159 | 1159 | <?php if ($is_required) { ?> |
@@ -1163,32 +1163,32 @@ discard block |
||
1163 | 1163 | <?php } ?> |
1164 | 1164 | |
1165 | 1165 | <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?> |
1166 | - <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details"> |
|
1166 | + <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details"> |
|
1167 | 1167 | <label><?php _e($mapview_title, 'geodirectory'); ?></label> |
1168 | 1168 | |
1169 | 1169 | |
1170 | 1170 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1171 | 1171 | class="gd-checkbox" |
1172 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1173 | - id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') { |
|
1172 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1173 | + id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') { |
|
1174 | 1174 | echo 'checked="checked"'; |
1175 | 1175 | } ?> value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span> |
1176 | 1176 | <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio" |
1177 | 1177 | class="gd-checkbox" |
1178 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1178 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1179 | 1179 | id="map_view1" <?php if ($mapview == 'SATELLITE') { |
1180 | 1180 | echo 'checked="checked"'; |
1181 | 1181 | } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span> |
1182 | 1182 | |
1183 | 1183 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1184 | 1184 | class="gd-checkbox" |
1185 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1185 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1186 | 1186 | id="map_view2" <?php if ($mapview == 'HYBRID') { |
1187 | 1187 | echo 'checked="checked"'; |
1188 | 1188 | } ?> value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span> |
1189 | 1189 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1190 | 1190 | class="gd-checkbox" |
1191 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1191 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1192 | 1192 | id="map_view3" <?php if ($mapview == 'TERRAIN') { |
1193 | 1193 | echo 'checked="checked"'; |
1194 | 1194 | } ?> value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span> |
@@ -1200,7 +1200,7 @@ discard block |
||
1200 | 1200 | <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?> |
1201 | 1201 | <input type="hidden" value="<?php if (isset($mapzoom)) { |
1202 | 1202 | echo esc_attr($mapzoom); |
1203 | - } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/> |
|
1203 | + } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/> |
|
1204 | 1204 | <?php } |
1205 | 1205 | |
1206 | 1206 | $html = ob_get_clean(); |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | |
1209 | 1209 | return $html; |
1210 | 1210 | } |
1211 | -add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2); |
|
1211 | +add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2); |
|
1212 | 1212 | |
1213 | 1213 | |
1214 | 1214 | |
@@ -1221,12 +1221,12 @@ discard block |
||
1221 | 1221 | * |
1222 | 1222 | * @return string The html to output for the custom field. |
1223 | 1223 | */ |
1224 | -function geodir_cfi_taxonomy($html,$cf){ |
|
1224 | +function geodir_cfi_taxonomy($html, $cf) { |
|
1225 | 1225 | |
1226 | 1226 | $html_var = $cf['htmlvar_name']; |
1227 | 1227 | |
1228 | 1228 | // Check if there is a custom field specific filter. |
1229 | - if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){ |
|
1229 | + if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) { |
|
1230 | 1230 | /** |
1231 | 1231 | * Filter the taxonomy html by individual custom field. |
1232 | 1232 | * |
@@ -1234,11 +1234,11 @@ discard block |
||
1234 | 1234 | * @param array $cf The custom field array. |
1235 | 1235 | * @since 1.6.6 |
1236 | 1236 | */ |
1237 | - $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf); |
|
1237 | + $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf); |
|
1238 | 1238 | } |
1239 | 1239 | |
1240 | 1240 | // If no html then we run the standard output. |
1241 | - if(empty($html)) { |
|
1241 | + if (empty($html)) { |
|
1242 | 1242 | |
1243 | 1243 | ob_start(); // Start buffering; |
1244 | 1244 | $value = geodir_get_cf_value($cf); |
@@ -1253,15 +1253,15 @@ discard block |
||
1253 | 1253 | if ($value == $cf['default']) { |
1254 | 1254 | $value = ''; |
1255 | 1255 | } ?> |
1256 | - <div id="<?php echo $name;?>_row" |
|
1257 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
|
1256 | + <div id="<?php echo $name; ?>_row" |
|
1257 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
|
1258 | 1258 | <label> |
1259 | 1259 | <?php $site_title = __($site_title, 'geodirectory'); |
1260 | 1260 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1261 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1261 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1262 | 1262 | </label> |
1263 | 1263 | |
1264 | - <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;"> |
|
1264 | + <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;"> |
|
1265 | 1265 | <?php |
1266 | 1266 | global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats; |
1267 | 1267 | |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | |
1274 | 1274 | $package_info = array(); |
1275 | 1275 | |
1276 | - $package_info = (array)geodir_post_package_info($package_info, $post, $post_type); |
|
1276 | + $package_info = (array) geodir_post_package_info($package_info, $post, $post_type); |
|
1277 | 1277 | |
1278 | 1278 | if (!empty($package_info)) { |
1279 | 1279 | |
@@ -1302,7 +1302,7 @@ discard block |
||
1302 | 1302 | |
1303 | 1303 | $catadd_limit = $wpdb->get_var( |
1304 | 1304 | $wpdb->prepare( |
1305 | - "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d", |
|
1305 | + "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d", |
|
1306 | 1306 | array($package_id) |
1307 | 1307 | ) |
1308 | 1308 | ); |
@@ -1318,13 +1318,13 @@ discard block |
||
1318 | 1318 | $required_limit_msg = ''; |
1319 | 1319 | if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') { |
1320 | 1320 | |
1321 | - $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory'); |
|
1321 | + $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory'); |
|
1322 | 1322 | |
1323 | 1323 | } else { |
1324 | 1324 | $required_limit_msg = $required_msg; |
1325 | 1325 | } |
1326 | 1326 | |
1327 | - echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']" />'; |
|
1327 | + echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']" />'; |
|
1328 | 1328 | |
1329 | 1329 | |
1330 | 1330 | if ($cat_display == 'select' || $cat_display == 'multiselect') { |
@@ -1334,11 +1334,11 @@ discard block |
||
1334 | 1334 | if ($cat_display == 'multiselect') |
1335 | 1335 | $multiple = 'multiple="multiple"'; |
1336 | 1336 | |
1337 | - 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') . '">'; |
|
1337 | + 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').'">'; |
|
1338 | 1338 | |
1339 | 1339 | |
1340 | 1340 | if ($cat_display == 'select') |
1341 | - echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>'; |
|
1341 | + echo '<option value="">'.__('Select Category', 'geodirectory').'</option>'; |
|
1342 | 1342 | |
1343 | 1343 | } |
1344 | 1344 | |
@@ -1356,7 +1356,7 @@ discard block |
||
1356 | 1356 | ?> |
1357 | 1357 | </div> |
1358 | 1358 | |
1359 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1359 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1360 | 1360 | <?php if ($is_required) { ?> |
1361 | 1361 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1362 | 1362 | <?php } ?> |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | |
1369 | 1369 | return $html; |
1370 | 1370 | } |
1371 | -add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2); |
|
1371 | +add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2); |
|
1372 | 1372 | |
1373 | 1373 | |
1374 | 1374 | /** |
@@ -1380,12 +1380,12 @@ discard block |
||
1380 | 1380 | * |
1381 | 1381 | * @return string The html to output for the custom field. |
1382 | 1382 | */ |
1383 | -function geodir_cfi_file($html,$cf){ |
|
1383 | +function geodir_cfi_file($html, $cf) { |
|
1384 | 1384 | |
1385 | 1385 | $html_var = $cf['htmlvar_name']; |
1386 | 1386 | |
1387 | 1387 | // Check if there is a custom field specific filter. |
1388 | - if(has_filter("geodir_custom_field_input_file_{$html_var}")){ |
|
1388 | + if (has_filter("geodir_custom_field_input_file_{$html_var}")) { |
|
1389 | 1389 | /** |
1390 | 1390 | * Filter the file html by individual custom field. |
1391 | 1391 | * |
@@ -1393,11 +1393,11 @@ discard block |
||
1393 | 1393 | * @param array $cf The custom field array. |
1394 | 1394 | * @since 1.6.6 |
1395 | 1395 | */ |
1396 | - $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf); |
|
1396 | + $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf); |
|
1397 | 1397 | } |
1398 | 1398 | |
1399 | 1399 | // If no html then we run the standard output. |
1400 | - if(empty($html)) { |
|
1400 | + if (empty($html)) { |
|
1401 | 1401 | |
1402 | 1402 | ob_start(); // Start buffering; |
1403 | 1403 | $value = geodir_get_cf_value($cf); |
@@ -1440,8 +1440,8 @@ discard block |
||
1440 | 1440 | $file_totImg = count($curImages); |
1441 | 1441 | } |
1442 | 1442 | |
1443 | - $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']) : ''; |
|
1444 | - $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : ''; |
|
1443 | + $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']) : ''; |
|
1444 | + $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : ''; |
|
1445 | 1445 | |
1446 | 1446 | ?> |
1447 | 1447 | <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?> |
@@ -1451,13 +1451,13 @@ discard block |
||
1451 | 1451 | </h5> <?php */ |
1452 | 1452 | ?> |
1453 | 1453 | |
1454 | - <div id="<?php echo $name;?>_row" |
|
1455 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
|
1454 | + <div id="<?php echo $name; ?>_row" |
|
1455 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
|
1456 | 1456 | |
1457 | 1457 | <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;"> |
1458 | 1458 | <label |
1459 | 1459 | style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory'); |
1460 | - echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label> |
|
1460 | + echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label> |
|
1461 | 1461 | <input class="geodir-custom-file-upload" field_type="file" type="hidden" |
1462 | 1462 | name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>" |
1463 | 1463 | value="<?php echo esc_attr($file_value); ?>"/> |
@@ -1465,7 +1465,7 @@ discard block |
||
1465 | 1465 | id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/> |
1466 | 1466 | <?php if ($allowed_file_types != '') { ?> |
1467 | 1467 | <input type="hidden" name="<?php echo $file_id; ?>_allowed_types" |
1468 | - id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/> |
|
1468 | + id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/> |
|
1469 | 1469 | <?php } ?> |
1470 | 1470 | <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg" |
1471 | 1471 | value="<?php if (isset($file_totImg)) { |
@@ -1481,10 +1481,10 @@ discard block |
||
1481 | 1481 | <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */ |
1482 | 1482 | ?> |
1483 | 1483 | <input id="<?php echo $file_id; ?>plupload-browse-button" type="button" |
1484 | - value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>" |
|
1484 | + value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>" |
|
1485 | 1485 | class="geodir_button" style="margin-top:10px;"/> |
1486 | 1486 | <span class="ajaxnonceplu" |
1487 | - id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span> |
|
1487 | + id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span> |
|
1488 | 1488 | <?php if ($file_width && $file_height): ?> |
1489 | 1489 | <span class="plupload-resize"></span> |
1490 | 1490 | <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span> |
@@ -1504,7 +1504,7 @@ discard block |
||
1504 | 1504 | |
1505 | 1505 | </div> |
1506 | 1506 | </div> |
1507 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span> |
|
1507 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span> |
|
1508 | 1508 | <?php if ($is_required) { ?> |
1509 | 1509 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1510 | 1510 | <?php } ?> |
@@ -1517,4 +1517,4 @@ discard block |
||
1517 | 1517 | |
1518 | 1518 | return $html; |
1519 | 1519 | } |
1520 | -add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2); |
|
1521 | 1520 | \ No newline at end of file |
1521 | +add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2); |
|
1522 | 1522 | \ No newline at end of file |