true, // true | false. By default value is: false.
'is_force_full_screen' => true, // true | false. Force full screen independently from user preference.
'is_show_top_path' => true, // true | false. By default value is: true.
'is_show_top_navigation' => false, // true | false. By default value is: false.
'right_vertical_sidebar__is_show' => true, // true | false. By default value is: false.
'right_vertical_sidebar__default_view_mode' => '', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
'right_vertical_sidebar_compact__is_show' => true, // true | false. By default value is: false.
'left_navigation__default_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''.
'left_navigation__force_view_mode' => 'compact', // '' | 'min' | 'compact' | 'max' | 'none'. Force sidebar mode independently from user preference.
'top_path_title' => __( 'Forms Builder', 'booking' ),
'title' => __( 'Forms Builder', 'booking' ), // Title of TAB.
'hint' => '', //__( 'Define available and unavailable days for your calendar(s).', 'booking' ), // Hint.
'page_title' => __( 'Forms Builder', 'booking' ), // Title of Page.
'link' => '', // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link.
'position' => '', // 'left' / 'right' / ''.
'css_classes' => '', // CSS c l a s s(es).
'icon' => '', // Icon - link to the real PNG img.
'font_icon' => 'wpbc_icn_flip_x0 wpbc-bi-input-cursor-text 0layout-text-window-reverse', // 'wpbc_icn_free_cancellation' // CSS definition of forn Icon.
'font_icon_right' => '', // 'wpbc-bi-asterisk',
'default' => false, // Is this tab activated by default or not: true || false.
'disabled' => false, // Is this tab disbaled: true || false.
'hided' => false, // Is this tab hided: true || false.
'subtabs' => array(),
'folder_style' => 'order:12;',
);
return $tabs;
}
// -- Right Sidebar -----------------------------------------------------------------------------------------------
/**
* == Right | Sidebar Compact | Content ==
*
* @return void
*/
public function right_sidebar_compact_content() {
?>
palette_add_new__content();
?>
';
wpbc_bfb__ui__add_columns_control();
// == Expose AJAX settings to JS on the Builder page ==
wpbc_bfb_output_ajax_boot_config();
// == Top Horizontal menu ==
$tabs_config = array(
'builder_tab' => array(
'title' => __( 'Form Builder', 'booking' ) . ' (Visual)',
'type' => 'panel',
'css_classes' => '',
'data_attr' => array(
'data-wpbc-bfb-top-builder-btn' => '1',
),
),
'advanced_tab' => array(
'title' => __( 'Advanced Mode', 'booking' ) . ' (Code)',
'type' => 'panel',
'css_classes' => '',
'data_attr' => array(
'data-wpbc-bfb-top-advanced-btn' => '1',
),
),
);
$tabs_config['debug_tab'] = array(
'title' => __( 'Debug', 'booking' ),
'type' => 'panel',
'css_classes' => 'align_right small_debug_tab',
'hint' => array(
'title' => __( 'Show debug export outputs', 'booking' ),
'position' => 'top',
),
);
$tabs_config = apply_filters( 'wpbc_bfb_ui__top_tabs', $tabs_config, array() );
$preferred_tab_id = 'builder_tab'; //TODO: make selection based on "bfb_options":{"advanced_mode_source":"builder"}
$active_tab_id = WPBC_BFB_UI_Top_Tabs::resolve_active_tab_id( $tabs_config, $preferred_tab_id );
WPBC_BFB_UI_Top_Tabs::render(
array(
'active_tab' => $active_tab_id,
'tabs' => $tabs_config,
'nav_container_id' => 'wpbc_bfb__top_horisontal_nav',
'panels_root_id' => 'wpbc_bfb__top_panels',
'panel_base_class' => 'wpbc_bfb__top_tab_section',
)
);
// == Content ==
?>
> 'widget_wpbc_dismiss__booking_form_advanced_mode',
'dismiss_css_class' => '.wpbc_dismiss__booking_form_advanced_mode',
'blured_in_versions' => array( 'free' ),
'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#booking-resources' ),
'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
'versions' => 'paid versions',
'css' => 'transform: translate(0) translateY(290px);',
'no_dismiss' => true
)
);
echo $upgrade_content_arr['content']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
>
array(
'title' => __( 'Export', 'booking' ),
'type' => 'panel',
'css_classes' => '',
),
'debug_mode__import' => array(
'title' => __( 'Import', 'booking' ),
'type' => 'panel',
'css_classes' => '',
),
'debug_mode__actual_bfb' => array(
'title' => __( 'Actual Builder Code', 'booking' ),
'type' => 'panel',
'css_classes' => '',
),
);
WPBC_BFB_UI_Top_Tabs::render(
array(
'active_tab' => 'debug_mode__export',
'tabs' => $tabs_config_debug,
'nav_container_id' => 'wpbc_bfb__top_horisontal__debug_mode',
'panels_root_id' => 'wpbc_bfb__debug_mode_panels',
)
);
?>
>
Settings > Booking Form" page.
*
* @param bool $is_show - 'usually' - true.
* @param string $page_tag - can be 'wpbc-settings'.
* @param string $active_page_tab - can be 'form'.
* @param string $active_page_subtab - can be 'booking_form_fields'.
*
* @return false|mixed
*/
function wpbc_form_fields__check__showing_page( $is_show, $page_tag, $active_page_tab, $active_page_subtab ) {
if ( ( 'form' === $active_page_tab ) && ( 'wpbc-settings' === $page_tag ) ) {
$is_show = false;
}
return $is_show;
}
// Important here to have priority 20 instead of 10, because it can be ovveriden by same hook in MU, where we check 'check_for_active_users'.
add_filter( 'wpbc_before_showing_settings_page_is_show_page', 'wpbc_form_fields__check__showing_page', 20, 4 );
/**
* Unset removed legacy Form menu in vertical left menu widget.
*
* @param array $nav_tabs - array of menus.
* @param string $this_page - current selected page.
*
* @return mixed
*/
function wpbc_form_fields__check__plugin_menu_structure( $nav_tabs, $this_page ) {
if ( isset( $nav_tabs['wpbc-settings'] ) && isset( $nav_tabs['wpbc-settings']['form'] ) ) {
unset( $nav_tabs['wpbc-settings']['form'] );
}
return $nav_tabs;
}
add_filter( 'wpbc_plugin_menu_structure_arr', 'wpbc_form_fields__check__plugin_menu_structure', 20, 2 );
/** Trick here to overload default REQUST parameters before page is loading */
function wpbc_form_fields__check__define_page_redirect( $page_tag ) {
// $page_tag - here can be all defined in plugin menu pages. So we need to check activated page. By default its inside of $_GET['page'].
// Execute it only for WP Booking Calendar > Settings > Booking Form > Booking Form Fields page.
if ( wpbc_is_settings_form_page() ) {
// phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect
wp_redirect( admin_url( "admin.php?page=wpbc-settings&tab=builder_booking_form" ) );
}
}
// We are set 9 to execute earlier than hook in WPBC_Admin_Menus.
add_action( 'wpbc_define_nav_tabs', 'wpbc_form_fields__check__define_page_redirect', 9 ); // This Hook fire in the class WPBC_Admin_Menus for showing page content of specific menu