@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | global $post_type; |
19 | 19 | |
20 | 20 | if (!isset($field_info->post_type)) { |
21 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
21 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
22 | 22 | } else |
23 | - $post_type = $field_info->post_type; |
|
23 | + $post_type = $field_info->post_type; |
|
24 | 24 | |
25 | 25 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){ |
26 | 26 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $field_admin_title = ''; |
50 | 50 | if (isset($field_info->admin_title)) |
51 | - $field_admin_title = $field_info->admin_title; |
|
51 | + $field_admin_title = $field_info->admin_title; |
|
52 | 52 | |
53 | 53 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
54 | 54 | |
@@ -68,21 +68,21 @@ discard block |
||
68 | 68 | //print_r($field_info); |
69 | 69 | |
70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
71 | - $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
71 | + $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
72 | 72 | }elseif(isset($cf['icon']) && $cf['icon']){ |
73 | - $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>'; |
|
73 | + $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>'; |
|
74 | 74 | }else{ |
75 | - $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
75 | + $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | if(isset($cf['name']) && $cf['name']){ |
79 | - $field_type_name = $cf['name']; |
|
79 | + $field_type_name = $cf['name']; |
|
80 | 80 | }else{ |
81 | - $field_type_name = $field_type; |
|
81 | + $field_type_name = $field_type; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') { |
85 | - $field_info->data_type = 'XVARCHAR'; |
|
85 | + $field_info->data_type = 'XVARCHAR'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | ?> |
@@ -92,45 +92,45 @@ discard block |
||
92 | 92 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')" > |
93 | 93 | <?php |
94 | 94 | |
95 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
96 | - ?> |
|
95 | + $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
96 | + ?> |
|
97 | 97 | |
98 | 98 | <?php if (!$default): ?> |
99 | 99 | <div title="<?php _e('Click to remove field', 'geodirectory'); ?>" |
100 | 100 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')" |
101 | 101 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
102 | 102 | <?php endif; |
103 | - if ($field_type == 'fieldset') { |
|
104 | - ?> |
|
103 | + if ($field_type == 'fieldset') { |
|
104 | + ?> |
|
105 | 105 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
106 | 106 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
107 | 107 | <b style="cursor:pointer;" |
108 | 108 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
109 | 109 | <?php |
110 | - } else {echo $field_icon; |
|
111 | - ?> |
|
110 | + } else {echo $field_icon; |
|
111 | + ?> |
|
112 | 112 | <b style="cursor:pointer;" |
113 | 113 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b> |
114 | 114 | <?php |
115 | - } |
|
116 | - ?> |
|
115 | + } |
|
116 | + ?> |
|
117 | 117 | </div> |
118 | 118 | |
119 | 119 | <form><!-- we need to wrap in a fom so we can use radio buttons with same name --> |
120 | 120 | <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
121 | 121 | style="display:<?php if ($field_ins_upd == 'submit') { |
122 | - echo 'block;'; |
|
123 | - } else { |
|
124 | - echo 'none;'; |
|
125 | - } ?>"> |
|
122 | + echo 'block;'; |
|
123 | + } else { |
|
124 | + echo 'none;'; |
|
125 | + } ?>"> |
|
126 | 126 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/> |
127 | 127 | <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
128 | 128 | <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
129 | 129 | <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/> |
130 | 130 | <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/> |
131 | 131 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) { |
132 | - echo $field_info->data_type; |
|
133 | - } ?>"/> |
|
132 | + echo $field_info->data_type; |
|
133 | + } ?>"/> |
|
134 | 134 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
135 | 135 | |
136 | 136 | <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
@@ -142,37 +142,37 @@ discard block |
||
142 | 142 | |
143 | 143 | <?php |
144 | 144 | |
145 | - // data_type |
|
146 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
145 | + // data_type |
|
146 | + if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
147 | 147 | |
148 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
148 | + echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
149 | 149 | |
150 | - }else{ |
|
151 | - $value = ''; |
|
152 | - if (isset($field_info->data_type)) { |
|
153 | - $value = esc_attr($field_info->data_type); |
|
154 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
155 | - $value = $cf['defaults']['data_type']; |
|
156 | - } |
|
157 | - ?> |
|
150 | + }else{ |
|
151 | + $value = ''; |
|
152 | + if (isset($field_info->data_type)) { |
|
153 | + $value = esc_attr($field_info->data_type); |
|
154 | + }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
155 | + $value = $cf['defaults']['data_type']; |
|
156 | + } |
|
157 | + ?> |
|
158 | 158 | <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
159 | 159 | <?php |
160 | - } |
|
160 | + } |
|
161 | 161 | |
162 | 162 | |
163 | - // admin_title |
|
164 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
163 | + // admin_title |
|
164 | + if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
165 | 165 | |
166 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
166 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
167 | 167 | |
168 | - }else{ |
|
169 | - $value = ''; |
|
170 | - if (isset($field_info->admin_title)) { |
|
171 | - $value = esc_attr($field_info->admin_title); |
|
172 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
173 | - $value = $cf['defaults']['admin_title']; |
|
174 | - } |
|
175 | - ?> |
|
168 | + }else{ |
|
169 | + $value = ''; |
|
170 | + if (isset($field_info->admin_title)) { |
|
171 | + $value = esc_attr($field_info->admin_title); |
|
172 | + }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
173 | + $value = $cf['defaults']['admin_title']; |
|
174 | + } |
|
175 | + ?> |
|
176 | 176 | <li> |
177 | 177 | <label for="admin_title" class="gd-cf-tooltip-wrap"> |
178 | 178 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?> |
@@ -186,22 +186,22 @@ discard block |
||
186 | 186 | </div> |
187 | 187 | </li> |
188 | 188 | <?php |
189 | - } |
|
189 | + } |
|
190 | 190 | |
191 | 191 | |
192 | - // site_title |
|
193 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
192 | + // site_title |
|
193 | + if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
194 | 194 | |
195 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
195 | + echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
196 | 196 | |
197 | - }else{ |
|
198 | - $value = ''; |
|
199 | - if (isset($field_info->site_title)) { |
|
200 | - $value = esc_attr($field_info->site_title); |
|
201 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
202 | - $value = $cf['defaults']['site_title']; |
|
203 | - } |
|
204 | - ?> |
|
197 | + }else{ |
|
198 | + $value = ''; |
|
199 | + if (isset($field_info->site_title)) { |
|
200 | + $value = esc_attr($field_info->site_title); |
|
201 | + }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
202 | + $value = $cf['defaults']['site_title']; |
|
203 | + } |
|
204 | + ?> |
|
205 | 205 | <li> |
206 | 206 | <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?> |
207 | 207 | <div class="gdcf-tooltip"> |
@@ -214,22 +214,22 @@ discard block |
||
214 | 214 | </div> |
215 | 215 | </li> |
216 | 216 | <?php |
217 | - } |
|
217 | + } |
|
218 | 218 | |
219 | 219 | |
220 | - // admin_desc |
|
221 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
220 | + // admin_desc |
|
221 | + if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
222 | 222 | |
223 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
223 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
224 | 224 | |
225 | - }else{ |
|
226 | - $value = ''; |
|
227 | - if (isset($field_info->admin_desc)) { |
|
228 | - $value = esc_attr($field_info->admin_desc); |
|
229 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
230 | - $value = $cf['defaults']['admin_desc']; |
|
231 | - } |
|
232 | - ?> |
|
225 | + }else{ |
|
226 | + $value = ''; |
|
227 | + if (isset($field_info->admin_desc)) { |
|
228 | + $value = esc_attr($field_info->admin_desc); |
|
229 | + }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
230 | + $value = $cf['defaults']['admin_desc']; |
|
231 | + } |
|
232 | + ?> |
|
233 | 233 | <li> |
234 | 234 | <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?> |
235 | 235 | <div class="gdcf-tooltip"> |
@@ -241,23 +241,23 @@ discard block |
||
241 | 241 | </div> |
242 | 242 | </li> |
243 | 243 | <?php |
244 | - } |
|
244 | + } |
|
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | - // htmlvar_name |
|
249 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
248 | + // htmlvar_name |
|
249 | + if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
250 | 250 | |
251 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
251 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
252 | 252 | |
253 | - }else{ |
|
254 | - $value = ''; |
|
255 | - if (isset($field_info->htmlvar_name)) { |
|
256 | - $value = esc_attr($field_info->htmlvar_name); |
|
257 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
258 | - $value = $cf['defaults']['htmlvar_name']; |
|
259 | - } |
|
260 | - ?> |
|
253 | + }else{ |
|
254 | + $value = ''; |
|
255 | + if (isset($field_info->htmlvar_name)) { |
|
256 | + $value = esc_attr($field_info->htmlvar_name); |
|
257 | + }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
258 | + $value = $cf['defaults']['htmlvar_name']; |
|
259 | + } |
|
260 | + ?> |
|
261 | 261 | <li> |
262 | 262 | <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?> |
263 | 263 | <div class="gdcf-tooltip"> |
@@ -267,29 +267,29 @@ discard block |
||
267 | 267 | <div class="gd-cf-input-wrap"> |
268 | 268 | <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>" |
269 | 269 | value="<?php if ($value) { |
270 | - echo preg_replace('/geodir_/', '', $value, 1); |
|
271 | - }?>" <?php if ($default) { |
|
272 | - echo 'readonly="readonly"'; |
|
273 | - }?> /> |
|
270 | + echo preg_replace('/geodir_/', '', $value, 1); |
|
271 | + }?>" <?php if ($default) { |
|
272 | + echo 'readonly="readonly"'; |
|
273 | + }?> /> |
|
274 | 274 | </div> |
275 | 275 | </li> |
276 | 276 | <?php |
277 | - } |
|
277 | + } |
|
278 | 278 | |
279 | 279 | |
280 | - // is_active |
|
281 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
280 | + // is_active |
|
281 | + if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
282 | 282 | |
283 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
283 | + echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
284 | 284 | |
285 | - }else{ |
|
286 | - $value = ''; |
|
287 | - if (isset($field_info->is_active)) { |
|
288 | - $value = esc_attr($field_info->is_active); |
|
289 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
290 | - $value = $cf['defaults']['is_active']; |
|
291 | - } |
|
292 | - ?> |
|
285 | + }else{ |
|
286 | + $value = ''; |
|
287 | + if (isset($field_info->is_active)) { |
|
288 | + $value = esc_attr($field_info->is_active); |
|
289 | + }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
290 | + $value = $cf['defaults']['is_active']; |
|
291 | + } |
|
292 | + ?> |
|
293 | 293 | <li <?php echo $field_display; ?>> |
294 | 294 | <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?> |
295 | 295 | <div class="gdcf-tooltip"> |
@@ -300,35 +300,35 @@ discard block |
||
300 | 300 | |
301 | 301 | <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
302 | 302 | <?php if ($value == '1') { |
303 | - echo 'checked'; |
|
304 | - } ?>/> |
|
303 | + echo 'checked'; |
|
304 | + } ?>/> |
|
305 | 305 | <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
306 | 306 | |
307 | 307 | <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
308 | 308 | <?php if ($value == '0' || !$value) { |
309 | - echo 'checked'; |
|
310 | - } ?>/> |
|
309 | + echo 'checked'; |
|
310 | + } ?>/> |
|
311 | 311 | <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
312 | 312 | |
313 | 313 | </div> |
314 | 314 | </li> |
315 | 315 | <?php |
316 | - } |
|
316 | + } |
|
317 | 317 | |
318 | 318 | |
319 | - // for_admin_use |
|
320 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
319 | + // for_admin_use |
|
320 | + if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
321 | 321 | |
322 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
322 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
323 | 323 | |
324 | - }else{ |
|
325 | - $value = ''; |
|
326 | - if (isset($field_info->for_admin_use)) { |
|
327 | - $value = esc_attr($field_info->for_admin_use); |
|
328 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
329 | - $value = $cf['defaults']['for_admin_use']; |
|
330 | - } |
|
331 | - ?> |
|
324 | + }else{ |
|
325 | + $value = ''; |
|
326 | + if (isset($field_info->for_admin_use)) { |
|
327 | + $value = esc_attr($field_info->for_admin_use); |
|
328 | + }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
329 | + $value = $cf['defaults']['for_admin_use']; |
|
330 | + } |
|
331 | + ?> |
|
332 | 332 | <li> |
333 | 333 | <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?> |
334 | 334 | <div class="gdcf-tooltip"> |
@@ -339,47 +339,47 @@ discard block |
||
339 | 339 | |
340 | 340 | <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
341 | 341 | <?php if ($value == '1') { |
342 | - echo 'checked'; |
|
343 | - } ?>/> |
|
342 | + echo 'checked'; |
|
343 | + } ?>/> |
|
344 | 344 | <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
345 | 345 | |
346 | 346 | <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
347 | 347 | <?php if ($value == '0' || !$value) { |
348 | - echo 'checked'; |
|
349 | - } ?>/> |
|
348 | + echo 'checked'; |
|
349 | + } ?>/> |
|
350 | 350 | <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
351 | 351 | |
352 | 352 | </div> |
353 | 353 | </li> |
354 | 354 | <?php |
355 | - } |
|
355 | + } |
|
356 | 356 | |
357 | 357 | |
358 | - // default_value |
|
359 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
358 | + // default_value |
|
359 | + if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
360 | 360 | |
361 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
361 | + echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
362 | 362 | |
363 | - }else{ |
|
364 | - $value = ''; |
|
365 | - if (isset($field_info->default_value)) { |
|
366 | - $value = esc_attr($field_info->default_value); |
|
367 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
368 | - $value = $cf['defaults']['default_value']; |
|
369 | - } |
|
370 | - ?> |
|
363 | + }else{ |
|
364 | + $value = ''; |
|
365 | + if (isset($field_info->default_value)) { |
|
366 | + $value = esc_attr($field_info->default_value); |
|
367 | + }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
368 | + $value = $cf['defaults']['default_value']; |
|
369 | + } |
|
370 | + ?> |
|
371 | 371 | <li> |
372 | 372 | <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
373 | 373 | <div class="gdcf-tooltip"> |
374 | 374 | <?php |
375 | - if ($field_type == 'checkbox') { |
|
376 | - _e('Should the checkbox be checked by default?', 'geodirectory'); |
|
377 | - } else if ($field_type == 'email') { |
|
378 | - _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory'); |
|
379 | - } else { |
|
380 | - _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory'); |
|
381 | - } |
|
382 | - ?> |
|
375 | + if ($field_type == 'checkbox') { |
|
376 | + _e('Should the checkbox be checked by default?', 'geodirectory'); |
|
377 | + } else if ($field_type == 'email') { |
|
378 | + _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory'); |
|
379 | + } else { |
|
380 | + _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory'); |
|
381 | + } |
|
382 | + ?> |
|
383 | 383 | </div> |
384 | 384 | </label> |
385 | 385 | <div class="gd-cf-input-wrap"> |
@@ -396,22 +396,22 @@ discard block |
||
396 | 396 | </div> |
397 | 397 | </li> |
398 | 398 | <?php |
399 | - } |
|
399 | + } |
|
400 | 400 | |
401 | 401 | |
402 | - // show_in |
|
403 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
402 | + // show_in |
|
403 | + if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
404 | 404 | |
405 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
405 | + echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
406 | 406 | |
407 | - }else{ |
|
408 | - $value = ''; |
|
409 | - if (isset($field_info->show_in)) { |
|
410 | - $value = esc_attr($field_info->show_in); |
|
411 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
412 | - $value = esc_attr($cf['defaults']['show_in']); |
|
413 | - } |
|
414 | - ?> |
|
407 | + }else{ |
|
408 | + $value = ''; |
|
409 | + if (isset($field_info->show_in)) { |
|
410 | + $value = esc_attr($field_info->show_in); |
|
411 | + }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
412 | + $value = esc_attr($cf['defaults']['show_in']); |
|
413 | + } |
|
414 | + ?> |
|
415 | 415 | <li> |
416 | 416 | <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?> |
417 | 417 | <div class="gdcf-tooltip"> |
@@ -422,41 +422,41 @@ discard block |
||
422 | 422 | |
423 | 423 | <?php |
424 | 424 | |
425 | - /* |
|
425 | + /* |
|
426 | 426 | * We wrap the key values in [] so we can search the DB easier with a LIKE query. |
427 | 427 | */ |
428 | - $show_in_locations = array( |
|
429 | - "[detail]" => __("Details page sidebar", 'geodirectory'), |
|
430 | - "[moreinfo]" => __("More info tab", 'geodirectory'), |
|
431 | - "[listing]" => __("Listings page", 'geodirectory'), |
|
432 | - "[owntab]" => __("Details page own tab", 'geodirectory'), |
|
433 | - "[mapbubble]" => __("Map bubble", 'geodirectory'), |
|
434 | - ); |
|
435 | - |
|
436 | - /** |
|
437 | - * Filter the locations array for where to display custom fields. |
|
438 | - * |
|
439 | - * @since 1.6.6 |
|
440 | - * @param array $show_in_locations The array of locations and descriptions. |
|
441 | - * @param object $field_info The field being displayed info. |
|
442 | - * @param string $field_info The type of field. |
|
443 | - */ |
|
444 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
445 | - |
|
446 | - |
|
447 | - // remove some locations for some field types |
|
448 | - |
|
449 | - // don't show new tab option for some types |
|
450 | - if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
451 | - }else{ |
|
452 | - unset($show_in_locations['[owntab]']); |
|
453 | - } |
|
454 | - |
|
455 | - if(!$display_on_listing){ |
|
456 | - unset($show_in_locations['[listings]']); |
|
457 | - } |
|
458 | - |
|
459 | - ?> |
|
428 | + $show_in_locations = array( |
|
429 | + "[detail]" => __("Details page sidebar", 'geodirectory'), |
|
430 | + "[moreinfo]" => __("More info tab", 'geodirectory'), |
|
431 | + "[listing]" => __("Listings page", 'geodirectory'), |
|
432 | + "[owntab]" => __("Details page own tab", 'geodirectory'), |
|
433 | + "[mapbubble]" => __("Map bubble", 'geodirectory'), |
|
434 | + ); |
|
435 | + |
|
436 | + /** |
|
437 | + * Filter the locations array for where to display custom fields. |
|
438 | + * |
|
439 | + * @since 1.6.6 |
|
440 | + * @param array $show_in_locations The array of locations and descriptions. |
|
441 | + * @param object $field_info The field being displayed info. |
|
442 | + * @param string $field_info The type of field. |
|
443 | + */ |
|
444 | + $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
445 | + |
|
446 | + |
|
447 | + // remove some locations for some field types |
|
448 | + |
|
449 | + // don't show new tab option for some types |
|
450 | + if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
451 | + }else{ |
|
452 | + unset($show_in_locations['[owntab]']); |
|
453 | + } |
|
454 | + |
|
455 | + if(!$display_on_listing){ |
|
456 | + unset($show_in_locations['[listings]']); |
|
457 | + } |
|
458 | + |
|
459 | + ?> |
|
460 | 460 | |
461 | 461 | <select multiple="multiple" name="show_in[]" |
462 | 462 | id="show_in" |
@@ -466,38 +466,38 @@ discard block |
||
466 | 466 | option-ajaxchosen="false"> |
467 | 467 | <?php |
468 | 468 | |
469 | - $show_in_values = explode(',',$value); |
|
469 | + $show_in_values = explode(',',$value); |
|
470 | 470 | |
471 | - foreach( $show_in_locations as $key => $val){ |
|
472 | - $selected = ''; |
|
471 | + foreach( $show_in_locations as $key => $val){ |
|
472 | + $selected = ''; |
|
473 | 473 | |
474 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
475 | - $selected = 'selected'; |
|
476 | - } |
|
474 | + if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
475 | + $selected = 'selected'; |
|
476 | + } |
|
477 | 477 | |
478 | - ?> |
|
478 | + ?> |
|
479 | 479 | <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
480 | 480 | <?php |
481 | - } |
|
482 | - ?> |
|
481 | + } |
|
482 | + ?> |
|
483 | 483 | </select> |
484 | 484 | </div> |
485 | 485 | </li> |
486 | 486 | <?php |
487 | - } |
|
487 | + } |
|
488 | 488 | |
489 | 489 | |
490 | - // advanced_editor |
|
491 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
490 | + // advanced_editor |
|
491 | + if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
492 | 492 | |
493 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
493 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
494 | 494 | |
495 | - } |
|
495 | + } |
|
496 | 496 | |
497 | 497 | |
498 | 498 | |
499 | 499 | |
500 | - ?> |
|
500 | + ?> |
|
501 | 501 | |
502 | 502 | |
503 | 503 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
@@ -510,38 +510,38 @@ discard block |
||
510 | 510 | |
511 | 511 | <?php |
512 | 512 | |
513 | - $pricearr = array(); |
|
514 | - if (isset($field_info->packages) && $field_info->packages != '') { |
|
515 | - $pricearr = explode(',', trim($field_info->packages, ',')); |
|
516 | - } else { |
|
517 | - $package_info = array(); |
|
513 | + $pricearr = array(); |
|
514 | + if (isset($field_info->packages) && $field_info->packages != '') { |
|
515 | + $pricearr = explode(',', trim($field_info->packages, ',')); |
|
516 | + } else { |
|
517 | + $package_info = array(); |
|
518 | 518 | |
519 | - $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
520 | - $pricearr[] = $package_info->pid; |
|
521 | - } |
|
519 | + $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
520 | + $pricearr[] = $package_info->pid; |
|
521 | + } |
|
522 | 522 | |
523 | - ob_start() |
|
524 | - ?> |
|
523 | + ob_start() |
|
524 | + ?> |
|
525 | 525 | |
526 | 526 | <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple"> |
527 | 527 | <?php |
528 | - if (!empty($pricearr)) { |
|
529 | - foreach ($pricearr as $val) { |
|
530 | - ?> |
|
528 | + if (!empty($pricearr)) { |
|
529 | + foreach ($pricearr as $val) { |
|
530 | + ?> |
|
531 | 531 | <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php |
532 | - } |
|
533 | - } |
|
534 | - ?> |
|
532 | + } |
|
533 | + } |
|
534 | + ?> |
|
535 | 535 | </select> |
536 | 536 | |
537 | 537 | <?php |
538 | - $html = ob_get_clean(); |
|
538 | + $html = ob_get_clean(); |
|
539 | 539 | |
540 | 540 | /** |
541 | 541 | * Filter the price packages list. |
542 | 542 | * |
543 | 543 | * Filter the price packages list in custom field form in admin |
544 | - * custom fields settings. |
|
544 | + * custom fields settings. |
|
545 | 545 | * |
546 | 546 | * @since 1.0.0 |
547 | 547 | * |
@@ -550,25 +550,25 @@ discard block |
||
550 | 550 | */ |
551 | 551 | echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info); |
552 | 552 | |
553 | - ?> |
|
553 | + ?> |
|
554 | 554 | |
555 | 555 | |
556 | 556 | |
557 | 557 | <?php |
558 | 558 | |
559 | - // is_required |
|
560 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
559 | + // is_required |
|
560 | + if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
561 | 561 | |
562 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
562 | + echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
563 | 563 | |
564 | - }else{ |
|
565 | - $value = ''; |
|
566 | - if (isset($field_info->is_required)) { |
|
567 | - $value = esc_attr($field_info->is_required); |
|
568 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
569 | - $value = $cf['defaults']['is_required']; |
|
570 | - } |
|
571 | - ?> |
|
564 | + }else{ |
|
565 | + $value = ''; |
|
566 | + if (isset($field_info->is_required)) { |
|
567 | + $value = esc_attr($field_info->is_required); |
|
568 | + }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
569 | + $value = $cf['defaults']['is_required']; |
|
570 | + } |
|
571 | + ?> |
|
572 | 572 | <li> |
573 | 573 | <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?> |
574 | 574 | <div class="gdcf-tooltip"> |
@@ -580,14 +580,14 @@ discard block |
||
580 | 580 | |
581 | 581 | <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
582 | 582 | <?php if ($value == '1') { |
583 | - echo 'checked'; |
|
584 | - } ?>/> |
|
583 | + echo 'checked'; |
|
584 | + } ?>/> |
|
585 | 585 | <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
586 | 586 | |
587 | 587 | <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
588 | 588 | <?php if ($value == '0' || !$value) { |
589 | - echo 'checked'; |
|
590 | - } ?>/> |
|
589 | + echo 'checked'; |
|
590 | + } ?>/> |
|
591 | 591 | <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
592 | 592 | |
593 | 593 | </div> |
@@ -595,21 +595,21 @@ discard block |
||
595 | 595 | </li> |
596 | 596 | |
597 | 597 | <?php |
598 | - } |
|
598 | + } |
|
599 | 599 | |
600 | - // required_msg |
|
601 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
600 | + // required_msg |
|
601 | + if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
602 | 602 | |
603 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
603 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
604 | 604 | |
605 | - }else{ |
|
606 | - $value = ''; |
|
607 | - if (isset($field_info->required_msg)) { |
|
608 | - $value = esc_attr($field_info->required_msg); |
|
609 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
610 | - $value = $cf['defaults']['required_msg']; |
|
611 | - } |
|
612 | - ?> |
|
605 | + }else{ |
|
606 | + $value = ''; |
|
607 | + if (isset($field_info->required_msg)) { |
|
608 | + $value = esc_attr($field_info->required_msg); |
|
609 | + }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
610 | + $value = $cf['defaults']['required_msg']; |
|
611 | + } |
|
612 | + ?> |
|
613 | 613 | <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>> |
614 | 614 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
615 | 615 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
@@ -623,38 +623,38 @@ discard block |
||
623 | 623 | </div> |
624 | 624 | </li> |
625 | 625 | <?php |
626 | - } |
|
626 | + } |
|
627 | 627 | |
628 | 628 | |
629 | - // required_msg |
|
630 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
629 | + // required_msg |
|
630 | + if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
631 | 631 | |
632 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
632 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
633 | 633 | |
634 | - } |
|
634 | + } |
|
635 | 635 | |
636 | 636 | |
637 | - // extra_fields |
|
638 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
637 | + // extra_fields |
|
638 | + if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
639 | 639 | |
640 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
640 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
641 | 641 | |
642 | - } |
|
642 | + } |
|
643 | 643 | |
644 | 644 | |
645 | - // field_icon |
|
646 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
645 | + // field_icon |
|
646 | + if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
647 | 647 | |
648 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
648 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
649 | 649 | |
650 | - }else{ |
|
651 | - $value = ''; |
|
652 | - if (isset($field_info->field_icon)) { |
|
653 | - $value = esc_attr($field_info->field_icon); |
|
654 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
655 | - $value = $cf['defaults']['field_icon']; |
|
656 | - } |
|
657 | - ?> |
|
650 | + }else{ |
|
651 | + $value = ''; |
|
652 | + if (isset($field_info->field_icon)) { |
|
653 | + $value = esc_attr($field_info->field_icon); |
|
654 | + }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
655 | + $value = $cf['defaults']['field_icon']; |
|
656 | + } |
|
657 | + ?> |
|
658 | 658 | <li> |
659 | 659 | <h3><?php echo __('Custom css', 'geodirectory'); ?></h3> |
660 | 660 | |
@@ -672,22 +672,22 @@ discard block |
||
672 | 672 | |
673 | 673 | </li> |
674 | 674 | <?php |
675 | - } |
|
675 | + } |
|
676 | 676 | |
677 | 677 | |
678 | - // css_class |
|
679 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
678 | + // css_class |
|
679 | + if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
680 | 680 | |
681 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
681 | + echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
682 | 682 | |
683 | - }else{ |
|
684 | - $value = ''; |
|
685 | - if (isset($field_info->css_class)) { |
|
686 | - $value = esc_attr($field_info->css_class); |
|
687 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
688 | - $value = $cf['defaults']['css_class']; |
|
689 | - } |
|
690 | - ?> |
|
683 | + }else{ |
|
684 | + $value = ''; |
|
685 | + if (isset($field_info->css_class)) { |
|
686 | + $value = esc_attr($field_info->css_class); |
|
687 | + }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
688 | + $value = $cf['defaults']['css_class']; |
|
689 | + } |
|
690 | + ?> |
|
691 | 691 | <li> |
692 | 692 | |
693 | 693 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
@@ -700,47 +700,47 @@ discard block |
||
700 | 700 | <div class="gd-cf-input-wrap"> |
701 | 701 | <input type="text" name="css_class" id="css_class" |
702 | 702 | value="<?php if (isset($field_info->css_class)) { |
703 | - echo esc_attr($field_info->css_class); |
|
704 | - }?>"/> |
|
703 | + echo esc_attr($field_info->css_class); |
|
704 | + }?>"/> |
|
705 | 705 | </div> |
706 | 706 | </li> |
707 | 707 | <?php |
708 | - } |
|
708 | + } |
|
709 | 709 | |
710 | 710 | |
711 | - // cat_sort |
|
712 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
711 | + // cat_sort |
|
712 | + if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
713 | 713 | |
714 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
714 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
715 | 715 | |
716 | - }else{ |
|
717 | - $value = ''; |
|
718 | - $hide_cat_sort =''; |
|
719 | - if (isset($field_info->cat_sort)) { |
|
720 | - $value = esc_attr($field_info->cat_sort); |
|
721 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
722 | - $value = $cf['defaults']['cat_sort']; |
|
723 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
724 | - } |
|
716 | + }else{ |
|
717 | + $value = ''; |
|
718 | + $hide_cat_sort =''; |
|
719 | + if (isset($field_info->cat_sort)) { |
|
720 | + $value = esc_attr($field_info->cat_sort); |
|
721 | + }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
722 | + $value = $cf['defaults']['cat_sort']; |
|
723 | + $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
724 | + } |
|
725 | 725 | |
726 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
727 | - ?> |
|
726 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
727 | + ?> |
|
728 | 728 | <li <?php echo $hide_cat_sort ;?>> |
729 | 729 | <h3><?php |
730 | - /** |
|
731 | - * Filter the section title. |
|
732 | - * |
|
733 | - * Filter the section title in custom field form in admin |
|
734 | - * custom fields settings. |
|
735 | - * |
|
736 | - * @since 1.0.0 |
|
737 | - * |
|
738 | - * @param string $title Title of the section. |
|
739 | - * @param string $field_type Current field type. |
|
740 | - */ |
|
741 | - echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type); |
|
742 | - |
|
743 | - ?></h3> |
|
730 | + /** |
|
731 | + * Filter the section title. |
|
732 | + * |
|
733 | + * Filter the section title in custom field form in admin |
|
734 | + * custom fields settings. |
|
735 | + * |
|
736 | + * @since 1.0.0 |
|
737 | + * |
|
738 | + * @param string $title Title of the section. |
|
739 | + * @param string $field_type Current field type. |
|
740 | + */ |
|
741 | + echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type); |
|
742 | + |
|
743 | + ?></h3> |
|
744 | 744 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
745 | 745 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
746 | 746 | <div class="gdcf-tooltip"> |
@@ -752,42 +752,42 @@ discard block |
||
752 | 752 | |
753 | 753 | <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
754 | 754 | <?php if ($value == '1') { |
755 | - echo 'checked'; |
|
756 | - } ?>/> |
|
755 | + echo 'checked'; |
|
756 | + } ?>/> |
|
757 | 757 | <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
758 | 758 | |
759 | 759 | <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
760 | 760 | <?php if (!$value) { |
761 | - echo 'checked'; |
|
762 | - } ?>/> |
|
761 | + echo 'checked'; |
|
762 | + } ?>/> |
|
763 | 763 | <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
764 | 764 | |
765 | 765 | </div> |
766 | 766 | </li> |
767 | 767 | <?php |
768 | - } |
|
769 | - |
|
770 | - |
|
771 | - |
|
772 | - switch ($field_type): |
|
773 | - case 'html': |
|
774 | - case 'file': |
|
775 | - case 'url': |
|
776 | - case 'fieldset': |
|
777 | - break; |
|
778 | - default: |
|
779 | - |
|
780 | - /** |
|
781 | - * Called at the end of the advanced custom fields settings page loop. |
|
782 | - * |
|
783 | - * Can be used to add or deal with different settings types. |
|
784 | - * |
|
785 | - * @since 1.0.0 |
|
786 | - * @since 1.6.6 $cf param added. |
|
787 | - * @param object $field_info The current fields info. |
|
788 | - * @param array $cf The custom field settings |
|
789 | - */ |
|
790 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
768 | + } |
|
769 | + |
|
770 | + |
|
771 | + |
|
772 | + switch ($field_type): |
|
773 | + case 'html': |
|
774 | + case 'file': |
|
775 | + case 'url': |
|
776 | + case 'fieldset': |
|
777 | + break; |
|
778 | + default: |
|
779 | + |
|
780 | + /** |
|
781 | + * Called at the end of the advanced custom fields settings page loop. |
|
782 | + * |
|
783 | + * Can be used to add or deal with different settings types. |
|
784 | + * |
|
785 | + * @since 1.0.0 |
|
786 | + * @since 1.6.6 $cf param added. |
|
787 | + * @param object $field_info The current fields info. |
|
788 | + * @param array $cf The custom field settings |
|
789 | + */ |
|
790 | + do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
791 | 791 | |
792 | 792 | |
793 | 793 | <?php endswitch; ?> |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : ''; |
40 | 40 | |
41 | 41 | |
42 | -if(isset($field_info->extra_fields)){$extra_fields = $field_info->extra_fields;} |
|
42 | +if (isset($field_info->extra_fields)) {$extra_fields = $field_info->extra_fields; } |
|
43 | 43 | $field_info = stripslashes_deep($field_info); // strip slashes from labels |
44 | -if(isset($field_info->extra_fields)){$field_info->extra_fields = $extra_fields;} |
|
44 | +if (isset($field_info->extra_fields)) {$field_info->extra_fields = $extra_fields; } |
|
45 | 45 | |
46 | 46 | |
47 | -$nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
47 | +$nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
48 | 48 | |
49 | 49 | $field_admin_title = ''; |
50 | 50 | if (isset($field_info->admin_title)) |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | |
70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
71 | 71 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
72 | -}elseif(isset($cf['icon']) && $cf['icon']){ |
|
72 | +}elseif (isset($cf['icon']) && $cf['icon']) { |
|
73 | 73 | $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>'; |
74 | -}else{ |
|
74 | +} else { |
|
75 | 75 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
76 | 76 | } |
77 | 77 | |
78 | -if(isset($cf['name']) && $cf['name']){ |
|
78 | +if (isset($cf['name']) && $cf['name']) { |
|
79 | 79 | $field_type_name = $cf['name']; |
80 | -}else{ |
|
80 | +} else { |
|
81 | 81 | $field_type_name = $field_type; |
82 | 82 | } |
83 | 83 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')" > |
93 | 93 | <?php |
94 | 94 | |
95 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
95 | + $nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
96 | 96 | ?> |
97 | 97 | |
98 | 98 | <?php if (!$default): ?> |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
106 | 106 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
107 | 107 | <b style="cursor:pointer;" |
108 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
|
108 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b> |
|
109 | 109 | <?php |
110 | 110 | } else {echo $field_icon; |
111 | 111 | ?> |
112 | 112 | <b style="cursor:pointer;" |
113 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b> |
|
113 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type_name.')'); ?></b> |
|
114 | 114 | <?php |
115 | 115 | } |
116 | 116 | ?> |
@@ -133,43 +133,43 @@ discard block |
||
133 | 133 | } ?>"/> |
134 | 134 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
135 | 135 | |
136 | - <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
|
137 | - <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
138 | - <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
139 | - <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" /> |
|
136 | + <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?> |
|
137 | + <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
138 | + <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
139 | + <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" /> |
|
140 | 140 | |
141 | 141 | <ul class="widefat post fixed" border="0" style="width:100%;"> |
142 | 142 | |
143 | 143 | <?php |
144 | 144 | |
145 | 145 | // data_type |
146 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
146 | + if (has_filter("geodir_cfa_data_type_{$field_type}")) { |
|
147 | 147 | |
148 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
148 | + echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info); |
|
149 | 149 | |
150 | - }else{ |
|
150 | + } else { |
|
151 | 151 | $value = ''; |
152 | 152 | if (isset($field_info->data_type)) { |
153 | 153 | $value = esc_attr($field_info->data_type); |
154 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
154 | + }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) { |
|
155 | 155 | $value = $cf['defaults']['data_type']; |
156 | 156 | } |
157 | 157 | ?> |
158 | - <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
|
158 | + <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/> |
|
159 | 159 | <?php |
160 | 160 | } |
161 | 161 | |
162 | 162 | |
163 | 163 | // admin_title |
164 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
164 | + if (has_filter("geodir_cfa_admin_title_{$field_type}")) { |
|
165 | 165 | |
166 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
166 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
167 | 167 | |
168 | - }else{ |
|
168 | + } else { |
|
169 | 169 | $value = ''; |
170 | 170 | if (isset($field_info->admin_title)) { |
171 | 171 | $value = esc_attr($field_info->admin_title); |
172 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
172 | + }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) { |
|
173 | 173 | $value = $cf['defaults']['admin_title']; |
174 | 174 | } |
175 | 175 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | </label> |
183 | 183 | <div class="gd-cf-input-wrap"> |
184 | 184 | <input type="text" name="admin_title" id="admin_title" |
185 | - value="<?php echo $value;?>"/> |
|
185 | + value="<?php echo $value; ?>"/> |
|
186 | 186 | </div> |
187 | 187 | </li> |
188 | 188 | <?php |
@@ -190,15 +190,15 @@ discard block |
||
190 | 190 | |
191 | 191 | |
192 | 192 | // site_title |
193 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
193 | + if (has_filter("geodir_cfa_site_title_{$field_type}")) { |
|
194 | 194 | |
195 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
195 | + echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
196 | 196 | |
197 | - }else{ |
|
197 | + } else { |
|
198 | 198 | $value = ''; |
199 | 199 | if (isset($field_info->site_title)) { |
200 | 200 | $value = esc_attr($field_info->site_title); |
201 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
201 | + }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) { |
|
202 | 202 | $value = $cf['defaults']['site_title']; |
203 | 203 | } |
204 | 204 | ?> |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | |
219 | 219 | |
220 | 220 | // admin_desc |
221 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
221 | + if (has_filter("geodir_cfa_admin_desc_{$field_type}")) { |
|
222 | 222 | |
223 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
223 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info); |
|
224 | 224 | |
225 | - }else{ |
|
225 | + } else { |
|
226 | 226 | $value = ''; |
227 | 227 | if (isset($field_info->admin_desc)) { |
228 | 228 | $value = esc_attr($field_info->admin_desc); |
229 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
229 | + }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) { |
|
230 | 230 | $value = $cf['defaults']['admin_desc']; |
231 | 231 | } |
232 | 232 | ?> |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | </div> |
238 | 238 | </label> |
239 | 239 | <div class="gd-cf-input-wrap"> |
240 | - <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/> |
|
240 | + <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/> |
|
241 | 241 | </div> |
242 | 242 | </li> |
243 | 243 | <?php |
@@ -246,26 +246,26 @@ discard block |
||
246 | 246 | |
247 | 247 | |
248 | 248 | // htmlvar_name |
249 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
249 | + if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) { |
|
250 | 250 | |
251 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
251 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info); |
|
252 | 252 | |
253 | - }else{ |
|
253 | + } else { |
|
254 | 254 | $value = ''; |
255 | 255 | if (isset($field_info->htmlvar_name)) { |
256 | 256 | $value = esc_attr($field_info->htmlvar_name); |
257 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
257 | + }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) { |
|
258 | 258 | $value = $cf['defaults']['htmlvar_name']; |
259 | 259 | } |
260 | 260 | ?> |
261 | 261 | <li> |
262 | - <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?> |
|
262 | + <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?> |
|
263 | 263 | <div class="gdcf-tooltip"> |
264 | 264 | <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?> |
265 | 265 | </div> |
266 | 266 | </label> |
267 | 267 | <div class="gd-cf-input-wrap"> |
268 | - <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>" |
|
268 | + <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>" |
|
269 | 269 | value="<?php if ($value) { |
270 | 270 | echo preg_replace('/geodir_/', '', $value, 1); |
271 | 271 | }?>" <?php if ($default) { |
@@ -278,15 +278,15 @@ discard block |
||
278 | 278 | |
279 | 279 | |
280 | 280 | // is_active |
281 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
281 | + if (has_filter("geodir_cfa_is_active_{$field_type}")) { |
|
282 | 282 | |
283 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
283 | + echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info); |
|
284 | 284 | |
285 | - }else{ |
|
285 | + } else { |
|
286 | 286 | $value = ''; |
287 | 287 | if (isset($field_info->is_active)) { |
288 | 288 | $value = esc_attr($field_info->is_active); |
289 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
289 | + }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) { |
|
290 | 290 | $value = $cf['defaults']['is_active']; |
291 | 291 | } |
292 | 292 | ?> |
@@ -298,17 +298,17 @@ discard block |
||
298 | 298 | </label> |
299 | 299 | <div class="gd-cf-input-wrap gd-switch"> |
300 | 300 | |
301 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
301 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
302 | 302 | <?php if ($value == '1') { |
303 | 303 | echo 'checked'; |
304 | 304 | } ?>/> |
305 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
305 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
306 | 306 | |
307 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
307 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
308 | 308 | <?php if ($value == '0' || !$value) { |
309 | 309 | echo 'checked'; |
310 | 310 | } ?>/> |
311 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
311 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
312 | 312 | |
313 | 313 | </div> |
314 | 314 | </li> |
@@ -317,15 +317,15 @@ discard block |
||
317 | 317 | |
318 | 318 | |
319 | 319 | // for_admin_use |
320 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
320 | + if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) { |
|
321 | 321 | |
322 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
322 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info); |
|
323 | 323 | |
324 | - }else{ |
|
324 | + } else { |
|
325 | 325 | $value = ''; |
326 | 326 | if (isset($field_info->for_admin_use)) { |
327 | 327 | $value = esc_attr($field_info->for_admin_use); |
328 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
328 | + }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) { |
|
329 | 329 | $value = $cf['defaults']['for_admin_use']; |
330 | 330 | } |
331 | 331 | ?> |
@@ -337,17 +337,17 @@ discard block |
||
337 | 337 | </label> |
338 | 338 | <div class="gd-cf-input-wrap gd-switch"> |
339 | 339 | |
340 | - <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
340 | + <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
341 | 341 | <?php if ($value == '1') { |
342 | 342 | echo 'checked'; |
343 | 343 | } ?>/> |
344 | - <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
344 | + <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
345 | 345 | |
346 | - <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
346 | + <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
347 | 347 | <?php if ($value == '0' || !$value) { |
348 | 348 | echo 'checked'; |
349 | 349 | } ?>/> |
350 | - <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
350 | + <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
351 | 351 | |
352 | 352 | </div> |
353 | 353 | </li> |
@@ -356,20 +356,20 @@ discard block |
||
356 | 356 | |
357 | 357 | |
358 | 358 | // default_value |
359 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
359 | + if (has_filter("geodir_cfa_default_value_{$field_type}")) { |
|
360 | 360 | |
361 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
361 | + echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info); |
|
362 | 362 | |
363 | - }else{ |
|
363 | + } else { |
|
364 | 364 | $value = ''; |
365 | 365 | if (isset($field_info->default_value)) { |
366 | 366 | $value = esc_attr($field_info->default_value); |
367 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
367 | + }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) { |
|
368 | 368 | $value = $cf['defaults']['default_value']; |
369 | 369 | } |
370 | 370 | ?> |
371 | 371 | <li> |
372 | - <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
|
372 | + <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?> |
|
373 | 373 | <div class="gdcf-tooltip"> |
374 | 374 | <?php |
375 | 375 | if ($field_type == 'checkbox') { |
@@ -386,12 +386,12 @@ discard block |
||
386 | 386 | <?php if ($field_type == 'checkbox') { ?> |
387 | 387 | <select name="default_value" id="default_value"> |
388 | 388 | <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option> |
389 | - <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
389 | + <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
390 | 390 | </select> |
391 | 391 | <?php } else if ($field_type == 'email') { ?> |
392 | - <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
392 | + <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
393 | 393 | <?php } else { ?> |
394 | - <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
394 | + <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
395 | 395 | <?php } ?> |
396 | 396 | </div> |
397 | 397 | </li> |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | |
401 | 401 | |
402 | 402 | // show_in |
403 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
403 | + if (has_filter("geodir_cfa_show_in_{$field_type}")) { |
|
404 | 404 | |
405 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
405 | + echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info); |
|
406 | 406 | |
407 | - }else{ |
|
407 | + } else { |
|
408 | 408 | $value = ''; |
409 | 409 | if (isset($field_info->show_in)) { |
410 | 410 | $value = esc_attr($field_info->show_in); |
411 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
411 | + }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) { |
|
412 | 412 | $value = esc_attr($cf['defaults']['show_in']); |
413 | 413 | } |
414 | 414 | ?> |
@@ -441,18 +441,18 @@ discard block |
||
441 | 441 | * @param object $field_info The field being displayed info. |
442 | 442 | * @param string $field_info The type of field. |
443 | 443 | */ |
444 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
444 | + $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type); |
|
445 | 445 | |
446 | 446 | |
447 | 447 | // remove some locations for some field types |
448 | 448 | |
449 | 449 | // don't show new tab option for some types |
450 | - if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
|
451 | - }else{ |
|
450 | + if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) { |
|
451 | + } else { |
|
452 | 452 | unset($show_in_locations['[owntab]']); |
453 | 453 | } |
454 | 454 | |
455 | - if(!$display_on_listing){ |
|
455 | + if (!$display_on_listing) { |
|
456 | 456 | unset($show_in_locations['[listings]']); |
457 | 457 | } |
458 | 458 | |
@@ -466,17 +466,17 @@ discard block |
||
466 | 466 | option-ajaxchosen="false"> |
467 | 467 | <?php |
468 | 468 | |
469 | - $show_in_values = explode(',',$value); |
|
469 | + $show_in_values = explode(',', $value); |
|
470 | 470 | |
471 | - foreach( $show_in_locations as $key => $val){ |
|
471 | + foreach ($show_in_locations as $key => $val) { |
|
472 | 472 | $selected = ''; |
473 | 473 | |
474 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
474 | + if (is_array($show_in_values) && in_array($key, $show_in_values)) { |
|
475 | 475 | $selected = 'selected'; |
476 | 476 | } |
477 | 477 | |
478 | 478 | ?> |
479 | - <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
|
479 | + <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option> |
|
480 | 480 | <?php |
481 | 481 | } |
482 | 482 | ?> |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | |
489 | 489 | |
490 | 490 | // advanced_editor |
491 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
491 | + if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) { |
|
492 | 492 | |
493 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
493 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info); |
|
494 | 494 | |
495 | 495 | } |
496 | 496 | |
@@ -501,10 +501,10 @@ discard block |
||
501 | 501 | |
502 | 502 | |
503 | 503 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
504 | - <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/> |
|
504 | + <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/> |
|
505 | 505 | |
506 | 506 | <?php // we dont need to show the sort order ?> |
507 | - <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/> |
|
507 | + <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/> |
|
508 | 508 | |
509 | 509 | |
510 | 510 | |
@@ -557,15 +557,15 @@ discard block |
||
557 | 557 | <?php |
558 | 558 | |
559 | 559 | // is_required |
560 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
560 | + if (has_filter("geodir_cfa_is_required_{$field_type}")) { |
|
561 | 561 | |
562 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
562 | + echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info); |
|
563 | 563 | |
564 | - }else{ |
|
564 | + } else { |
|
565 | 565 | $value = ''; |
566 | 566 | if (isset($field_info->is_required)) { |
567 | 567 | $value = esc_attr($field_info->is_required); |
568 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
568 | + }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) { |
|
569 | 569 | $value = $cf['defaults']['is_required']; |
570 | 570 | } |
571 | 571 | ?> |
@@ -578,17 +578,17 @@ discard block |
||
578 | 578 | |
579 | 579 | <div class="gd-cf-input-wrap gd-switch"> |
580 | 580 | |
581 | - <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
|
581 | + <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled" value="1" |
|
582 | 582 | <?php if ($value == '1') { |
583 | 583 | echo 'checked'; |
584 | 584 | } ?>/> |
585 | - <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
585 | + <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
586 | 586 | |
587 | - <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
|
587 | + <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0" |
|
588 | 588 | <?php if ($value == '0' || !$value) { |
589 | 589 | echo 'checked'; |
590 | 590 | } ?>/> |
591 | - <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
591 | + <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
592 | 592 | |
593 | 593 | </div> |
594 | 594 | |
@@ -598,19 +598,19 @@ discard block |
||
598 | 598 | } |
599 | 599 | |
600 | 600 | // required_msg |
601 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
601 | + if (has_filter("geodir_cfa_required_msg_{$field_type}")) { |
|
602 | 602 | |
603 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
603 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info); |
|
604 | 604 | |
605 | - }else{ |
|
605 | + } else { |
|
606 | 606 | $value = ''; |
607 | 607 | if (isset($field_info->required_msg)) { |
608 | 608 | $value = esc_attr($field_info->required_msg); |
609 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
609 | + }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) { |
|
610 | 610 | $value = $cf['defaults']['required_msg']; |
611 | 611 | } |
612 | 612 | ?> |
613 | - <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>> |
|
613 | + <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>> |
|
614 | 614 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
615 | 615 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
616 | 616 | <div class="gdcf-tooltip"> |
@@ -627,31 +627,31 @@ discard block |
||
627 | 627 | |
628 | 628 | |
629 | 629 | // required_msg |
630 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
630 | + if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) { |
|
631 | 631 | |
632 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
632 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info); |
|
633 | 633 | |
634 | 634 | } |
635 | 635 | |
636 | 636 | |
637 | 637 | // extra_fields |
638 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
638 | + if (has_filter("geodir_cfa_extra_fields_{$field_type}")) { |
|
639 | 639 | |
640 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
640 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info); |
|
641 | 641 | |
642 | 642 | } |
643 | 643 | |
644 | 644 | |
645 | 645 | // field_icon |
646 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
646 | + if (has_filter("geodir_cfa_field_icon_{$field_type}")) { |
|
647 | 647 | |
648 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
648 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info); |
|
649 | 649 | |
650 | - }else{ |
|
650 | + } else { |
|
651 | 651 | $value = ''; |
652 | 652 | if (isset($field_info->field_icon)) { |
653 | 653 | $value = esc_attr($field_info->field_icon); |
654 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
654 | + }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) { |
|
655 | 655 | $value = $cf['defaults']['field_icon']; |
656 | 656 | } |
657 | 657 | ?> |
@@ -662,12 +662,12 @@ discard block |
||
662 | 662 | <label for="field_icon" class="gd-cf-tooltip-wrap"> |
663 | 663 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?> |
664 | 664 | <div class="gdcf-tooltip"> |
665 | - <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?> |
|
665 | + <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?> |
|
666 | 666 | </div> |
667 | 667 | </label> |
668 | 668 | <div class="gd-cf-input-wrap"> |
669 | 669 | <input type="text" name="field_icon" id="field_icon" |
670 | - value="<?php echo $value;?>"/> |
|
670 | + value="<?php echo $value; ?>"/> |
|
671 | 671 | </div> |
672 | 672 | |
673 | 673 | </li> |
@@ -676,15 +676,15 @@ discard block |
||
676 | 676 | |
677 | 677 | |
678 | 678 | // css_class |
679 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
679 | + if (has_filter("geodir_cfa_css_class_{$field_type}")) { |
|
680 | 680 | |
681 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
681 | + echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info); |
|
682 | 682 | |
683 | - }else{ |
|
683 | + } else { |
|
684 | 684 | $value = ''; |
685 | 685 | if (isset($field_info->css_class)) { |
686 | 686 | $value = esc_attr($field_info->css_class); |
687 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
687 | + }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) { |
|
688 | 688 | $value = $cf['defaults']['css_class']; |
689 | 689 | } |
690 | 690 | ?> |
@@ -693,8 +693,8 @@ discard block |
||
693 | 693 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
694 | 694 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?> |
695 | 695 | <div class="gdcf-tooltip"> |
696 | - <?php _e('Enter custom css class for field custom style.', 'geodirectory');?> |
|
697 | - <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?> |
|
696 | + <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?> |
|
697 | + <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?> |
|
698 | 698 | </div> |
699 | 699 | </label> |
700 | 700 | <div class="gd-cf-input-wrap"> |
@@ -709,23 +709,23 @@ discard block |
||
709 | 709 | |
710 | 710 | |
711 | 711 | // cat_sort |
712 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
712 | + if (has_filter("geodir_cfa_cat_sort_{$field_type}")) { |
|
713 | 713 | |
714 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
714 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info); |
|
715 | 715 | |
716 | - }else{ |
|
716 | + } else { |
|
717 | 717 | $value = ''; |
718 | - $hide_cat_sort =''; |
|
718 | + $hide_cat_sort = ''; |
|
719 | 719 | if (isset($field_info->cat_sort)) { |
720 | 720 | $value = esc_attr($field_info->cat_sort); |
721 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
721 | + }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) { |
|
722 | 722 | $value = $cf['defaults']['cat_sort']; |
723 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
723 | + $hide_cat_sort = ($value === false) ? "style='display:none;'" : ''; |
|
724 | 724 | } |
725 | 725 | |
726 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
726 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : ''; |
|
727 | 727 | ?> |
728 | - <li <?php echo $hide_cat_sort ;?>> |
|
728 | + <li <?php echo $hide_cat_sort; ?>> |
|
729 | 729 | <h3><?php |
730 | 730 | /** |
731 | 731 | * Filter the section title. |
@@ -744,23 +744,23 @@ discard block |
||
744 | 744 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
745 | 745 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
746 | 746 | <div class="gdcf-tooltip"> |
747 | - <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?> |
|
747 | + <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?> |
|
748 | 748 | </div> |
749 | 749 | </label> |
750 | 750 | |
751 | 751 | <div class="gd-cf-input-wrap gd-switch"> |
752 | 752 | |
753 | - <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
|
753 | + <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled" value="1" |
|
754 | 754 | <?php if ($value == '1') { |
755 | 755 | echo 'checked'; |
756 | 756 | } ?>/> |
757 | - <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
757 | + <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
758 | 758 | |
759 | - <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
|
759 | + <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0" |
|
760 | 760 | <?php if (!$value) { |
761 | 761 | echo 'checked'; |
762 | 762 | } ?>/> |
763 | - <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
763 | + <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
764 | 764 | |
765 | 765 | </div> |
766 | 766 | </li> |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | * @param object $field_info The current fields info. |
788 | 788 | * @param array $cf The custom field settings |
789 | 789 | */ |
790 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
790 | + do_action('geodir_advance_custom_fields', $field_info, $cf); ?> |
|
791 | 791 | |
792 | 792 | |
793 | 793 | <?php endswitch; ?> |
@@ -799,10 +799,10 @@ discard block |
||
799 | 799 | <h3></h3> |
800 | 800 | </label> |
801 | 801 | <div class="gd-cf-input-wrap"> |
802 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>" |
|
802 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>" |
|
803 | 803 | onclick="save_field('<?php echo esc_attr($result_str); ?>')"/> |
804 | 804 | <?php if (!$default): ?> |
805 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>" |
|
805 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>" |
|
806 | 806 | onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')" |
807 | 807 | class="button"/></a> |
808 | 808 | <?php endif; ?> |
@@ -19,8 +19,9 @@ discard block |
||
19 | 19 | |
20 | 20 | if (!isset($field_info->post_type)) { |
21 | 21 | $post_type = sanitize_text_field($_REQUEST['listing_type']); |
22 | -} else |
|
23 | - $post_type = $field_info->post_type; |
|
22 | +} else { |
|
23 | + $post_type = $field_info->post_type; |
|
24 | +} |
|
24 | 25 | |
25 | 26 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){ |
26 | 27 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -47,8 +48,9 @@ discard block |
||
47 | 48 | $nonce = wp_create_nonce('custom_fields_' . $result_str); |
48 | 49 | |
49 | 50 | $field_admin_title = ''; |
50 | -if (isset($field_info->admin_title)) |
|
51 | - $field_admin_title = $field_info->admin_title; |
|
51 | +if (isset($field_info->admin_title)) { |
|
52 | + $field_admin_title = $field_info->admin_title; |
|
53 | +} |
|
52 | 54 | |
53 | 55 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
54 | 56 | |
@@ -69,15 +71,15 @@ discard block |
||
69 | 71 | |
70 | 72 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
71 | 73 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
72 | -}elseif(isset($cf['icon']) && $cf['icon']){ |
|
74 | +} elseif(isset($cf['icon']) && $cf['icon']){ |
|
73 | 75 | $field_icon = '<b class="gd-cf-icon" style="background-image: url(\''.$cf['icon'].'\')"></b>'; |
74 | -}else{ |
|
76 | +} else{ |
|
75 | 77 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
76 | 78 | } |
77 | 79 | |
78 | 80 | if(isset($cf['name']) && $cf['name']){ |
79 | 81 | $field_type_name = $cf['name']; |
80 | -}else{ |
|
82 | +} else{ |
|
81 | 83 | $field_type_name = $field_type; |
82 | 84 | } |
83 | 85 | |
@@ -147,11 +149,11 @@ discard block |
||
147 | 149 | |
148 | 150 | echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
149 | 151 | |
150 | - }else{ |
|
152 | + } else{ |
|
151 | 153 | $value = ''; |
152 | 154 | if (isset($field_info->data_type)) { |
153 | 155 | $value = esc_attr($field_info->data_type); |
154 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
156 | + } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
155 | 157 | $value = $cf['defaults']['data_type']; |
156 | 158 | } |
157 | 159 | ?> |
@@ -165,11 +167,11 @@ discard block |
||
165 | 167 | |
166 | 168 | echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
167 | 169 | |
168 | - }else{ |
|
170 | + } else{ |
|
169 | 171 | $value = ''; |
170 | 172 | if (isset($field_info->admin_title)) { |
171 | 173 | $value = esc_attr($field_info->admin_title); |
172 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
174 | + } elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
173 | 175 | $value = $cf['defaults']['admin_title']; |
174 | 176 | } |
175 | 177 | ?> |
@@ -194,11 +196,11 @@ discard block |
||
194 | 196 | |
195 | 197 | echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
196 | 198 | |
197 | - }else{ |
|
199 | + } else{ |
|
198 | 200 | $value = ''; |
199 | 201 | if (isset($field_info->site_title)) { |
200 | 202 | $value = esc_attr($field_info->site_title); |
201 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
203 | + } elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
202 | 204 | $value = $cf['defaults']['site_title']; |
203 | 205 | } |
204 | 206 | ?> |
@@ -222,11 +224,11 @@ discard block |
||
222 | 224 | |
223 | 225 | echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
224 | 226 | |
225 | - }else{ |
|
227 | + } else{ |
|
226 | 228 | $value = ''; |
227 | 229 | if (isset($field_info->admin_desc)) { |
228 | 230 | $value = esc_attr($field_info->admin_desc); |
229 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
231 | + } elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
230 | 232 | $value = $cf['defaults']['admin_desc']; |
231 | 233 | } |
232 | 234 | ?> |
@@ -250,11 +252,11 @@ discard block |
||
250 | 252 | |
251 | 253 | echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
252 | 254 | |
253 | - }else{ |
|
255 | + } else{ |
|
254 | 256 | $value = ''; |
255 | 257 | if (isset($field_info->htmlvar_name)) { |
256 | 258 | $value = esc_attr($field_info->htmlvar_name); |
257 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
259 | + } elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
258 | 260 | $value = $cf['defaults']['htmlvar_name']; |
259 | 261 | } |
260 | 262 | ?> |
@@ -282,11 +284,11 @@ discard block |
||
282 | 284 | |
283 | 285 | echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
284 | 286 | |
285 | - }else{ |
|
287 | + } else{ |
|
286 | 288 | $value = ''; |
287 | 289 | if (isset($field_info->is_active)) { |
288 | 290 | $value = esc_attr($field_info->is_active); |
289 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
291 | + } elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
290 | 292 | $value = $cf['defaults']['is_active']; |
291 | 293 | } |
292 | 294 | ?> |
@@ -321,11 +323,11 @@ discard block |
||
321 | 323 | |
322 | 324 | echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
323 | 325 | |
324 | - }else{ |
|
326 | + } else{ |
|
325 | 327 | $value = ''; |
326 | 328 | if (isset($field_info->for_admin_use)) { |
327 | 329 | $value = esc_attr($field_info->for_admin_use); |
328 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
330 | + } elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
329 | 331 | $value = $cf['defaults']['for_admin_use']; |
330 | 332 | } |
331 | 333 | ?> |
@@ -360,11 +362,11 @@ discard block |
||
360 | 362 | |
361 | 363 | echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
362 | 364 | |
363 | - }else{ |
|
365 | + } else{ |
|
364 | 366 | $value = ''; |
365 | 367 | if (isset($field_info->default_value)) { |
366 | 368 | $value = esc_attr($field_info->default_value); |
367 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
369 | + } elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
368 | 370 | $value = $cf['defaults']['default_value']; |
369 | 371 | } |
370 | 372 | ?> |
@@ -404,11 +406,11 @@ discard block |
||
404 | 406 | |
405 | 407 | echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
406 | 408 | |
407 | - }else{ |
|
409 | + } else{ |
|
408 | 410 | $value = ''; |
409 | 411 | if (isset($field_info->show_in)) { |
410 | 412 | $value = esc_attr($field_info->show_in); |
411 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
413 | + } elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
412 | 414 | $value = esc_attr($cf['defaults']['show_in']); |
413 | 415 | } |
414 | 416 | ?> |
@@ -448,7 +450,7 @@ discard block |
||
448 | 450 | |
449 | 451 | // don't show new tab option for some types |
450 | 452 | if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) { |
451 | - }else{ |
|
453 | + } else{ |
|
452 | 454 | unset($show_in_locations['[owntab]']); |
453 | 455 | } |
454 | 456 | |
@@ -561,11 +563,11 @@ discard block |
||
561 | 563 | |
562 | 564 | echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
563 | 565 | |
564 | - }else{ |
|
566 | + } else{ |
|
565 | 567 | $value = ''; |
566 | 568 | if (isset($field_info->is_required)) { |
567 | 569 | $value = esc_attr($field_info->is_required); |
568 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
570 | + } elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
569 | 571 | $value = $cf['defaults']['is_required']; |
570 | 572 | } |
571 | 573 | ?> |
@@ -602,11 +604,11 @@ discard block |
||
602 | 604 | |
603 | 605 | echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
604 | 606 | |
605 | - }else{ |
|
607 | + } else{ |
|
606 | 608 | $value = ''; |
607 | 609 | if (isset($field_info->required_msg)) { |
608 | 610 | $value = esc_attr($field_info->required_msg); |
609 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
611 | + } elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
610 | 612 | $value = $cf['defaults']['required_msg']; |
611 | 613 | } |
612 | 614 | ?> |
@@ -647,11 +649,11 @@ discard block |
||
647 | 649 | |
648 | 650 | echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
649 | 651 | |
650 | - }else{ |
|
652 | + } else{ |
|
651 | 653 | $value = ''; |
652 | 654 | if (isset($field_info->field_icon)) { |
653 | 655 | $value = esc_attr($field_info->field_icon); |
654 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
656 | + } elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
655 | 657 | $value = $cf['defaults']['field_icon']; |
656 | 658 | } |
657 | 659 | ?> |
@@ -680,11 +682,11 @@ discard block |
||
680 | 682 | |
681 | 683 | echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
682 | 684 | |
683 | - }else{ |
|
685 | + } else{ |
|
684 | 686 | $value = ''; |
685 | 687 | if (isset($field_info->css_class)) { |
686 | 688 | $value = esc_attr($field_info->css_class); |
687 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
689 | + } elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
688 | 690 | $value = $cf['defaults']['css_class']; |
689 | 691 | } |
690 | 692 | ?> |
@@ -713,12 +715,12 @@ discard block |
||
713 | 715 | |
714 | 716 | echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
715 | 717 | |
716 | - }else{ |
|
718 | + } else{ |
|
717 | 719 | $value = ''; |
718 | 720 | $hide_cat_sort =''; |
719 | 721 | if (isset($field_info->cat_sort)) { |
720 | 722 | $value = esc_attr($field_info->cat_sort); |
721 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
723 | + } elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
722 | 724 | $value = $cf['defaults']['cat_sort']; |
723 | 725 | $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
724 | 726 | } |