| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\FluentPlayer; |
| 4 |
|
| 5 |
use FluentCart\App\App; |
| 6 |
use FluentCart\App\Vite; |
| 7 |
|
| 8 |
/** |
| 9 |
* Enqueues the admin entry that pushes the Video tab into the Product Gallery |
| 10 |
* dialog. The tab shows even while FluentPlayer is inactive so it can offer |
| 11 |
* install/activate; the tab body branches on the localized config. |
| 12 |
*/ |
| 13 |
class FluentPlayerAdminAssets |
| 14 |
{ |
| 15 |
const HANDLE = 'fluent_cart_fluent_player_gallery'; |
| 16 |
|
| 17 |
public function register(): void |
| 18 |
{ |
| 19 |
add_action('fluent_cart/loading_app', [$this, 'enqueue']); |
| 20 |
} |
| 21 |
|
| 22 |
public function enqueue(): void |
| 23 |
{ |
| 24 |
$slug = App::getInstance()->config->get('app.slug'); |
| 25 |
|
| 26 |
Vite::enqueueScript( |
| 27 |
self::HANDLE, |
| 28 |
'admin/Modules/Products/FluentPlayer/fluent-player-gallery.js', |
| 29 |
[$slug . '_global_admin_hooks'] |
| 30 |
); |
| 31 |
} |
| 32 |
} |
| 33 |
|