Settings > (Sync) Export page * @category Settings API * @author wpdevelop * * @web-site https://wpbookingcalendar.com/ * @email info@wpbookingcalendar.com * @modified 2017-07-09 * * This is COMMERCIAL SCRIPT * We are not guarantee correct work and support of Booking Calendar, if some file(s) was modified by someone else then wpdevelop. */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) {exit;} /** * Show Content * Update Content * Define Slug * Define where to show */ class WPBC_Page_SettingsExportFeeds extends WPBC_Page_Structure { public $settings_api = false; public function in_page() { return 'wpbc-settings'; } public function tabs() { $tabs = array(); $tabs[ 'sync' ] = array( 'title' => __( 'Sync', 'booking') // Title of TAB , 'page_title'=> __( 'Sync', 'booking') // Title of Page , 'hint' => __('Import' ,'booking') . ' / ' . __('Export' ,'booking') //, '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_get_import_export' // CSS definition of forn Icon //, '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() ); $subtabs = array(); $subtabs[ 'export' ] = array( 'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' | 'html' , 'title' => __('Export' ,'booking') . ' - .ics' // Title of TAB , 'page_title' => __('Export Bookings via .ics' ,'booking') //. ' Beta' // Title of Page , 'hint' => __('Set up and configure the export of bookings into .ics feeds.' ,'booking') // Hint , 'link' => '' // link , 'position' => '' // 'left' || 'right' || '' , 'css_classes' => '' // CSS class(es) //, 'icon' => 'http://.../icon.png' // Icon - link to the real PNG img , 'font_icon' => 'wpbc-bi-box-arrow-up-right' // CSS definition of Font Icon , 'default' => false // 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 ); $tabs[ 'sync' ]['subtabs'] = $subtabs; return $tabs; } /** Show Content of Settings page */ public function content() { $this->css(); //////////////////////////////////////////////////////////////////////// // Checking //////////////////////////////////////////////////////////////////////// do_action( 'wpbc_hook_settings_page_header', 'export_feeds_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. //////////////////////////////////////////////////////////////////////// // Load Data //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // S u b m i t Main Form //////////////////////////////////////////////////////////////////////// $submit_form_name = 'wpbc_export_feeds'; // Define form name // $this->get_api()->validated_form_id = $submit_form_name; // Define ID of Form for ability to validate fields (like required field) before submit. // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing 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(); } //////////////////////////////////////////////////////////////////////// // JavaScript: Tooltips, Popover, Datepick (js & css) //////////////////////////////////////////////////////////////////////// echo ''; wpbc_js_for_bookings_page(); echo ''; ?>