| @@ -1,41 +1,0 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace AcyMailing\WpInit; | |
| 4 | - | |
| 5 | -class Elementor | |
| 6 | -{ | |
| 7 | - public function __construct() | |
| 8 | - { | |
| 9 | - add_action('elementor/editor/before_enqueue_scripts', [$this, 'addAcyScriptElementor']); | |
| 10 | - add_action('elementor/widgets/register', [$this, 'registerWidgets']); | |
| 11 | - add_action('elementor/elements/categories_registered', [$this, 'addWidgetCategories']); | |
| 12 | - add_action('elementor_pro/init', [$this, 'addAcyFormAction']); | |
| 13 | - } | |
| 14 | - | |
| 15 | - public function addAcyScriptElementor() | |
| 16 | - { | |
| 17 | - wp_enqueue_script('select2lib', ACYM_JS.'libraries/select2-full.min.js?v='.filemtime(ACYM_MEDIA.'js'.DS.'libraries'.DS.'select2-full.min.js'), ['jquery']); | |
| 18 | - wp_enqueue_script('acym_script_widget_article_elementor', ACYM_JS.'widget.min.js?v='.time(), ['jquery', 'select2lib'], false, true); | |
| 19 | - wp_enqueue_script('acymailing-compatibility-elementor', ACYM_JS.'libraries/elementor.min.js', [], false, true); | |
| 20 | - wp_enqueue_style('acym_style_widget_article_elementor', ACYM_CSS.'libraries/elementor.min.css?v='.time()); | |
| 21 | - } | |
| 22 | - | |
| 23 | - public function registerWidgets() | |
| 24 | - { | |
| 25 | - include_once ACYM_WIDGETS.'subscriptionform'.DS.'elementor.php'; | |
| 26 | - \Elementor\Plugin::instance()->widgets_manager->register(new \acySubscriptionFormWidget()); | |
| 27 | - } | |
| 28 | - | |
| 29 | - public function addWidgetCategories($elements_manager) | |
| 30 | - { | |
| 31 | - $elements_manager->add_category('acymailing', [ | |
| 32 | - 'title' => 'AcyMailing', | |
| 33 | - ]); | |
| 34 | - } | |
| 35 | - | |
| 36 | - public function addAcyFormAction() | |
| 37 | - { | |
| 38 | - $acymailing = new ElementorForm(); | |
| 39 | - \ElementorPro\Plugin::instance()->modules_manager->get_modules('forms')->add_form_action($acymailing->get_name(), $acymailing); | |
| 40 | - } | |
| 41 | -} | |