settings_api === false ) $this->settings_api = new WPBC_Settings_API_General(); return $this->settings_api; } public function tabs() { $tabs = array(); $tabs[ 'general' ] = array( 'title' => __( 'General', 'booking') // Title of TAB , 'page_title' => __( 'General Settings', 'booking') // Title of Page , 'hint' => __( 'General Settings', 'booking') // Hint , 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link , 'position' => '' // 'left' || 'right' || '' , 'css_classes' => '' // CSS class(es) , 'icon' => '' // Icon - link to the real PNG img , 'font_icon' => 'wpbc_icn_tune' // CSS definition of forn Icon , 'default' => true // Is this tab activated by default or not: true || false. ); $subtabs = array(); $subtabs['wpbc-settings-info'] = array( 'type' => 'html', 'html' => wpbc_get_flex_dashboard_info() ); if (0){ $subtabs['wpbc-settings-calendar'] = array( 'type' => 'goto-link' , 'title' => __('Calendar','booking') , 'show_section' => 'wpbc_general_settings_calendar_metabox' ); //FixIn: 8.7.11.10 $subtabs['wpbc-settings-time-slots'] = array( 'type' => 'goto-link' , 'title' => __('Time Slots','booking') , 'show_section' => 'wpbc_general_settings_time_slots_metabox' ); $subtabs['wpbc-settings-availability'] = array( 'type' => 'goto-link' , 'title' => __('Availability','booking') , 'show_section' => 'wpbc_general_settings_availability_metabox' ); $subtabs['wpbc-settings-form'] = array( 'type' => 'goto-link' , 'title' => __('Form','booking') , 'show_section' => 'wpbc_general_settings_form_metabox' ); $subtabs['wpbc-settings-booking-listing'] = array( 'type' => 'goto-link' , 'title' => __('Booking Admin Panel','booking') , 'show_section' => 'wpbc_general_settings_booking_listing_metabox' ); $subtabs['wpbc-settings-booking-timeline'] = array( 'type' => 'goto-link' , 'title' => __('Timeline', 'booking') , 'show_section' => 'wpbc_general_settings_booking_timeline_metabox' ); if ( class_exists('wpdev_bk_biz_s') ) { $subtabs['wpbc-settings-auto-cancelation-approval'] = array( 'type' => 'goto-link' , 'title' => __('Auto cancellation / approval','booking') , 'show_section' => 'wpbc_general_settings_auto_cancelation_approval_metabox' ); } $subtabs['wpbc-settings-capacity'] = array( 'type' => 'goto-link' , 'title' => __('Capacity', 'booking') //. ' ' . '' . __( 'New', 'booking' ) . '' , 'show_section' => 'wpbc_general_settings_capacity_metabox' ); $subtabs['wpbc-settings-capacity_new'] = array( 'type' => 'html' , 'html' => '' . __( 'New', 'booking' ) . '' ); $subtabs['wpbc-settings-advanced'] = array( 'type' => 'goto-link' , 'title' => __('Advanced','booking') , 'show_section' => 'wpbc_general_settings_advanced_metabox' ); $subtabs['wpbc-settings-menu-access'] = array( 'type' => 'goto-link' , 'title' => __('Plugin Menu','booking') , 'show_section' => 'wpbc_general_settings_permissions_metabox' ); $subtabs['wpbc-settings-uninstall'] = array( 'type' => 'goto-link' , 'title' => __('Uninstall','booking') , 'show_section' => 'wpbc_general_settings_uninstall_metabox' ); // $subtabs['wpbc-settings-technical'] = array( 'type' => 'goto-link' // , 'title' => __('Help', 'booking') // , 'show_section' => 'wpbc_general_settings_help_metabox' // ); $subtabs['form-save'] = array( 'type' => 'button' , 'title' => __('Save Changes','booking') , 'form' => 'wpbc_general_settings_form' ); } $tabs[ 'general' ][ 'subtabs' ] = $subtabs; return $tabs; } public function content() { // Checking //////////////////////////////////////////////////////////// do_action( 'wpbc_hook_settings_page_header', 'general_settings'); // Define Notices Section and show some static messages, if needed if ( ! wpbc_is_mu_user_can_be_here('activated_user') ) return false; // Check if MU user activated, otherwise show Warning message. if ( ! wpbc_is_mu_user_can_be_here('only_super_admin') ) return false; // User is not Super admin, so exit. Basically its was already checked at the bottom of the PHP file, just in case. $is_can = apply_bk_filter('recheck_version', true); if ( ! $is_can ) { ?>settings_api(); // Define all fields and get values from DB // Submit ///////////////////////////////////////////////////////////// $submit_form_name = 'wpbc_general_settings_form'; // Define form name if ( isset( $_POST['is_form_sbmitted_'. $submit_form_name ] ) ) { // Nonce checking {Return false if invalid, 1 if generated between, 0-12 hours ago, 2 if generated between 12-24 hours ago. } $nonce_gen_time = check_admin_referer( 'wpbc_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page // Save Changes $this->update(); } if ( ! empty( $_GET['scroll_to_section'] ) ) { ?>'; wpbc_js_for_bookings_page(); echo ''; // Content //////////////////////////////////////////////////////////// ?>