PluginProbe
Property Hive / 1.4.56
Property Hive v1.4.56
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / admin / settings / class-ph-settings-general.php

class-ph-settings-general.php in Property Hive 1.4.56, at includes/admin/settings/class-ph-settings-general.php

621 lines 26.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PropertyHive General Settings
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin
8 * @version 1.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 if ( ! class_exists( 'PH_Settings_General' ) ) :
16
17 /**
18 * PH_Settings_General
19 */
20 class PH_Settings_General extends PH_Settings_Page {
21
22 /**
23 * Constructor.
24 */
25 public function __construct() {
26 $this->id = 'general';
27 $this->label = __( 'General', 'propertyhive' );
28
29 add_filter( 'propertyhive_settings_tabs_array', array( $this, 'add_settings_page' ), 5 );
30 add_action( 'propertyhive_sections_' . $this->id, array( $this, 'output_sections' ) );
31 add_action( 'propertyhive_settings_' . $this->id, array( $this, 'output' ) );
32 add_action( 'propertyhive_settings_save_' . $this->id, array( $this, 'save' ) );
33 }
34
35 /**
36 * Get sections
37 *
38 * @return array
39 */
40 public function get_sections() {
41 $sections = array(
42 '' => __( 'General', 'propertyhive' ),
43 'modules' => __( 'Modules', 'propertyhive' ),
44 'international' => __( 'International', 'propertyhive' ),
45 'map' => __( 'Map', 'propertyhive' ),
46 'gdpr' => __( 'GDPR', 'propertyhive' ),
47 'misc' => __( 'Miscellaneous', 'propertyhive' ),
48 );
49
50 return $sections;
51 }
52
53
54 /**
55 * Get general settings array
56 *
57 * @return array
58 */
59 public function get_settings() {
60
61 $departments = ph_get_departments();
62
63 $settings = array(
64
65 array( 'title' => __( 'General Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
66
67 );
68
69 $i = 0;
70 foreach ( $departments as $key => $value )
71 {
72 $checkboxgroup = 'middle';
73 if ( $i == 0 ) { $checkboxgroup = 'start'; }
74 if ( $i == (count($departments) - 1) ) { $checkboxgroup = 'end'; }
75
76 $settings[] = array(
77 'title' => __( 'Active Departments', 'propertyhive' ),
78 'desc' => $value,
79 'id' => 'propertyhive_active_departments_' . str_replace("residential-", "", $key),
80 'type' => 'checkbox',
81 'default' => ( ( in_array($key, array('residential-sales', 'residential-lettings', 'commercial')) ) ? 'yes' : '' ),
82 'checkboxgroup' => $checkboxgroup,
83 );
84
85 ++$i;
86 }
87
88 $settings[] = array(
89 'title' => __( 'Primary Department', 'propertyhive' ),
90 'id' => 'propertyhive_primary_department',
91 'type' => 'radio',
92 'default' => 'residential-sales',
93 'options' => $departments,
94 );
95
96 $settings[] = array(
97 'title' => __( 'Property Search Results Page', 'propertyhive' ),
98 //'desc' => '<br/>' . sprintf( __( 'The base page can also be used in your <a href="%s">product permalinks</a>.', 'propertyhive' ), admin_url( 'options-permalink.php' ) ),
99 'id' => 'propertyhive_search_results_page_id',
100 'type' => 'single_select_page',
101 'default' => '',
102 'css' => 'min-width:300px;',
103 'desc' => __( 'This sets the page of your property search results', 'propertyhive' ),
104 );
105
106 $settings[] = array(
107 'title' => __( 'Lettings Fees (Residential)', 'propertyhive' ),
108 'id' => 'propertyhive_lettings_fees',
109 'type' => 'textarea',
110 'css' => 'height:150px; width:100%; max-width:400px'
111 );
112
113 $settings[] = array(
114 'title' => __( 'Lettings Fees (Commercial)', 'propertyhive' ),
115 'id' => 'propertyhive_lettings_fees_commercial',
116 'type' => 'textarea',
117 'css' => 'height:150px; width:100%; max-width:400px'
118 );
119
120 $settings[] = array(
121 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
122 'desc' => __( 'In Search Results', 'propertyhive' ),
123 'id' => 'propertyhive_lettings_fees_display_search_results',
124 'type' => 'checkbox',
125 'checkboxgroup' => 'start',
126 );
127
128 $settings[] = array(
129 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
130 'desc' => __( 'On Property Details Page', 'propertyhive' ),
131 'id' => 'propertyhive_lettings_fees_display_single_property',
132 'type' => 'checkbox',
133 'checkboxgroup' => 'end',
134 );
135
136 $settings[] = array( 'type' => 'sectionend', 'id' => 'general_options');
137
138 return apply_filters( 'propertyhive_general_settings', $settings );
139 }
140
141 /**
142 * Get general modules settings array
143 *
144 * @return array
145 */
146 public function get_general_modules_setting() {
147
148 return apply_filters( 'propertyhive_general_modules_settings', array(
149
150 array( 'title' => __( 'Disabled Modules', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'modules_options' ),
151
152 array(
153 'type' => 'html',
154 'html' => __( 'Here you can choose which modules are enabled or disabled within Property Hive. Check the modules you <strong>DO NOT</strong> wish to use from the list below', 'propertyhive' ) . ':',
155 ),
156
157 array(
158 'title' => __( 'Disabled Modules', 'propertyhive' ),
159 'desc' => __( 'Contacts (Applicants, Owners/Landlords and Third Party Contacts)', 'propertyhive' ),
160 'id' => 'propertyhive_module_disabled_contacts',
161 'type' => 'checkbox',
162 'default' => '',
163 'checkboxgroup' => 'start'
164 ),
165
166 array(
167 'title' => __( 'Disabled Modules', 'propertyhive' ),
168 'desc' => __( 'Appraisals', 'propertyhive' ),
169 'id' => 'propertyhive_module_disabled_appraisals',
170 'type' => 'checkbox',
171 'default' => '',
172 'checkboxgroup' => 'middle'
173 ),
174
175 array(
176 'title' => __( 'Disabled Modules', 'propertyhive' ),
177 'desc' => __( 'Viewings', 'propertyhive' ),
178 'id' => 'propertyhive_module_disabled_viewings',
179 'type' => 'checkbox',
180 'default' => '',
181 'checkboxgroup' => 'middle'
182 ),
183
184 array(
185 'title' => __( 'Disabled Modules', 'propertyhive' ),
186 'desc' => __( 'Offers and Sales', 'propertyhive' ),
187 'id' => 'propertyhive_module_disabled_offers_sales',
188 'type' => 'checkbox',
189 'default' => '',
190 'checkboxgroup' => 'middle'
191 ),
192
193 array(
194 'title' => __( 'Disabled Modules', 'propertyhive' ),
195 'desc' => __( 'Enquiries', 'propertyhive' ),
196 'id' => 'propertyhive_module_disabled_enquiries',
197 'type' => 'checkbox',
198 'default' => '',
199 'checkboxgroup' => 'end'
200 ),
201
202 array( 'type' => 'sectionend', 'id' => 'modules_options'),
203
204 ) ); // End general module settings
205 }
206
207 /**
208 * Get international settings array
209 *
210 * @return array
211 */
212 public function get_general_international_setting() {
213
214 $settings = array(
215
216 array( 'title' => __( 'International Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'international_options' ),
217
218 array(
219 'title' => __( 'Default Country', 'propertyhive' ),
220 'id' => 'propertyhive_default_country',
221 'type' => 'single_select_country',
222 'css' => 'min-width:300px;',
223 ),
224
225 array(
226 'title' => __( 'Countries Where You Operate', 'propertyhive' ),
227 'id' => 'propertyhive_countries',
228 'type' => 'multi_select_countries',
229 'css' => 'min-width:300px;',
230 'desc' => __( 'Hold ctrl/cmd whilst clicking to select multiple', 'propertyhive' )
231 ),
232
233 array(
234 'title' => __( 'Price Thousand Separator', 'propertyhive' ),
235 'id' => 'propertyhive_price_thousand_separator',
236 'type' => 'text',
237 'default' => ',',
238 'css' => 'width:50px;',
239 ),
240
241 array(
242 'title' => __( 'Price Decimal Separator', 'propertyhive' ),
243 'id' => 'propertyhive_price_decimal_separator',
244 'type' => 'text',
245 'default' => '.',
246 'css' => 'width:50px;',
247 )
248 );
249
250 $ph_countries = new PH_Countries();
251 $ph_countries = $ph_countries->countries;
252
253 $currencies = array();
254 $countries = array();
255 if ( !empty($ph_countries) )
256 {
257 foreach ( $ph_countries as $country_code => $country )
258 {
259 $currencies[$country['currency_code']] = $country['currency_code'];
260 $countries[$country_code] = $country;
261 }
262 }
263 $currencies = array_unique($currencies);
264 ksort($currencies);
265
266 $settings[] = array(
267 'title' => __( 'Currency Used In Search Forms', 'propertyhive' ),
268 'id' => 'propertyhive_search_form_currency',
269 'type' => 'select',
270 'options' => $currencies,
271 'default' => 'GBP',
272 'desc' => __( 'Please note that this doesn\'t change the currency symbol shown in price dropdowns within search forms. The easiest way to achieve that is to use our free <a href="https://wp-property-hive.com/addons/template-assistant/" target="_blank">Template Assistant add on</a>.', 'propertyhive' ),
273 );
274
275 $settings[] = array( 'type' => 'sectionend', 'id' => 'international_options');
276
277 $settings[] = array(
278 'type' => 'html',
279 'html' => '<script>
280
281 var countries = '. json_encode( $countries ) . ';
282
283 </script>'
284 );
285
286 return apply_filters( 'propertyhive_general_international_settings', $settings );
287 }
288
289 /**
290 * Get map settings array
291 *
292 * @return array
293 */
294 public function get_general_map_setting() {
295
296 $settings = array(
297
298 array( 'title' => __( 'Map Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'map_options' ),
299
300 array(
301 'title' => __( 'Google Maps API Key', 'propertyhive' ),
302 'id' => 'propertyhive_google_maps_api_key',
303 'type' => 'text',
304 'desc' => '<p>' . __( 'If you have a Google Maps API key you can enter it here. You can generate an API key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">here</a>.<br>This is used when displaying the map when adding/editing properties, and if using our <a href="https://wp-property-hive.com/addons/map-search/" target="_blank">Map Search</a> or <a href="https://wp-property-hive.com/addons/radial-search/" target="_blank">Radial Search</a> add ons.<br>When creating your API key we recommend that you enable the Geocoding library. More about this can be found <a href="https://docs.wp-property-hive.com/user-guide/maps-co-ordinates-and-geocoding/" target="_blank">here</a>.', 'propertyhive' ) . '</p>'
305 )
306
307 );
308
309 if ( apply_filters( 'propertyhive_use_google_maps_geocoding_api_key', false) === true )
310 {
311 $settings[] = array(
312 'title' => __( 'Google Maps Geocoding API Key', 'propertyhive' ),
313 'id' => 'propertyhive_google_maps_geocoding_api_key',
314 'type' => 'text',
315 'desc' => '<p>' . __( 'If you have referer restrictions applied to the main API key entered then server side geocoding requests will be blocked. To get around this you can setup a separate API key specifically for geocoding and enter it here, with IP restrictions applied instead if required.<br>More about this can be found <a href="https://docs.wp-property-hive.com/user-guide/maps-co-ordinates-and-geocoding/" target="_blank">here</a>.', 'propertyhive' ) . '</p>'
316 );
317 }
318
319 $settings[] = array( 'type' => 'sectionend', 'id' => 'map_options');
320
321 return apply_filters( 'propertyhive_general_map_settings', $settings );
322 }
323
324 /**
325 * Get GDPR settings array
326 *
327 * @return array
328 */
329 public function get_general_gdpr_setting() {
330
331 return apply_filters( 'propertyhive_general_gdpr_settings', array(
332
333 array( 'title' => __( 'GDPR Settings', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'gdpr_options' ),
334
335 array(
336 'title' => __( 'Store Property Enquiries', 'propertyhive' ),
337 'id' => 'propertyhive_store_property_enquiries',
338 'type' => 'checkbox',
339 'default' => 'yes',
340 'desc' => __( 'If using the default property enquiry form that comes with Property Hive, select this option if enquiries should be saved in the \'Enquiries\' section of Property Hive. Note that regardless of whether this is ticked or not, the enquiry will still be sent via email. This option simply determines whether we save it to the database or not.', 'propertyhive' )
341 ),
342
343 array(
344 'title' => __( 'Property Enquiry Form Disclaimer', 'propertyhive' ),
345 'id' => 'propertyhive_property_enquiry_form_disclaimer',
346 'type' => 'wysiwyg',
347 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the property enquiry form.', 'propertyhive' )
348 ),
349
350 array(
351 'title' => __( 'Applicant Registration Form Disclaimer', 'propertyhive' ),
352 'id' => 'propertyhive_applicant_registration_form_disclaimer',
353 'type' => 'wysiwyg',
354 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the applicant registration form.', 'propertyhive' )
355 ),
356
357 array( 'type' => 'sectionend', 'id' => 'gdpr_options'),
358
359 ) ); // End general GDPR settings
360 }
361
362 /**
363 * Get misc settings array
364 *
365 * @return array
366 */
367 public function get_general_misc_setting() {
368
369 return apply_filters( 'propertyhive_general_misc_settings', array(
370
371 array( 'title' => __( 'Property Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'property_options' ),
372
373 array(
374 'title' => __( 'Search By Address Should', 'propertyhive' ),
375 'id' => 'propertyhive_address_keyword_compare',
376 'type' => 'radio',
377 'default' => '=',
378 'options' => array(
379 '=' => __( 'Match Keyword Exactly', 'propertyhive' ),
380 'LIKE' => __( 'Perform Loose Search', 'propertyhive' ),
381 ),
382 'desc_tip' => __( 'Applicable if you allow users to search by entering a location. If \'Match Keyword Exactly\' is selected a search for \'Walton\' would not return properties in \'Walton On Thames\', but would prevent properties in \'Lincolnshire\' appearing when searching for \'Lincoln\'. \'Perform Loose Search\' would do the opposite.', 'propertyhive' )
383 ),
384
385 array(
386 'title' => __( 'When Entering Features', 'propertyhive' ),
387 'id' => 'propertyhive_features_type',
388 'type' => 'radio',
389 'options' => array(
390 '' => __( 'Allow Features To Be Freetyped', 'propertyhive' ),
391 'checkbox' => __( 'Select From A Predefined List (Editable from \'Custom Fields\')', 'propertyhive' ),
392 ),
393 'desc' => __( '', 'propertyhive' )
394 ),
395
396 array( 'type' => 'sectionend', 'id' => 'property_options'),
397
398 array( 'title' => __( 'Applicant Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'applicant_registration_options' ),
399
400 array(
401 'title' => __( 'Allow Applicants To Login and Manage Account', 'propertyhive' ),
402 'id' => 'propertyhive_applicant_users',
403 'type' => 'checkbox',
404 'desc' => __( 'Applicable when you allow users to register on a form using the [applicant_registration_form] shortcode.<br><br>Selecting this will allow applicants to create a password when registering, then login to manage their details and requirements. They will be created as a WordPress user with \'Property Hive Contact\' role.<br><br>If unticked applicants will still be able to register and they\'ll go into Property Hive as an applicant, they just won\'t be able to login at a later date.', 'propertyhive' )
405 ),
406
407 array(
408 'title' => __( 'Send Email When Applicant Registers', 'propertyhive' ),
409 'id' => 'propertyhive_new_registration_alert',
410 'type' => 'checkbox',
411 'desc' => __( 'Choose whether an email should be sent alerting you to the fact someone has registered. The email will be sent to the chosen office. Offices can be managed click selecting the \'Offices\' tab above.', 'propertyhive' )
412 ),
413
414 array(
415 'title' => __( 'My Account Page', 'propertyhive' ),
416 'id' => 'propertyhive_my_account_page_id',
417 'type' => 'single_select_page',
418 'default' => '',
419 'css' => 'min-width:300px;',
420 'desc' => __( 'This sets the \'My Account\' page. This page should contain the [propertyhive_my_account] shortcode', 'propertyhive' ),
421 ),
422
423 array(
424 'title' => __( 'Match Price Range % (Lower)', 'propertyhive' ),
425 'id' => 'propertyhive_applicant_match_price_range_percentage_lower',
426 'type' => 'number',
427 'default' => '20',
428 'desc' => '<p>' . __( 'When a maximum price is entered against an applicants requirements we create a \'Match Price Range\' which determines the price of properties that would get matched to the applicant.<br>We do this because you:<br>a) Wouldn\'t want to send them properties that were way below their specified maximum price and<br>b) Would probably want to send them properties which are slightly just over the price specified as, if the perfect property came along, a lot of people would actually be able to increase their maximum.<br>These settings determine the % above and below the maximum price entered that the \'Match Price Range\' will default to per applicant.<br>For example, if the maximum price entered was &pound;500,000, the lower setting was 20% and the higher setting was 5%, the applicant would actually match to properties that were priced &pound;400,000 - &pound;525,000.<br>This price range can be overwritten on a per-applicant basis, or disabled completely by leaving these settings empty.<br>Note that this currently only applies to applicants looking for sales properties and changing this value at a later date will only effect applicants that don\'t already have a match price range set.', 'propertyhive' ) . '</p>',
429 ),
430
431 array(
432 'title' => __( 'Match Price Range % (Higher)', 'propertyhive' ),
433 'id' => 'propertyhive_applicant_match_price_range_percentage_higher',
434 'type' => 'number',
435 'default' => '5',
436 ),
437
438 array( 'type' => 'sectionend', 'id' => 'applicant_registration_options'),
439
440 array( 'title' => __( 'Property Media Storage', 'propertyhive' ), 'type' => 'title', 'desc' => 'By default media atttached to properties will be stored in the WordPress media library. If the property media is hosted elsewhere (for example if you import properties from a third party and they allow you to link direct to the files on their server) you can choose to store media as URL\'s. It also means that the images are not downloaded onto your server, thus saving diskspace.<br><br>Note: If you change this you\'ll need to re-add all of the property media for existing properties.<br>Note: Changing this will not delete all existing media or URLs entered.<br>Note: Choosing to store the media as URLs will mean you don\'t benefit from having access to different sized images (i.e. small , medium, large etc).', 'id' => 'media_storage_options' ),
441
442 array(
443 'title' => __( 'Images Stored As', 'propertyhive' ),
444 'id' => 'propertyhive_images_stored_as',
445 'type' => 'select',
446 'default' => 'files',
447 'options' => array(
448 'files' => __( 'Media Files', 'propertyhive' ),
449 'urls' => __( 'URLs', 'propertyhive' ),
450 ),
451 'desc' => __( '', 'propertyhive' )
452 ),
453
454 array(
455 'title' => __( 'Floorplans Stored As', 'propertyhive' ),
456 'id' => 'propertyhive_floorplans_stored_as',
457 'type' => 'select',
458 'default' => 'files',
459 'options' => array(
460 'files' => __( 'Media Files', 'propertyhive' ),
461 'urls' => __( 'URLs', 'propertyhive' ),
462 ),
463 'desc' => __( '', 'propertyhive' )
464 ),
465
466 array(
467 'title' => __( 'Brochures Stored As', 'propertyhive' ),
468 'id' => 'propertyhive_brochures_stored_as',
469 'type' => 'select',
470 'default' => 'files',
471 'options' => array(
472 'files' => __( 'Media Files', 'propertyhive' ),
473 'urls' => __( 'URLs', 'propertyhive' ),
474 ),
475 'desc' => __( '', 'propertyhive' )
476 ),
477
478 array(
479 'title' => __( 'EPCs Stored As', 'propertyhive' ),
480 'id' => 'propertyhive_epcs_stored_as',
481 'type' => 'select',
482 'default' => 'files',
483 'options' => array(
484 'files' => __( 'Media Files', 'propertyhive' ),
485 'urls' => __( 'URLs', 'propertyhive' ),
486 ),
487 'desc' => __( '', 'propertyhive' )
488 ),
489
490 array( 'type' => 'sectionend', 'id' => 'media_storage_options'),
491
492 ) ); // End general misc settings
493 }
494
495 /**
496 * Output the settings
497 */
498 public function output() {
499 global $current_section;
500
501 if ( $current_section )
502 {
503 switch ($current_section)
504 {
505 case "modules": { $settings = $this->get_general_modules_setting(); break; }
506 case "international": { $settings = $this->get_general_international_setting(); break; }
507 case "map": { $settings = $this->get_general_map_setting(); break; }
508 case "gdpr": { $settings = $this->get_general_gdpr_setting(); break; }
509 case "misc": { $settings = $this->get_general_misc_setting(); break; }
510 default: { die("Unknown setting section"); }
511 }
512 }
513 else
514 {
515 $settings = $this->get_settings();
516 }
517
518 PH_Admin_Settings::output_fields( $settings );
519 }
520
521 /**
522 * Output a colour picker input box.
523 *
524 * @access public
525 * @param mixed $name
526 * @param mixed $id
527 * @param mixed $value
528 * @param string $desc (default: '')
529 * @return void
530 */
531 function color_picker( $name, $id, $value, $desc = '' ) {
532 echo '<div class="color_box"><strong><img class="help_tip" data-tip="' . esc_attr( $desc ) . '" src="' . PH()->plugin_url() . '/assets/images/help.png" height="16" width="16" /> ' . esc_html( $name ) . '</strong>
533 <input name="' . esc_attr( $id ). '" id="' . esc_attr( $id ) . '" type="text" value="' . esc_attr( $value ) . '" class="colorpick" /> <div id="colorPickerDiv_' . esc_attr( $id ) . '" class="colorpickdiv"></div>
534 </div>';
535 }
536
537 /**
538 * Save settings
539 */
540 public function save() {
541 global $current_section;
542
543 if ( $current_section != '' )
544 {
545 switch ($current_section)
546 {
547 case 'modules':
548 {
549 $settings = $this->get_general_modules_setting();
550
551 PH_Admin_Settings::save_fields( $settings );
552 break;
553 }
554 case 'international':
555 {
556 if (!isset($_POST['propertyhive_countries']) || (isset($_POST['propertyhive_countries']) && empty($_POST['propertyhive_countries'])))
557 {
558 // If we haven't selected which countries we operate in
559 update_option( 'propertyhive_countries', array( ph_clean($_POST['propertyhive_default_country']) ) );
560 }
561 else
562 {
563 // We have default country and countries set
564 // Make sure default country is in list of countries selected
565 if ( !in_array(ph_clean($_POST['propertyhive_default_country']), ph_clean($_POST['propertyhive_countries'])) ) {
566 $_POST['propertyhive_default_country'] = $_POST['propertyhive_countries'][0];
567 }
568
569 update_option( 'propertyhive_default_country', ph_clean($_POST['propertyhive_default_country']) );
570 update_option( 'propertyhive_countries', ph_clean($_POST['propertyhive_countries']) );
571 }
572
573 update_option( 'propertyhive_price_thousand_separator', ph_clean($_POST['propertyhive_price_thousand_separator']) );
574 update_option( 'propertyhive_price_decimal_separator', ph_clean($_POST['propertyhive_price_decimal_separator']) );
575
576 update_option( 'propertyhive_search_form_currency', ph_clean($_POST['propertyhive_search_form_currency']) );
577
578 do_action( 'propertyhive_update_currency_exchange_rates' );
579
580 break;
581 }
582 case 'map':
583 {
584 $settings = $this->get_general_map_setting();
585
586 PH_Admin_Settings::save_fields( $settings );
587 break;
588 }
589 case 'gdpr':
590 {
591 $settings = $this->get_general_gdpr_setting();
592
593 PH_Admin_Settings::save_fields( $settings );
594 break;
595 }
596 case 'misc':
597 {
598 $settings = $this->get_general_misc_setting();
599
600 PH_Admin_Settings::save_fields( $settings );
601 break;
602 }
603 default: { die("Unknown setting section"); }
604 }
605 }
606 else
607 {
608 $settings = $this->get_settings();
609
610 PH_Admin_Settings::save_fields( $settings );
611
612 flush_rewrite_rules();
613 }
614 }
615
616 }
617
618 endif;
619
620 return new PH_Settings_General();
621