Origin commit

This commit is contained in:
Hoang Huu
2019-09-10 11:27:33 +07:00
commit 499e068e4f
844 changed files with 188705 additions and 0 deletions

137
inc/admin/settings/3rd_party.php Executable file
View File

@@ -0,0 +1,137 @@
<?php
/**
* $Desc$
*
* @version $Id$
* @package opalestate
* @author Opal Team <info@wpopal.com >
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_3rd_party_Tab extends Opalestate_Settings_Base_Tab {
public function get_subtabs () {
$tabs = (array)apply_filters (
'opalestate_settings_3rd_party_subtabs_nav', array()
);
$tabs = array_merge_recursive( $tabs, array(
'yelp' => "Yelp",
'walkcore' => "Walkcore"
) );
return $tabs;
}
public function get_subtabs_content( $key ="" ) {
// echo $key;die;
$fields = apply_filters ( 'opalestate_settings_3rd_party_subtabs_'.$key.'_fields', array() );
if( $key == 'yelp' ){
$fields = $this->get_yelp_fields();
}else if( $key == 'walkcore' ){
$fields = $this->get_walkscore_fields();
}
return [
'id' => 'options_page',
'opalestate_title' => esc_html__( '3rd Party Settings', 'opalestate-pro' ),
'show_on' => [ 'key' => 'options-page', 'value' => [ $key ], ],
'fields' => (array)$fields
];
}
public function get_walkscore_fields(){
return array(
[
'name' => esc_html__( 'Walk Score', 'opalestate-pro' ),
'desc' => '',
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_walkscore',
'before_row' => '<hr>',
'after_row' => '<hr>',
],
[
'name' => esc_html__( 'Walk Score APi Key', 'opalestate-pro' ),
'desc' => esc_html__( 'Add Walk Score API key. To get your Walk Score API key, go to your Walk Score Account.', 'opalestate-pro' ),
'id' => 'walkscore_api_key',
'type' => 'text',
]
);
}
public function get_yelp_fields(){
return array(
[
'name' => esc_html__( 'Yelp', 'opalestate-pro' ),
'desc' => '',
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_yelp',
'before_row' => '<hr>',
'after_row' => '<hr>',
],
[
'name' => esc_html__( 'Yelp API Client ID', 'opalestate-pro' ),
'desc' => esc_html__( 'Add Yelp client ID. To get your Yelp Api Client ID, go to your Yelp Account. Register <a href="https://www.yelp.com/developers/v3/manage_app" target="_blank">here</a>',
'opalestate-pro' ),
'id' => 'yelp_app_id',
'type' => 'text',
],
[
'name' => esc_html__( 'Yelp API Secret', 'opalestate-pro' ),
'desc' => esc_html__( 'Add Yelp API Secret. Register <a href="https://www.yelp.com/developers/v3/manage_app" target="_blank">here</a>',
'opalestate-pro' ),
'id' => 'yelp_app_secret',
'type' => 'text',
],
[
'name' => esc_html__( 'Yelp App key', 'opalestate-pro' ),
'desc' => esc_html__( 'You can find it in your Yelp Application Dashboard. Register <a href="https://www.yelp.com/developers/v3/manage_app" target="_blank">here</a>',
'opalestate-pro' ),
'id' => 'yelp_app_key',
'type' => 'text',
],
[
'name' => esc_html__( 'Yelp Categories', 'opalestate-pro' ),
'desc' => esc_html__( 'Yelp Categories to show on front page', 'opalestate-pro' ),
'id' => 'yelp_categories',
'type' => 'multicheck',
'options' => OpalEstate_Yelp::get_all_categories_options(),
],
[
'name' => esc_html__( 'Yelp - Number of results', 'opalestate-pro' ),
'desc' => esc_html__( 'Number of results to show on listing page for each category.', 'opalestate-pro' ),
'id' => 'yelp_number_results',
'type' => 'text',
'default' => 3,
'attributes' => [
'type' => 'number',
'min' => 1,
],
],
[
'name' => esc_html__( 'Yelp Distance Measurement Unit', 'opalestate-pro' ),
'desc' => esc_html__( 'Yelp Distance Measurement Unit', 'opalestate-pro' ),
'id' => 'yelp_measurement_unit',
'type' => 'select',
'options' => [
'miles' => esc_html__( 'miles', 'opalestate-pro' ),
'kilometers' => esc_html__( 'kilometers', 'opalestate-pro' ),
],
'default' => 'miles',
]
);
}
}

46
inc/admin/settings/api_keys.php Executable file
View File

@@ -0,0 +1,46 @@
<?php
/**
* $Desc$
*
* @version $Id$
* @package opalestate
* @author Opal Team <info@wpopal.com >
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_Api_keys_Tab extends Opalestate_Settings_Base_Tab {
public function get_tabnav () {
}
public function get_tab_content( $key= '' ) {
return [
'id' => 'api_keys',
'opalestate_title' => esc_html__( 'API', 'opalestate-pro' ),
'show_on' => [ 'key' => 'options-page', 'value' => [ $key ], ],
'show_names' => false, // Hide field names on the left
'fields' => apply_filters( 'opalestate_settings_api', [
[
'id' => 'api_keys',
'name' => esc_html__( 'API', 'opalestate-pro' ),
'type' => 'api_keys',
],
]
),
];
}
public function get_tab_fields () {
}
}

47
inc/admin/settings/base.php Executable file
View File

@@ -0,0 +1,47 @@
<?php
/**
* $Desc$
*
* @version $Id$
* @package opalestate
* @author Opal Team <info@wpopal.com >
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_Base_Tab {
public $key;
public function __construct ( $key ='' ){
$this->key = $key;
}
public function get_tabnav () {
}
public function get_tab_content( $key= '' ) {
}
public function get_subtabs(){
}
public function get_tab_fields () {
}
public function get_subtabs_content( $subtab ) {
}
}

38
inc/admin/settings/email.php Executable file
View File

@@ -0,0 +1,38 @@
<?php
/**
* $Desc$
*
* @version $Id$
* @package opalestate
* @author Opal Team <info@wpopal.com >
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_Email_Tab extends Opalestate_Settings_Base_Tab {
public function get_tabnav () {
}
public function get_tab_content( $key='' ) {
return [
'id' => 'options_page',
'opalestate_title' => esc_html__( 'General Settings', 'opalestate-pro' ),
'show_on' => [ 'key' => 'options-page', 'value' => [ $key ], ],
'fields' => $this->get_tab_fields()
];
}
public function get_tab_fields () {
}
}

257
inc/admin/settings/general.php Executable file
View File

@@ -0,0 +1,257 @@
<?php
/**
* $Desc$
*
* @version $Id$
* @package opalestate
* @author Opal Team <info@wpopal.com >
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
public function get_tabnav() {
}
public function get_tab_content( $key = '' ) {
return [
'id' => 'options_page',
'opalestate_title' => esc_html__( 'General Settings', 'opalestate-pro' ),
'show_on' => [ 'key' => 'options-page', 'value' => [ $key, ], ],
'fields' => $this->get_tab_fields(),
];
}
public function get_tab_fields( $key = '' ) {
$pages = opalestate_cmb2_get_post_options( [
'post_type' => 'page',
'numberposts' => -1,
] );
return apply_filters( 'opalestate_settings_general', [
[
'name' => esc_html__( 'General Settings', 'opalestate-pro' ),
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_1',
'before_row' => '<hr>',
'after_row' => '<hr>',
],
[
'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
'id' => 'user_management_page',
'type' => 'select',
'options' => $pages,
],
[
'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page use User login and register an account, or reset password.', 'opalestate-pro' ),
'id' => 'user_myaccount_page',
'type' => 'select',
'options' => $pages,
],
[
'name' => esc_html__( 'Enable Message Database', 'opalestate-pro' ),
'desc' => esc_html__( 'Allow User send message Contact/Equire via email and saved into database to exchange theirs message direct in User Message Management', 'opalestate-pro' ),
'id' => 'message_log',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
],
[
'name' => esc_html__( 'Maximun Upload Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'Set maximun volumn size having < x MB', 'opalestate-pro' ),
'id' => 'upload_image_max_size',
'type' => 'text',
'default' => '0.5',
],
[
'name' => esc_html__( 'Maximun Upload Image Files', 'opalestate-pro' ),
'desc' => esc_html__( 'Set maximun volumn size having < x MB', 'opalestate-pro' ),
'id' => 'upload_image_max_files',
'type' => 'text',
'default' => '10',
],
[
'name' => esc_html__( 'Maximun Upload Other Size', 'opalestate-pro' ),
'desc' => esc_html__( 'Set maximun volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
'id' => 'upload_other_max_size',
'type' => 'text',
'default' => '0.8'
],
[
'name' => esc_html__( 'Maximun Upload Other Files', 'opalestate-pro' ),
'desc' => esc_html__( 'Set maximun volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
'id' => 'upload_other_max_files',
'type' => 'text',
'default' => '10',
'after_row' => '<hr>'
],
[
'name' => esc_html__( 'Agent Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Loop Image is an Agent that is chosen as the representative Agent in grid and list.', 'opalestate-pro' ),
'id' => 'agent_image_size',
'type' => 'select',
'default' => 'medium',
'options' => opalestate_get_featured_image_sizes(),
],
[
'name' => esc_html__( 'Agent Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Loop Image is an Agent that is chosen as the representative Agent in grid and list.', 'opalestate-pro' ),
'id' => 'agent_image_size',
'type' => 'select',
'default' => 'medium',
'options' => opalestate_get_featured_image_sizes(),
],
[
'name' => esc_html__( 'Loop Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Loop Image is an image that is chosen as the representative image in grid and list.', 'opalestate-pro' ),
'id' => 'loop_image_size',
'type' => 'select',
'default' => 'large',
'options' => opalestate_get_featured_image_sizes(),
],
[
'name' => esc_html__( 'Featured Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Featured Image is an image that is chosen as the representative image in single page. .', 'opalestate-pro' ),
'id' => 'featured_image_size',
'type' => 'select',
'default' => 'full',
'options' => opalestate_get_featured_image_sizes(),
'after_row' => '<em>' . esc_html__( 'To generate images with new image sizes, you can use this <a href="https://goo.gl/FuXFex" target="_blank">Force Regenerate Thumbnails</a>',
'opalestate-pro' ) . '</em>',
],
[
'name' => esc_html__( 'Minimum of Target Price For Agent', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter minimum of price for starting search agent by target', 'opalestate-pro' ),
'id' => 'search_agent_min_price',
'type' => 'text_medium',
'attributes' => [
'type' => 'number',
],
'default' => 0,
],
[
'name' => esc_html__( 'Maximum of Target Price For Agent', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter maximum of price for starting search agent by target', 'opalestate-pro' ),
'id' => 'search_agent_max_price',
'type' => 'text_medium',
'attributes' => [
'type' => 'number',
],
'default' => 1000000,
],
[
'name' => esc_html__( 'Single Layout Page', 'opalestate-pro' ),
'desc' => esc_html__( 'Choose layout for single property.', 'opalestate-pro' ),
'id' => 'layout',
'type' => 'select',
'options' => apply_filters( 'opalestate_single_layout_templates', [ '' => esc_html__( 'Inherit', 'opalestate-pro' ) ] ),
],
[
'name' => esc_html__( 'Currency Settings', 'opalestate-pro' ),
'desc' => '',
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_2',
'before_row' => '<hr>',
'after_row' => '<hr>',
],
[
'name' => esc_html__( 'Currency', 'opalestate-pro' ),
'desc' => 'Choose your currency. Note that some payment gateways have currency restrictions.',
'id' => 'currency',
'type' => 'select',
'options' => opalestate_get_currencies(),
'default' => 'USD',
],
[
'name' => esc_html__( 'Currency Position', 'opalestate-pro' ),
'desc' => 'Choose the position of the currency sign.',
'id' => 'currency_position',
'type' => 'select',
'options' => [
'before' => esc_html__( 'Before - $10', 'opalestate-pro' ),
'after' => esc_html__( 'After - 10$', 'opalestate-pro' ),
],
'default' => 'before',
],
[
'name' => esc_html__( 'Thousands Separator', 'opalestate-pro' ),
'desc' => esc_html__( 'The symbol (typically , or .) to separate thousands', 'opalestate-pro' ),
'id' => 'thousands_separator',
'type' => 'text_small',
'default' => ',',
],
[
'name' => esc_html__( 'Decimal Separator', 'opalestate-pro' ),
'desc' => esc_html__( 'The symbol (usually , or .) to separate decimal points', 'opalestate-pro' ),
'id' => 'decimal_separator',
'type' => 'text_small',
'default' => '.',
],
[
'name' => esc_html__( 'Number of Decimals', 'opalestate-pro' ),
'desc' => esc_html__( 'This sets the number of decimal points shown in displayed prices.', 'opalestate-pro' ),
'id' => 'number_decimals',
'type' => 'text_small',
'attributes' => [
'type' => 'number',
],
'default' => 2,
],
[
'name' => esc_html__( 'Measurement Unit', 'opalestate-pro' ),
'desc' => esc_html__( 'Measurement Unit', 'opalestate-pro' ),
'id' => 'measurement_unit',
'type' => 'select',
'options' => apply_filters( 'opalestate_measurement_unit', [
'sq ft' => esc_html__( 'sq ft', 'opalestate-pro' ),
'sq m' => esc_html__( 'sq m', 'opalestate-pro' ),
'mq' => esc_html__( 'mq', 'opalestate-pro' ),
'm2' => esc_html__( 'm2', 'opalestate-pro' ),
] ),
'default' => 'sq ft',
],
[
'name' => esc_html__( 'Google Map API', 'opalestate-pro' ),
'desc' => __( 'You need to register <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">Google API Key</a>, then put the key in this setting.',
'opalestate-pro' ),
'id' => 'google_map_api_keys',
'type' => 'text',
'default' => 'AIzaSyCfMVNIa7khIqYHCw6VBn8ShUWWm4tjbG8',
],
]
);
}
}

446
inc/admin/settings/property.php Executable file
View File

@@ -0,0 +1,446 @@
<?php
/**
* Opalestate_Settings_Property_Tab
*
* @package opalestate
* @author Opal Team <info@wpopal.com >
*
* @website http://www.wpopal.com
* @support http://www.wpopal.com/support/forum.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
public function get_subtabs() {
return apply_filters(
'opalestate_settings_property_subtabs_nav',
[
'property_general' => esc_html__( 'General', 'opalestate-pro' ),
'property_search' => esc_html__( 'Search Page', 'opalestate-pro' ),
'property_detail' => esc_html__( 'Single Page', 'opalestate-pro' ),
]
);
}
public function get_subtabs_content( $key = "" ) {
$fields = apply_filters( 'opalestate_settings_property_subtabs_' . $key . '_fields', [] );
if ( $fields ) {
} else {
switch ( $key ) {
case 'property_search':
$fields = $this->get_subtab_search_fields();
break;
case 'property_detail':
$fields = $this->get_subtab_detail_fields();
break;
default:
$fields = $this->get_subtab_property_fields();
break;
}
}
return [
'id' => 'options_page',
'opalestate_title' => esc_html__( 'Property Settings', 'opalestate-pro' ),
'show_on' => [ 'key' => 'options-page', 'value' => [ $key ], ],
'fields' => $fields,
];
}
private function get_subtab_property_fields() {
$fields = [];
$fields[] = [
'name' => esc_html__( 'Enable User Submission', 'opalestate-pro' ),
'desc' => esc_html__( 'Enable to allow user post/submit properties in front-end', 'opalestate-pro' ),
'id' => 'enable_submission',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
// show setting short meta infox
$metabox = new Opalestate_Property_MetaBox();
$metas = $metabox->metaboxes_info_fields();
$checkes = [];
foreach ( $metas as $key => $field ) {
$id = str_replace( OPALESTATE_PROPERTY_PREFIX, '', $field['id'] );
$checkes [ $id ] = $field['name'];
}
$fields[] = [
'name' => esc_html__( 'Show Meta Information in Grid and Single Page', 'opalestate-pro' ),
'id' => 'show_property_meta',
'type' => 'multicheck',
'options' => $checkes,
];
$fields[] = [
'name' => esc_html__( 'Archive Grid layout', 'opalestate-pro' ),
'id' => 'property_archive_grid_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_grid_layouts(),
];
$fields[] = [
'name' => esc_html__( 'Archive List layout', 'opalestate-pro' ),
'id' => 'property_archive_list_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_list_layouts(),
];
return $fields;
}
private function get_subtab_search_fields() {
$pages = opalestate_cmb2_get_post_options( [
'post_type' => 'page',
'numberposts' => -1,
] );
$metabox = new Opalestate_Property_MetaBox();
$metas = $metabox->metaboxes_info_fields();
$fields = [];
if ( $metas ) {
$fields[] = [
'name' => esc_html__( 'User Share Search', 'opalestate-pro' ),
'desc' => esc_html__( 'Display Share Search Link Management', 'opalestate-pro' ),
'id' => 'enable_share_earch',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'User Saved Search', 'opalestate-pro' ),
'desc' => esc_html__( 'Display Save Search Link Management', 'opalestate-pro' ),
'id' => 'enable_saved_usersearch',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Search Properties Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page to display result of properties after user searching via form.',
'opalestate-pro' ),
'id' => 'search_map_properties_page',
'type' => 'select',
'options' => opalestate_cmb2_get_post_options( [
'post_type' => 'page',
'numberposts' => -1,
] ),
'default' => '',
];
$fields[] = [
'name' => esc_html__( 'Properties Per Page', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter min of properties display in search page', 'opalestate-pro' ),
'id' => 'search_property_per_page',
'type' => 'text_small',
'attributes' => [
'type' => 'number',
],
'default' => 9,
];
$fields[] = [
'name' => esc_html__( 'Show Featured First', 'opalestate-pro' ),
'id' => 'show_featured_first',
'desc' => esc_html__( 'Show featured first in page result, as default Newest is showed', 'opalestate-pro' ),
'type' => 'switch',
'options' => [
0 => esc_html__( 'Disable', 'opalestate-pro' ),
1 => esc_html__( 'Enable', 'opalestate-pro' ),
],
'default' => 0,
];
$fields[] = [
'name' => esc_html__( 'Minimum of Search Price', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter minimum of price for starting search', 'opalestate-pro' ),
'id' => 'search_min_price',
'type' => 'text_medium',
'attributes' => [
'type' => 'number',
],
'default' => 0,
];
$fields[] = [
'name' => esc_html__( 'Maximum of Search Price', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter maximum of price for starting search', 'opalestate-pro' ),
'id' => 'search_max_price',
'type' => 'text_medium',
'attributes' => [
'type' => 'number',
],
'default' => 10000000,
];
$fields[] = [
'name' => esc_html__( 'Minimum of Search Aea', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter minimum of area for starting search', 'opalestate-pro' ),
'id' => 'search_min_area',
'type' => 'text_small',
'attributes' => [
'type' => 'number',
],
'default' => 0,
];
$fields[] = [
'name' => esc_html__( 'Maximum of Search Aea', 'opalestate-pro' ),
'desc' => esc_html__( 'Enter maximum of area for starting search', 'opalestate-pro' ),
'id' => 'search_max_area',
'type' => 'text_small',
'attributes' => [
'type' => 'number',
],
'default' => 1000,
];
$fields[] = [
'name' => esc_html__( 'Search Grid layout', 'opalestate-pro' ),
'id' => 'property_search_grid_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_grid_layouts(),
];
$fields[] = [
'name' => esc_html__( 'Search List layout', 'opalestate-pro' ),
'id' => 'property_search_list_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_list_layouts(),
];
$fields[] = [
'name' => esc_html__( 'Horizontal Search Fields', 'opalestate-pro' ),
'desc' => esc_html__( 'Disable or enable fields appearing in search form', 'opalestate-pro' ),
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_1',
'before_row' => '<hr>',
'after_row' => '<hr>',
];
$fields[] = [
'name' => esc_html__( 'Show Price', 'opalestate-pro' ),
'id' => OPALESTATE_PROPERTY_PREFIX . 'price_opt',
'type' => 'switch',
'options' => [
0 => esc_html__( 'Disable', 'opalestate-pro' ),
1 => esc_html__( 'Enable', 'opalestate-pro' ),
],
];
foreach ( $metas as $key => $meta ) {
$fields[] = [
'name' => $meta['name'],
'id' => $meta['id'] . '_opt',
'type' => 'switch',
'options' => [
0 => esc_html__( 'Disable', 'opalestate-pro' ),
1 => esc_html__( 'Enable', 'opalestate-pro' ),
],
];
}
$fields[] = [
'name' => esc_html__( 'Vertical Search Fields', 'opalestate-pro' ),
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_2',
'before_row' => '<hr>',
'after_row' => '<hr>',
];
$fields[] = [
'name' => esc_html__( 'Show Price', 'opalestate-pro' ),
'id' => OPALESTATE_PROPERTY_PREFIX . 'price_opt_v',
'type' => 'switch',
'options' => [
0 => esc_html__( 'Disable', 'opalestate-pro' ),
1 => esc_html__( 'Enable', 'opalestate-pro' ),
],
];
foreach ( $metas as $key => $meta ) {
$fields[] = [
'name' => $meta['name'],
'id' => $meta['id'] . '_opt_v',
'type' => 'switch',
'options' => [
0 => esc_html__( 'Disable', 'opalestate-pro' ),
1 => esc_html__( 'Enable', 'opalestate-pro' ),
],
];
}
}
return $fields;
}
/**
*
*/
private function get_subtab_detail_fields() {
$fields = [];
$fields[] = [
'name' => esc_html__( 'Show Amenities tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Amenities tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_amenities',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Facilities tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Facilities tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_facilities',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Attachments tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Attachments tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_attachments',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Video tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Video tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_video',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Map tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Map tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_map',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Nearby tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Nearby tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_nearby',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Walk Scores tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Walk Scores tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_walkscores',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Apartments tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Apartments tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_apartments',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Floor Plans tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Floor Plans tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_floor_plans',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Show Views Statistics tab', 'opalestate-pro' ),
'desc' => esc_html__( 'Show Views Statistics tab in the single property page.', 'opalestate-pro' ),
'id' => 'enable_single_views_statistics',
'type' => 'switch',
'options' => [
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
],
];
$fields[] = [
'name' => esc_html__( 'Views Statistics time limit (days)', 'opalestate-pro' ),
'desc' => esc_html__( 'The number of days will be saved to the database.', 'opalestate-pro' ),
'id' => 'single_views_statistics_limit',
'type' => 'text_small',
'attributes' => [
'type' => 'number',
'min' => 1,
'max' => 365,
],
'default' => 8,
];
$fields[] = [
'name' => esc_html__( 'Related properties layout', 'opalestate-pro' ),
'desc' => esc_html__( 'Select a layout for related properties.', 'opalestate-pro' ),
'id' => 'single_related_properties_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_layouts(),
];
$fields[] = [
'name' => esc_html__( 'Nearby properties layout', 'opalestate-pro' ),
'desc' => esc_html__( 'Select a layout for nearby properties.', 'opalestate-pro' ),
'id' => 'single_nearby_properties_layout',
'type' => 'select',
'options' => opalestate_get_loop_property_layouts(),
];
return $fields;
}
}