| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicOptIn; |
| 4 |
|
| 5 |
use Elementor\Core\Base\Module as BaseModule; |
| 6 |
use Elementor\Modules\AtomicWidgets\OptIn\Opt_In as Atomic_Widgets_Opt_In; |
| 7 |
use Elementor\Plugin; |
| 8 |
|
| 9 |
class Module extends BaseModule { |
| 10 |
const EXPERIMENT_NAME = Atomic_Widgets_Opt_In::EXPERIMENT_NAME; |
| 11 |
const MODULE_NAME = 'editor-v4-opt-in'; |
| 12 |
const WELCOME_POPOVER_DISPLAYED_OPTION = '_e_welcome_popover_displayed'; |
| 13 |
|
| 14 |
public function get_name() { |
| 15 |
return 'atomic-opt-in'; |
| 16 |
} |
| 17 |
|
| 18 |
public function get_opt_in_css_assets_url( string $path ) { |
| 19 |
return $this->get_css_assets_url( $path ); |
| 20 |
} |
| 21 |
|
| 22 |
public function __construct() { |
| 23 |
( new PanelChip() )->init(); |
| 24 |
|
| 25 |
( new Atomic_Widgets_Opt_In() )->init(); |
| 26 |
( new OptInPage( $this ) )->init(); |
| 27 |
|
| 28 |
if ( ! $this->is_atomic_experiment_active() ) { |
| 29 |
return; |
| 30 |
} |
| 31 |
|
| 32 |
( new WelcomeScreen() )->init(); |
| 33 |
} |
| 34 |
|
| 35 |
public function is_atomic_experiment_active(): bool { |
| 36 |
return Plugin::$instance->experiments->is_feature_active( Atomic_Widgets_Opt_In::EXPERIMENT_NAME ); |
| 37 |
} |
| 38 |
} |
| 39 |
|