| 1 |
<?php /** |
| 2 |
* @version 1.0 |
| 3 |
* @package Booking Calendar |
| 4 |
* @category Content of Booking Listing page |
| 5 |
* @author wpdevelop |
| 6 |
* |
| 7 |
* @web-site https://wpbookingcalendar.com/ |
| 8 |
* @email info@wpbookingcalendar.com |
| 9 |
* |
| 10 |
* @modified 2015-11-13 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
/** |
| 18 |
* Show Content |
| 19 |
* Update Content |
| 20 |
* Define Slug |
| 21 |
* Define where to show |
| 22 |
*/ |
| 23 |
class WPBC_Page_CalendarOverview extends WPBC_Page_Structure { |
| 24 |
|
| 25 |
private $timeline; |
| 26 |
|
| 27 |
public function in_page() { |
| 28 |
return 'wpbc'; |
| 29 |
} |
| 30 |
|
| 31 |
public function tabs() { |
| 32 |
|
| 33 |
$is_full_screen = WPBC_User_Custom_Data_Saver::get_user_data_value( wpbc_get_current_user_id(), 'is_full_screen' ); |
| 34 |
$is_full_screen = function_exists( 'wpbc_ui__get_full_screen_mode_from_cookie' ) |
| 35 |
? wpbc_ui__get_full_screen_mode_from_cookie( $is_full_screen ) |
| 36 |
: $is_full_screen; |
| 37 |
$is_full_screen = ( 'On' === $is_full_screen ); |
| 38 |
|
| 39 |
$tabs = array(); |
| 40 |
$tabs[ 'vm_calendar' ] = array( |
| 41 |
'is_show_top_path' => true, // true | false. By default value is: true. |
| 42 |
'is_show_top_navigation' => true, // true | false. By default value is: false. |
| 43 |
'left_navigation__default_view_mode' => '', // FixIn:11.7.1.1: ( $is_full_screen ) ? 'compact' : 'min', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. |
| 44 |
'page_title' => false, // Header - Title. If false, than hidden. |
| 45 |
'page_description' => false, // Header - Title Description. If false, than hidden. |
| 46 |
'title' => __('Timeline View','booking') // Title of TAB |
| 47 |
, 'hint' => __('Timeline View', 'booking') // Hint |
| 48 |
, 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link |
| 49 |
, 'position' => '' // 'left' || 'right' || '' |
| 50 |
, 'css_classes' => '' // CSS class(es) |
| 51 |
, 'icon' => '' // Icon - link to the real PNG img |
| 52 |
, 'font_icon' => 'wpbc_icn_rotate_90 wpbc_icn_align_vertical_bottom' // CSS definition of forn Icon // FixIn: 9.5.5.3. |
| 53 |
, 'default' => false // Is this tab activated by default or not: true || false. |
| 54 |
, 'disabled' => false // Is this tab disbaled: true || false. |
| 55 |
, 'hided' => true // Is this tab hided: true || false. |
| 56 |
, 'subtabs' => array() |
| 57 |
|
| 58 |
); |
| 59 |
// $tabs[ 'add-booking' ] = array( |
| 60 |
// 'is_show_top_path' => false, // true | false. By default value is: false. |
| 61 |
// 'left_navigation__default_view_mode' => 'min', // '' | 'min' | 'compact' | 'max' | 'none'. By default value is: ''. |
| 62 |
// 'page_title' => __( 'Add New Booking', 'booking' ), // Header - Title. If false, than hidden. |
| 63 |
// 'page_description' => __( 'Manually add new bookings from the Admin Panel.', 'booking' ), // Header - Title Description. If false, than hidden. |
| 64 |
// 'title' => __( 'Add booking', 'booking' ), // Title of TAB. |
| 65 |
// 'hint' => __( 'Add booking', 'booking' ), // Hint. |
| 66 |
// 'position' => '', // Can be: 'left' | 'right' | ''. |
| 67 |
// 'css_classes' => '', // this is CSS class(es). |
| 68 |
// 'icon' => '', // Icon - link to the real PNG img. |
| 69 |
// 'font_icon' => 'wpbc-bi-plus', // CSS definition of forn Icon. |
| 70 |
// 'default' => false, // Is this tab disbaled: true || false. |
| 71 |
// 'disabled' => false, // Is this tab disbaled: true || false. |
| 72 |
// 'hided' => !false, // Is this tab hided: true || false. |
| 73 |
// 'subtabs' => array() |
| 74 |
// , 'link' => wpbc_get_new_booking_url__base( ) // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link |
| 75 |
// //, 'font_icon_right' => 'wpbc-bi-question-circle' |
| 76 |
// , 'folder_style' => 'order:101;', |
| 77 |
// ); |
| 78 |
// |
| 79 |
|
| 80 |
// $subtabs = array(); |
| 81 |
// $tabs[ 'bookings' ][ 'subtabs' ] = $subtabs; |
| 82 |
|
| 83 |
return $tabs; |
| 84 |
} |
| 85 |
|
| 86 |
|
| 87 |
public function content() { |
| 88 |
|
| 89 |
wpbc_check_request_paramters(); //Cleanup REQUEST parameters // FixIn: 6.2.1.4. |
| 90 |
|
| 91 |
do_action( 'wpbc_hook_booking_page_header', 'timeline' ); // Define Notices Section and show some static messages, if needed. |
| 92 |
|
| 93 |
if ( ! wpbc_is_mu_user_can_be_here( 'activated_user' ) ) return false; // Check if MU user activated, otherwise show Warning message. |
| 94 |
|
| 95 |
if ( ! wpbc_set_default_resource_to__get() ) return false; // Define default booking resources for $_ GET and check if booking resource belong to user. |
| 96 |
|
| 97 |
?><span class="wpdevelop"><?php // BS UI CSS Class |
| 98 |
|
| 99 |
wpbc_js_for_bookings_page(); // JavaScript functions |
| 100 |
|
| 101 |
|
| 102 |
make_bk_action( 'wpbc_check_request_param__wh_booking_type' ); // Setting $_REQUEST['wh_booking_type'] - remove empty and duplicates ID of booking resources in this list |
| 103 |
|
| 104 |
make_bk_action( 'check_for_resources_of_notsuperadmin_in_booking_listing' ); // If "Regular User", then filter resources in $_REQUEST['wh_booking_type'] to show only resources of this user |
| 105 |
|
| 106 |
wpbc_set_request_params_for_timeline(); // Set initial $_REQUEST['view_days_num'] depend from selected booking resources |
| 107 |
|
| 108 |
// T o o l b a r s ///////////////////////////////////////////////// |
| 109 |
wpbc_ui__timeline__resource_selection(); |
| 110 |
|
| 111 |
|
| 112 |
// Show T i m e L i n e /////////////////////////////////////// |
| 113 |
|
| 114 |
// FixIn: 9.9.0.18. |
| 115 |
$server_zone = date_default_timezone_get(); // If in 'Theme' or 'other plugin' set default timezone other than UTC. Save it. |
| 116 |
if ( 'UTC' !== $server_zone ) { // Needed for WP date functions - set timezone to UTC |
| 117 |
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set |
| 118 |
@date_default_timezone_set( 'UTC' ); |
| 119 |
} |
| 120 |
|
| 121 |
// FixIn: 8.6.1.13. |
| 122 |
$this->timeline = new WPBC_TimelineFlex(); |
| 123 |
|
| 124 |
$this->timeline->admin_init(); // Define all REQUEST parameters and get bookings |
| 125 |
|
| 126 |
$this->timeline->show_timeline(); |
| 127 |
|
| 128 |
// FixIn: 9.9.0.18. |
| 129 |
if ( 'UTC' !== $server_zone ) { // Back to previos state, if it was changed. |
| 130 |
// phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set |
| 131 |
@date_default_timezone_set( $server_zone ); |
| 132 |
} |
| 133 |
|
| 134 |
//////////////////////////////////////////////////////////////////// |
| 135 |
|
| 136 |
wpbc_welcome_panel(); // Welcome Panel (links) |
| 137 |
|
| 138 |
wpbc_show_booking_footer(); |
| 139 |
|
| 140 |
?></span><!-- wpdevelop class --><?php |
| 141 |
|
| 142 |
if ( class_exists( 'WPBC_Add_Booking_Modal' ) ) { |
| 143 |
WPBC_Add_Booking_Modal::template_for_modal(); |
| 144 |
} |
| 145 |
} |
| 146 |
|
| 147 |
} |
| 148 |
add_action('wpbc_menu_created', array( new WPBC_Page_CalendarOverview() , '__construct') ); // Executed after creation of Menu |
| 149 |
|