| 1 |
<?php |
| 2 |
/** |
| 3 |
* Cartflows Blocks Loader. |
| 4 |
* |
| 5 |
* @package Cartflows |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! class_exists( 'Cartflows_Block_Loader' ) ) { |
| 13 |
|
| 14 |
/** |
| 15 |
* Class Cartflows_Block_Loader. |
| 16 |
*/ |
| 17 |
final class Cartflows_Block_Loader { |
| 18 |
|
| 19 |
/** |
| 20 |
* Member Variable |
| 21 |
* |
| 22 |
* @var instance |
| 23 |
*/ |
| 24 |
private static $instance; |
| 25 |
|
| 26 |
/** |
| 27 |
* Initiator |
| 28 |
*/ |
| 29 |
public static function get_instance() { |
| 30 |
if ( ! isset( self::$instance ) ) { |
| 31 |
self::$instance = new self(); |
| 32 |
} |
| 33 |
return self::$instance; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Constructor |
| 38 |
*/ |
| 39 |
public function __construct() { |
| 40 |
|
| 41 |
define( 'CF_TABLET_BREAKPOINT', '976' ); |
| 42 |
define( 'CF_MOBILE_BREAKPOINT', '767' ); |
| 43 |
|
| 44 |
$this->load_plugin(); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Loads plugin files. |
| 49 |
* |
| 50 |
* @since 1.6.15 |
| 51 |
* |
| 52 |
* @return void |
| 53 |
*/ |
| 54 |
public function load_plugin() { |
| 55 |
|
| 56 |
if ( ! function_exists( 'is_plugin_active' ) ) { |
| 57 |
include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 58 |
} |
| 59 |
|
| 60 |
$is_spectra_active = is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ); |
| 61 |
|
| 62 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-gb-helper.php'; |
| 63 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-gutenberg-editor.php'; |
| 64 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-init-blocks.php'; |
| 65 |
|
| 66 |
if ( ! $is_spectra_active ) { |
| 67 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/classes/class-cartflows-spectra-compatibility.php'; |
| 68 |
} |
| 69 |
if ( wcf()->is_woo_active ) { |
| 70 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/order-detail-form/class-wcfb-order-detail-form.php'; |
| 71 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/checkout-form/class-wcfb-checkout-form.php'; |
| 72 |
require_once CARTFLOWS_DIR . 'modules/gutenberg/dist/blocks/optin-form/class-wcfb-optin-form.php'; |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
Cartflows_Block_Loader::get_instance(); |
| 77 |
} |
| 78 |
|
| 79 |
|