| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class Actions Toolbar -- 'Bulk Actions' Dropdown. |
| 4 |
* |
| 5 |
* @package Support functions. |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit, if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
// JavaScript Hook: in ../includes/page-bookings/_src/boo_listing__actions.js -> function wpbc_boo_listing__init_hook__sort_by() { ... } . |
| 13 |
|
| 14 |
/** |
| 15 |
* Class WPBC_Listing_Actions__Bulk_Actions |
| 16 |
* |
| 17 |
* INFO: Get request parameter in template: var p_value = wpbc_ajx_booking_listing.search_get_param( 'bulk_actions' ); |
| 18 |
*/ |
| 19 |
class WPBC_Listing_Actions__Bulk_Actions { |
| 20 |
|
| 21 |
const ID = 'bulk_actions'; |
| 22 |
|
| 23 |
/** |
| 24 |
* Get Action Button |
| 25 |
* |
| 26 |
* @return false|string |
| 27 |
*/ |
| 28 |
public static function get_button() { |
| 29 |
|
| 30 |
$el_arr = array( |
| 31 |
'font_icon' => 'wpbc_icn_adjust', |
| 32 |
'title' => '<span class="nav-tab-text hide_in_mobile">' . __( 'Bulk Actions', 'booking' ) . ' </span><span class="selected_value"></span>', |
| 33 |
'hint' => array( |
| 34 |
'title' => __( 'Select sorting order', 'booking' ), |
| 35 |
'position' => 'top', |
| 36 |
), |
| 37 |
'position' => 'left', |
| 38 |
'has_down_arrow' => true, |
| 39 |
'has_border' => true, |
| 40 |
'container_class' => 'ul_dropdown_menu__' . self::ID, |
| 41 |
'items' => array( |
| 42 |
array( 'type' => 'header', 'title' => __( 'Action on selected bookings', 'booking' ), 'class' => 'hide_button_if_no_selection' ), |
| 43 |
array( 'html' => WPBC_Listing_Actions__Set_Approve::get_option() ), |
| 44 |
array( 'html' => WPBC_Listing_Actions__Set_Pending::get_option() ), |
| 45 |
array( 'html' => WPBC_Listing_Actions__To_Trash::get_option() ), |
| 46 |
array( 'html' => WPBC_Listing_Actions__Restore_From_Trash::get_option() ), |
| 47 |
array( 'html' => WPBC_Listing_Actions__Completely_Delete::get_option() ), |
| 48 |
array( 'type' => 'divider', 'class' => 'hide_button_if_no_selection' ), |
| 49 |
array( 'html' => WPBC_Listing_Actions__Set_As_Unread::get_option() ), |
| 50 |
array( 'html' => WPBC_Listing_Actions__Set_As_Read::get_option() ), |
| 51 |
array( 'html' => WPBC_Listing_Actions__Set_Read_All::get_option() ), |
| 52 |
array( 'type' => 'divider', 'class' => 'hide_button_if_no_selection0' ), |
| 53 |
array( 'html' => WPBC_Listing_Actions__Bulk_Print::get_option() ), |
| 54 |
array( 'html' => WPBC_Listing_Actions__Export_CSV::get_option() ), |
| 55 |
array( 'html' => WPBC_Listing_Actions__Import_Google_Calendar::get_option() ), |
| 56 |
array( 'type' => 'divider' ), |
| 57 |
array( 'html' => WPBC_Listing_Actions__Empty_Trash::get_option() ), |
| 58 |
), |
| 59 |
); |
| 60 |
|
| 61 |
wpbc_ui_el__dropdown_menu( $el_arr ); |
| 62 |
} |
| 63 |
} |
| 64 |
|