| 1 |
<?php /** |
| 2 |
* @version 1.0 |
| 3 |
* @description Listing |
| 4 |
* @category Contacts Listings |
| 5 |
* @author wpdevelop |
| 6 |
* |
| 7 |
* @web-site http://oplugins.com/ |
| 8 |
* @email info@oplugins.com |
| 9 |
* |
| 10 |
* @modified 2020-02-10 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 14 |
|
| 15 |
class WPBC_Listing { |
| 16 |
|
| 17 |
/** |
| 18 |
* Define HOOKs for loading CSS and JavaScript files |
| 19 |
*/ |
| 20 |
public function init_load_css_js() { |
| 21 |
// JS & CSS |
| 22 |
add_action( 'wpbc_enqueue_js_files', array( $this, 'js_load_files' ), 50 ); |
| 23 |
add_action( 'wpbc_enqueue_css_files', array( $this, 'enqueue_css_files' ), 50 ); |
| 24 |
} |
| 25 |
|
| 26 |
/** JSS */ |
| 27 |
public function js_load_files( $where_to_load ) { |
| 28 |
|
| 29 |
$in_footer = true; |
| 30 |
|
| 31 |
if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) { |
| 32 |
|
| 33 |
wp_enqueue_script( 'wpbc-listing_class', trailingslashit( plugins_url( '', __FILE__ ) ) . 'listing_ui.js' /* wpbc_plugin_url( '/_out/js/code_mirror.js' ) */ |
| 34 |
, array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); |
| 35 |
/** |
| 36 |
wp_localize_script( 'wpbc_all', 'wpbc_live_request_obj' |
| 37 |
, array( |
| 38 |
'contacts' => '', |
| 39 |
'reminders' => '' |
| 40 |
) |
| 41 |
); |
| 42 |
*/ |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
/** CSS */ |
| 47 |
public function enqueue_css_files( $where_to_load ) { |
| 48 |
|
| 49 |
if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) { |
| 50 |
|
| 51 |
wp_enqueue_style( 'wpbc-listing_class', trailingslashit( plugins_url( '', __FILE__ ) ) . 'listing_ui.css', array(), WP_BK_VERSION_NUM ); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
// </editor-fold> |
| 56 |
|
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Just for loading CSS and JavaScript files |
| 61 |
*/ |
| 62 |
if ( true ) { |
| 63 |
$js_css_loading = new WPBC_Listing; |
| 64 |
$js_css_loading->init_load_css_js(); |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
function wpbc_ajx_booking_listing__get_default_view_mode(){ |
| 69 |
|
| 70 |
// FixIn: 9.6.3.5. |
| 71 |
$booking_default_view_mode = wpbc_get_default_saved_view_mode_for_wpbc_page(); |
| 72 |
return $booking_default_view_mode; |
| 73 |
|
| 74 |
} |