| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentBooking\App\Services\GlobalModules; |
| 4 |
|
| 5 |
use FluentBooking\App\App; |
| 6 |
use FluentBooking\App\Services\Helper; |
| 7 |
use FluentBooking\Framework\Support\Arr; |
| 8 |
|
| 9 |
class GlobalModules |
| 10 |
{ |
| 11 |
public function register() |
| 12 |
{ |
| 13 |
add_filter('fluent_booking/settings_menu_items', [$this, 'addMenuItem'], 20); |
| 14 |
} |
| 15 |
|
| 16 |
public function addMenuItem($items) |
| 17 |
{ |
| 18 |
$app = App::getInstance(); |
| 19 |
$items['global_modules'] = [ |
| 20 |
'title' => __('Advanced Feaures & Addons', 'fluent-booking'), |
| 21 |
'disable' => false, |
| 22 |
'icon_url' => $app['url.assets'] . 'images/checklist.svg', |
| 23 |
'component_type' => 'StandAloneComponent', |
| 24 |
'route' => [ |
| 25 |
'name' => 'globalModules' |
| 26 |
] |
| 27 |
]; |
| 28 |
|
| 29 |
return $items; |
| 30 |
} |
| 31 |
|
| 32 |
public function getAllModules() |
| 33 |
{ |
| 34 |
$assetUrl = App::getInstance('url.assets'); |
| 35 |
$settings = Helper::getGlobalModuleSettings(); |
| 36 |
return apply_filters('fluent_booking/global_modules', [ |
| 37 |
'woo' => [ |
| 38 |
'logo' => $assetUrl . 'images/woo.svg', |
| 39 |
'name' => 'woo', |
| 40 |
'title' => __('WooCommerce', 'fluent-booking'), |
| 41 |
'description' => __('Accept payment on your booking appointment with WooCommerce Checkout', 'fluent-booking'), |
| 42 |
'is_unavailable' => !defined('WC_PLUGIN_FILE'), |
| 43 |
'is_system' => 'no', |
| 44 |
'is_active' => Arr::get($settings, 'woocommerce') == 'yes', |
| 45 |
], |
| 46 |
'fluentcrm' => [ |
| 47 |
'logo' => $assetUrl . 'images/fluentcrm.svg', |
| 48 |
'name' => 'fluentcrm', |
| 49 |
'title' => __('FluentCRM', 'fluent-booking'), |
| 50 |
'description' => __('Segment your guests, send bulk emails, run automations using FluentCRM', 'fluent-booking'), |
| 51 |
'is_unavailable' => defined('FLUENTCRM'), |
| 52 |
'install_url' => admin_url('plugin-install.php?s=FluentCRM&tab=search&type=term'), |
| 53 |
'is_system' => 'yes', |
| 54 |
'is_active' => defined('FLUENTCRM') |
| 55 |
], |
| 56 |
'fluentform' => [ |
| 57 |
'logo' => $assetUrl . 'images/fluentform.png', |
| 58 |
'name' => 'fluentform', |
| 59 |
'title' => __('Fluent Forms', 'fluent-booking'), |
| 60 |
'description' => __('Create beautiful booking forms using Fluent Forms with your booking field', 'fluent-booking'), |
| 61 |
'is_unavailable' => defined('FLUENTFORM'), |
| 62 |
'install_url' => admin_url('plugin-install.php?s=Fluent%20Forms&tab=search&type=term'), |
| 63 |
'is_system' => 'yes', |
| 64 |
'is_active' => defined('FLUENTFORM') |
| 65 |
], |
| 66 |
'fluentboards' => [ |
| 67 |
'logo' => $assetUrl . 'images/fluentboards.png', |
| 68 |
'name' => 'fluentboards', |
| 69 |
'title' => __('Fluent Boards', 'fluent-booking'), |
| 70 |
'description' => __('Seamlessly create tasks in Fluent Boards using your booking field', 'fluent-booking'), |
| 71 |
'is_unavailable' => defined('FLUENT_BOARDS'), |
| 72 |
'install_url' => admin_url('plugin-install.php?s=FluentBoards&tab=search&type=term'), |
| 73 |
'is_system' => 'yes', |
| 74 |
'is_active' => defined('FLUENT_BOARDS') |
| 75 |
] |
| 76 |
]); |
| 77 |
} |
| 78 |
} |
| 79 |
|