PluginProbe
Property Hive / 1.4.59
Property Hive v1.4.59
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.59, at includes/admin/settings/class-ph-settings-general.php

633 lines 27.0 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 'id' => 'propertyhive_search_results_page_id',
99 'type' => 'single_select_page',
100 'default' => '',
101 'css' => 'min-width:300px;',
102 'desc' => __( 'This sets the page of your property search results', 'propertyhive' ),
103 );
104
105 $settings[] = array(
106 'title' => __( 'Lettings Fees (Residential)', 'propertyhive' ),
107 'id' => 'propertyhive_lettings_fees',
108 'type' => 'textarea',
109 'css' => 'height:150px; width:100%; max-width:400px'
110 );
111
112 $settings[] = array(
113 'title' => __( 'Lettings Fees (Commercial)', 'propertyhive' ),
114 'id' => 'propertyhive_lettings_fees_commercial',
115 'type' => 'textarea',
116 'css' => 'height:150px; width:100%; max-width:400px'
117 );
118
119 $settings[] = array(
120 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
121 'desc' => __( 'In Search Results', 'propertyhive' ),
122 'id' => 'propertyhive_lettings_fees_display_search_results',
123 'type' => 'checkbox',
124 'checkboxgroup' => 'start',
125 );
126
127 $settings[] = array(
128 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
129 'desc' => __( 'On Property Details Page', 'propertyhive' ),
130 'id' => 'propertyhive_lettings_fees_display_single_property',
131 'type' => 'checkbox',
132 'checkboxgroup' => 'end',
133 );
134
135 $settings[] = array( 'type' => 'sectionend', 'id' => 'general_options');
136
137 return apply_filters( 'propertyhive_general_settings', $settings );
138 }
139
140 /**
141 * Get general modules settings array
142 *
143 * @return array
144 */
145 public function get_general_modules_setting() {
146
147 return apply_filters( 'propertyhive_general_modules_settings', array(
148
149 array( 'title' => __( 'Disabled Modules', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'modules_options' ),
150
151 array(
152 'type' => 'html',
153 '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' ) . ':',
154 ),
155
156 array(
157 'title' => __( 'Disabled Modules', 'propertyhive' ),
158 'desc' => __( 'Contacts (Applicants, Owners/Landlords and Third Party Contacts)', 'propertyhive' ),
159 'id' => 'propertyhive_module_disabled_contacts',
160 'type' => 'checkbox',
161 'default' => '',
162 'checkboxgroup' => 'start'
163 ),
164
165 array(
166 'title' => __( 'Disabled Modules', 'propertyhive' ),
167 'desc' => __( 'Appraisals', 'propertyhive' ),
168 'id' => 'propertyhive_module_disabled_appraisals',
169 'type' => 'checkbox',
170 'default' => '',
171 'checkboxgroup' => 'middle'
172 ),
173
174 array(
175 'title' => __( 'Disabled Modules', 'propertyhive' ),
176 'desc' => __( 'Viewings', 'propertyhive' ),
177 'id' => 'propertyhive_module_disabled_viewings',
178 'type' => 'checkbox',
179 'default' => '',
180 'checkboxgroup' => 'middle'
181 ),
182
183 array(
184 'title' => __( 'Disabled Modules', 'propertyhive' ),
185 'desc' => __( 'Offers and Sales', 'propertyhive' ),
186 'id' => 'propertyhive_module_disabled_offers_sales',
187 'type' => 'checkbox',
188 'default' => '',
189 'checkboxgroup' => 'middle'
190 ),
191
192 array(
193 'title' => __( 'Disabled Modules', 'propertyhive' ),
194 'desc' => __( 'Enquiries', 'propertyhive' ),
195 'id' => 'propertyhive_module_disabled_enquiries',
196 'type' => 'checkbox',
197 'default' => '',
198 'checkboxgroup' => 'end'
199 ),
200
201 array( 'type' => 'sectionend', 'id' => 'modules_options'),
202
203 ) ); // End general module settings
204 }
205
206 /**
207 * Get international settings array
208 *
209 * @return array
210 */
211 public function get_general_international_setting() {
212
213 $settings = array(
214
215 array( 'title' => __( 'International Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'international_options' ),
216
217 array(
218 'title' => __( 'Default Country', 'propertyhive' ),
219 'id' => 'propertyhive_default_country',
220 'type' => 'single_select_country',
221 'css' => 'min-width:300px;',
222 ),
223
224 array(
225 'title' => __( 'Countries Where You Operate', 'propertyhive' ),
226 'id' => 'propertyhive_countries',
227 'type' => 'multi_select_countries',
228 'css' => 'min-width:300px;',
229 'desc' => __( 'Hold ctrl/cmd whilst clicking to select multiple', 'propertyhive' )
230 ),
231
232 array(
233 'title' => __( 'Price Thousand Separator', 'propertyhive' ),
234 'id' => 'propertyhive_price_thousand_separator',
235 'type' => 'text',
236 'default' => ',',
237 'css' => 'width:50px;',
238 ),
239
240 array(
241 'title' => __( 'Price Decimal Separator', 'propertyhive' ),
242 'id' => 'propertyhive_price_decimal_separator',
243 'type' => 'text',
244 'default' => '.',
245 'css' => 'width:50px;',
246 )
247 );
248
249 $ph_countries = new PH_Countries();
250 $ph_countries = $ph_countries->countries;
251
252 $currencies = array();
253 $countries = array();
254 if ( !empty($ph_countries) )
255 {
256 foreach ( $ph_countries as $country_code => $country )
257 {
258 $currencies[$country['currency_code']] = $country['currency_code'];
259 $countries[$country_code] = $country;
260 }
261 }
262 $currencies = array_unique($currencies);
263 ksort($currencies);
264
265 $settings[] = array(
266 'title' => __( 'Currency Used In Search Forms', 'propertyhive' ),
267 'id' => 'propertyhive_search_form_currency',
268 'type' => 'select',
269 'options' => $currencies,
270 'default' => 'GBP',
271 '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' ),
272 );
273
274 $settings[] = array( 'type' => 'sectionend', 'id' => 'international_options');
275
276 $settings[] = array(
277 'type' => 'html',
278 'html' => '<script>
279
280 var countries = '. json_encode( $countries ) . ';
281
282 </script>'
283 );
284
285 return apply_filters( 'propertyhive_general_international_settings', $settings );
286 }
287
288 /**
289 * Get map settings array
290 *
291 * @return array
292 */
293 public function get_general_map_setting() {
294
295 $settings = array(
296
297 array( 'title' => __( 'Map Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'map_options' ),
298
299 array(
300 'title' => __( 'Google Maps API Key', 'propertyhive' ),
301 'id' => 'propertyhive_google_maps_api_key',
302 'type' => 'text',
303 '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>'
304 )
305
306 );
307
308 if ( apply_filters( 'propertyhive_use_google_maps_geocoding_api_key', false) === true )
309 {
310 $settings[] = array(
311 'title' => __( 'Google Maps Geocoding API Key', 'propertyhive' ),
312 'id' => 'propertyhive_google_maps_geocoding_api_key',
313 'type' => 'text',
314 '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>'
315 );
316 }
317
318 $settings[] = array( 'type' => 'sectionend', 'id' => 'map_options');
319
320 return apply_filters( 'propertyhive_general_map_settings', $settings );
321 }
322
323 /**
324 * Get GDPR settings array
325 *
326 * @return array
327 */
328 public function get_general_gdpr_setting() {
329
330 return apply_filters( 'propertyhive_general_gdpr_settings', array(
331
332 array( 'title' => __( 'GDPR Settings', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'gdpr_options' ),
333
334 array(
335 'title' => __( 'Store Property Enquiries', 'propertyhive' ),
336 'id' => 'propertyhive_store_property_enquiries',
337 'type' => 'checkbox',
338 'default' => 'yes',
339 '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' )
340 ),
341
342 array(
343 'title' => __( 'Property Enquiry Form Disclaimer', 'propertyhive' ),
344 'id' => 'propertyhive_property_enquiry_form_disclaimer',
345 'type' => 'wysiwyg',
346 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the property enquiry form.', 'propertyhive' )
347 ),
348
349 array(
350 'title' => __( 'Applicant Registration Form Disclaimer', 'propertyhive' ),
351 'id' => 'propertyhive_applicant_registration_form_disclaimer',
352 'type' => 'wysiwyg',
353 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the applicant registration form.', 'propertyhive' )
354 ),
355
356 array( 'type' => 'sectionend', 'id' => 'gdpr_options'),
357
358 ) ); // End general GDPR settings
359 }
360
361 /**
362 * Get misc settings array
363 *
364 * @return array
365 */
366 public function get_general_misc_setting() {
367
368 return apply_filters( 'propertyhive_general_misc_settings', array(
369
370 array( 'title' => __( 'Property Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'property_options' ),
371
372 array(
373 'title' => __( 'Search By Address Should', 'propertyhive' ),
374 'id' => 'propertyhive_address_keyword_compare',
375 'type' => 'radio',
376 'default' => '=',
377 'options' => array(
378 '=' => __( 'Match Keyword Exactly', 'propertyhive' ),
379 'LIKE' => __( 'Perform Loose Search', 'propertyhive' ),
380 ),
381 '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' )
382 ),
383
384 array(
385 'title' => __( 'Commercial Display In Search Results', 'propertyhive' ),
386 'id' => 'propertyhive_commercial_display',
387 'type' => 'select',
388 'default' => '',
389 'css' => 'min-width:300px;',
390 'options' => array(
391 '' => __( 'Display top level properties and units', 'propertyhive' ),
392 'top_level_only' => __( 'Display top level properties only', 'propertyhive' ),
393 'top_level_only_but_units_when_filtered' => __( 'Display top level properties only but units as well if matching filters', 'propertyhive' ),
394 ),
395 ),
396
397 array(
398 'title' => __( 'When Entering Features', 'propertyhive' ),
399 'id' => 'propertyhive_features_type',
400 'type' => 'radio',
401 'options' => array(
402 '' => __( 'Allow Features To Be Freetyped', 'propertyhive' ),
403 'checkbox' => __( 'Select From A Predefined List (Editable from \'Custom Fields\')', 'propertyhive' ),
404 ),
405 'desc' => __( '', 'propertyhive' )
406 ),
407
408 array( 'type' => 'sectionend', 'id' => 'property_options'),
409
410 array( 'title' => __( 'Applicant Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'applicant_registration_options' ),
411
412 array(
413 'title' => __( 'Allow Applicants To Login and Manage Account', 'propertyhive' ),
414 'id' => 'propertyhive_applicant_users',
415 'type' => 'checkbox',
416 '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' )
417 ),
418
419 array(
420 'title' => __( 'Send Email When Applicant Registers', 'propertyhive' ),
421 'id' => 'propertyhive_new_registration_alert',
422 'type' => 'checkbox',
423 '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' )
424 ),
425
426 array(
427 'title' => __( 'My Account Page', 'propertyhive' ),
428 'id' => 'propertyhive_my_account_page_id',
429 'type' => 'single_select_page',
430 'default' => '',
431 'css' => 'min-width:300px;',
432 'desc' => __( 'This sets the \'My Account\' page. This page should contain the [propertyhive_my_account] shortcode', 'propertyhive' ),
433 ),
434
435 array(
436 'title' => __( 'Match Price Range % (Lower)', 'propertyhive' ),
437 'id' => 'propertyhive_applicant_match_price_range_percentage_lower',
438 'type' => 'number',
439 'default' => '20',
440 '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>',
441 ),
442
443 array(
444 'title' => __( 'Match Price Range % (Higher)', 'propertyhive' ),
445 'id' => 'propertyhive_applicant_match_price_range_percentage_higher',
446 'type' => 'number',
447 'default' => '5',
448 ),
449
450 array( 'type' => 'sectionend', 'id' => 'applicant_registration_options'),
451
452 array( 'title' => __( 'Property Media Storage', 'propertyhive' ), 'type' => 'title', 'desc' => 'By default media attached 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' ),
453
454 array(
455 'title' => __( 'Images Stored As', 'propertyhive' ),
456 'id' => 'propertyhive_images_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' => __( 'Floorplans Stored As', 'propertyhive' ),
468 'id' => 'propertyhive_floorplans_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' => __( 'Brochures Stored As', 'propertyhive' ),
480 'id' => 'propertyhive_brochures_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(
491 'title' => __( 'EPCs Stored As', 'propertyhive' ),
492 'id' => 'propertyhive_epcs_stored_as',
493 'type' => 'select',
494 'default' => 'files',
495 'options' => array(
496 'files' => __( 'Media Files', 'propertyhive' ),
497 'urls' => __( 'URLs', 'propertyhive' ),
498 ),
499 'desc' => __( '', 'propertyhive' )
500 ),
501
502 array( 'type' => 'sectionend', 'id' => 'media_storage_options'),
503
504 ) ); // End general misc settings
505 }
506
507 /**
508 * Output the settings
509 */
510 public function output() {
511 global $current_section;
512
513 if ( $current_section )
514 {
515 switch ($current_section)
516 {
517 case "modules": { $settings = $this->get_general_modules_setting(); break; }
518 case "international": { $settings = $this->get_general_international_setting(); break; }
519 case "map": { $settings = $this->get_general_map_setting(); break; }
520 case "gdpr": { $settings = $this->get_general_gdpr_setting(); break; }
521 case "misc": { $settings = $this->get_general_misc_setting(); break; }
522 default: { die("Unknown setting section"); }
523 }
524 }
525 else
526 {
527 $settings = $this->get_settings();
528 }
529
530 PH_Admin_Settings::output_fields( $settings );
531 }
532
533 /**
534 * Output a colour picker input box.
535 *
536 * @access public
537 * @param mixed $name
538 * @param mixed $id
539 * @param mixed $value
540 * @param string $desc (default: '')
541 * @return void
542 */
543 function color_picker( $name, $id, $value, $desc = '' ) {
544 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>
545 <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>
546 </div>';
547 }
548
549 /**
550 * Save settings
551 */
552 public function save() {
553 global $current_section;
554
555 if ( $current_section != '' )
556 {
557 switch ($current_section)
558 {
559 case 'modules':
560 {
561 $settings = $this->get_general_modules_setting();
562
563 PH_Admin_Settings::save_fields( $settings );
564 break;
565 }
566 case 'international':
567 {
568 if (!isset($_POST['propertyhive_countries']) || (isset($_POST['propertyhive_countries']) && empty($_POST['propertyhive_countries'])))
569 {
570 // If we haven't selected which countries we operate in
571 update_option( 'propertyhive_countries', array( ph_clean($_POST['propertyhive_default_country']) ) );
572 }
573 else
574 {
575 // We have default country and countries set
576 // Make sure default country is in list of countries selected
577 if ( !in_array(ph_clean($_POST['propertyhive_default_country']), ph_clean($_POST['propertyhive_countries'])) ) {
578 $_POST['propertyhive_default_country'] = $_POST['propertyhive_countries'][0];
579 }
580
581 update_option( 'propertyhive_default_country', ph_clean($_POST['propertyhive_default_country']) );
582 update_option( 'propertyhive_countries', ph_clean($_POST['propertyhive_countries']) );
583 }
584
585 update_option( 'propertyhive_price_thousand_separator', ph_clean($_POST['propertyhive_price_thousand_separator']) );
586 update_option( 'propertyhive_price_decimal_separator', ph_clean($_POST['propertyhive_price_decimal_separator']) );
587
588 update_option( 'propertyhive_search_form_currency', ph_clean($_POST['propertyhive_search_form_currency']) );
589
590 do_action( 'propertyhive_update_currency_exchange_rates' );
591
592 break;
593 }
594 case 'map':
595 {
596 $settings = $this->get_general_map_setting();
597
598 PH_Admin_Settings::save_fields( $settings );
599 break;
600 }
601 case 'gdpr':
602 {
603 $settings = $this->get_general_gdpr_setting();
604
605 PH_Admin_Settings::save_fields( $settings );
606 break;
607 }
608 case 'misc':
609 {
610 $settings = $this->get_general_misc_setting();
611
612 PH_Admin_Settings::save_fields( $settings );
613 break;
614 }
615 default: { die("Unknown setting section"); }
616 }
617 }
618 else
619 {
620 $settings = $this->get_settings();
621
622 PH_Admin_Settings::save_fields( $settings );
623
624 flush_rewrite_rules();
625 }
626 }
627
628 }
629
630 endif;
631
632 return new PH_Settings_General();
633