__( 'Manage .ics', 'booking-manager' ) // Title of TAB , 'hint' => __( 'Upload .ics File', 'booking-manager' ) // Hint , 'page_title' => __( 'Booking Manager', 'booking-manager' ) // 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 class(es) , 'icon' => '' // Icon - link to the real PNG img , 'font_icon' => 'glyphicon glyphicon-tasks' // CSS definition of forn Icon , 'default' => true // Is this tab activated by default or not: true || false. , 'disabled' => false // Is this tab disbaled: true || false. , 'hided' => ! true // Is this tab hided: true || false. , 'subtabs' => array() ); $subtabs = array(); // $tabs[ 'items' ][ 'subtabs' ] = $subtabs; // $subtabs['manage'] = array( // 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html' // , 'title' => __( 'Manage .ics', 'booking-manager' ) // Title of TAB // , 'hint' => __( 'Upload .ics File', 'booking-manager' ) // Hint // , 'page_title' => __( 'Booking Manager', 'booking-manager' ) // Title of Page // , 'link' => '' // link // , 'position' => '' // 'left' || 'right' || '' // , 'css_classes' => '' // CSS class(es) // //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img // //, 'font_icon' => 'glyphicon glyphicon-envelope' // CSS definition of Font Icon // , 'default' => true // Is this sub tab activated by default or not: true || false. // , 'disabled' => false // Is this sub tab deactivated: true || false. // , 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) //, 'checkbox' => array( 'checked' => $is_checked, 'name' => 'enabled_active_status' ) // , 'content' => 'content' // Function to load as conten of this TAB // , 'hided' => true // Is this tab hided: true || false. // ); $tabs[ 'wpbm' ]['subtabs'] = $subtabs; return $tabs; } public function content() { // Checking //////////////////////////////////////////////////////////// do_action( 'wpbm_hook_settings_page_header', array( 'page' => $this->in_page() ) ); // Define Notices Section and show some static messages, if needed. // $this->settings_api(); // Init Settings API & Get Data from DB // Submit ///////////////////////////////////////////////////////////// $submit_form_name = 'wpbm_ics_files_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( 'wpbm_settings_page_' . $submit_form_name ); // Its stop show anything on submiting, if its not refear to the original page // Save Changes $data_after_update = $this->update(); } // $wpbm_user_role_master = get_wpbm_option( 'wpbm_user_role_master' ); // O L D W A Y: Get Fields Data ?>
show_toolbar_upload(); wpbm_close_meta_box_section(); /////////////////////////////////////////////////////////// $notice_id = 'wpbm_system_notice_ics_description'; /////////////////////////////////////////////////////////// if ( ( ! wpbm_section_is_dismissed( $notice_id ) ) // || true ) { ?>
' . __( 'Note!', 'booking-manager' ) . ' '; $message_ics = sprintf( __( '.ics - is a file format of iCalendar standard for exchanging calendar and scheduling information between different sources %s Using a common calendar format (.ics), you can keep all your calendars updated and synchronized.', 'booking-manager' ) , '
(Airbnb, ' . 'Booking.com, ' . 'HomeAway, ' . 'TripAdvisor, ' . 'VRBO, ' . 'FlipKey ' . str_replace( array( '.ics', 'iCalendar' ), array( '.ics', 'iCalendar' ), __( 'and any other calendar that uses .ics format', 'booking-manager' ) ) . ').
' ); $message_ics = str_replace( array( '.ics', 'iCalendar' ), array( '.ics', 'iCalendar' ), $message_ics ); echo $message_ics; ?>
css(); do_action( 'wpbm_hook_settings_page_footer', 'ics_files' ); } /** Currently is not being used */ public function update() { return false; $post_action_key = 'wpbm_action'; if ( isset( $_POST[ $post_action_key ] ) && ( $_POST[ $post_action_key ] == 'go_send' ) ) { // Get Validated post $validated = array(); // Email $validated[ 'wpbm_textdata' ] = WPBM_Settings_API::validate_textarea_post_static( 'wpbm_textdata' ); //debuge( $validated ); //////////////////////////////////////////////////////////////////////////////////////////////////////////// wpbm_show_fixed_message ( __('Done', 'booking-manager'), 3 ); //, 'updated warning' ); // Show Message return array ( 'validated_data' => $validated ); // Exit, for do not parse } /** Buld data saving to DB from POST //$validated_fields = $this->settings_api()->validate_post(); // Get Validated Settings fields in $_POST request. //$validated_fields = apply_filters( 'wpbm_settings_validate_fields_before_saving', $validated_fields ); // Hook for validated fields. // unset($validated_fields['wpbm_start_day_weeek']); // Skip saving specific option, for example in Demo mode. //$this->settings_api()->save_to_db( $validated_fields ); // Save fields to DB //wpbm_show_changes_saved_message(); //wpbm_show_fixed_message ( __('Done', 'booking-manager'), 0 ); // Show Message */ /** O L D W A Y: Saving Fields Data // update_wpbm_option( 'wpbm_is_delete_if_deactive' // , WPBM_Settings_API::validate_checkbox_post('wpbm_is_delete_if_deactive') ); // ( (isset( $_POST['wpbm_is_delete_if_deactive'] ))?'On':'Off') ); */ return false; } /** Show Toolbar with Upload / List fields */ function show_toolbar_upload() { // Parameters for Ajax: ?>
(.ics)
set_upload_button( '.wpbm_upload_btn' ); $wpbm_upload->set_element_insert_url( '.wpbm_listing_url' ); } ?>
public function css() { ?> } add_action('wpbm_menu_created', array( new WPBM_Page_Single() , '__construct') ); // Executed after creation of Menu // //////////////////////////////////////////////////////////////////////////////// // AJAX Request //////////////////////////////////////////////////////////////////////////////// /** JavaScript for Ajax */ function wpbm_ics_listing_ajax_js() { $ajx_el_id = 'wpbm_listing_ics_bar'; // In "wpbm-ajax.php" having this: , 'WPBM_LISTING_ICS_URL' => 'admin' ?> esc_url_raw( $_POST[ 'params' ][ 'wpbm_listing_url'] ) //FixIn: 2.0.14.3 , 'from' => 'any' //'today' // '00:00 today' , 'from_offset' => '' , 'until' => 'any' //'year-end' // '00:00 today' , 'until_offset' => '' , 'max' => '' , 'is_all_dates_in' => true ); $listing_echo = wpbm_ics_get_listing( $params ); if ( $is_show_debug_info ) do_action( 'wpbm_show_debug', array( '$listing_echo', $is_show_debug_info, $listing_echo ) ); // S_Y_S_T_E_M L_O_G /////////////////////////////////////////////////////////////////////////////////////// // Get Listing Shortcode /////////////////////////////////////////////////////////////////////////////////////// ob_start(); ?>

[booking-manager-listing url='' from='any' until='any']
'success' ) ); // Return JS OBJ: response_data = { response: "success" } wp_die( '', '', array( 'response' => null ) ); } //