* * @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' => '