Custom_JS.php
5 years ago
Post_Duplicator.php
4 years ago
Promotion.php
4 years ago
Reading_Progress.php
5 years ago
Scroll_to_Top.php
4 years ago
Table_of_Content.php
4 years ago
Promotion.php
135 lines
| 1 | <?php |
| 2 | namespace Essential_Addons_Elementor\Extensions; |
| 3 | |
| 4 | if (!defined('ABSPATH')) { |
| 5 | exit; |
| 6 | } |
| 7 | |
| 8 | use Elementor\Controls_Manager; |
| 9 | |
| 10 | class Promotion |
| 11 | { |
| 12 | public function __construct() |
| 13 | { |
| 14 | if (!apply_filters('eael/pro_enabled', false)) { |
| 15 | add_action('elementor/element/section/section_layout/after_section_end', [$this, 'section_parallax'], 10); |
| 16 | add_action('elementor/element/section/section_layout/after_section_end', [$this, 'section_particles'], 10); |
| 17 | add_action('elementor/element/common/_section_style/after_section_end', [$this, 'content_protection'], 10); |
| 18 | add_action('elementor/element/common/_section_style/after_section_end', [$this, 'section_tooltip'], 10); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | public function teaser_template($texts) |
| 23 | { |
| 24 | $html = '<div class="ea-nerd-box"> |
| 25 | <div class="ea-nerd-box-icon"> |
| 26 | <img src="' . EAEL_PLUGIN_URL . 'assets/admin/images/icon-ea-logo.svg' . '"> |
| 27 | </div> |
| 28 | <div class="ea-nerd-box-title">' . $texts['title'] . '</div> |
| 29 | <div class="ea-nerd-box-message">' . $texts['messages'] . '</div> |
| 30 | <a class="ea-nerd-box-link elementor-button elementor-button-default" href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank"> |
| 31 | ' . __('Upgrade Essential Addons', 'essential-addons-for-elementor-lite') . ' |
| 32 | </a> |
| 33 | </div>'; |
| 34 | |
| 35 | return $html; |
| 36 | } |
| 37 | |
| 38 | public function section_parallax($element) |
| 39 | { |
| 40 | $element->start_controls_section( |
| 41 | 'eael_ext_section_parallax_section', |
| 42 | [ |
| 43 | 'label' => __('<i class="eaicon-logo"></i> Parallax', 'essential-addons-elementor'), |
| 44 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 45 | ] |
| 46 | ); |
| 47 | |
| 48 | $element->add_control( |
| 49 | 'eael_ext_section_parallax_pro_required', |
| 50 | [ |
| 51 | 'type' => Controls_Manager::RAW_HTML, |
| 52 | 'raw' => $this->teaser_template([ |
| 53 | 'title' => __('Meet EA Parallax', 'essential-addons-for-elementor-lite'), |
| 54 | 'messages' => __('Create stunning Parallax effects on your site and blow everyone away.', 'essential-addons-for-elementor-lite'), |
| 55 | ]), |
| 56 | ] |
| 57 | ); |
| 58 | |
| 59 | $element->end_controls_section(); |
| 60 | } |
| 61 | |
| 62 | public function section_particles($element) |
| 63 | { |
| 64 | $element->start_controls_section( |
| 65 | 'eael_ext_section_particles_section', |
| 66 | [ |
| 67 | 'label' => __('<i class="eaicon-logo"></i> Particles', 'essential-addons-elementor'), |
| 68 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 69 | ] |
| 70 | ); |
| 71 | |
| 72 | $element->add_control( |
| 73 | 'eael_ext_section_particles_pro_required', |
| 74 | [ |
| 75 | 'type' => Controls_Manager::RAW_HTML, |
| 76 | 'raw' => $this->teaser_template([ |
| 77 | 'title' => __('Meet EA Particles', 'essential-addons-for-elementor-lite'), |
| 78 | 'messages' => __('Create stunning Particles effects on your site and blow everyone away.', 'essential-addons-for-elementor-lite'), |
| 79 | ]), |
| 80 | ] |
| 81 | ); |
| 82 | |
| 83 | $element->end_controls_section(); |
| 84 | } |
| 85 | |
| 86 | public function content_protection($element) |
| 87 | { |
| 88 | $element->start_controls_section( |
| 89 | 'eael_ext_content_protection_section', |
| 90 | [ |
| 91 | 'label' => __('<i class="eaicon-logo"></i> Content Protection', 'essential-addons-elementor'), |
| 92 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 93 | ] |
| 94 | ); |
| 95 | |
| 96 | $element->add_control( |
| 97 | 'eael_ext_content_protection_pro_required', |
| 98 | [ |
| 99 | 'type' => Controls_Manager::RAW_HTML, |
| 100 | 'raw' => $this->teaser_template([ |
| 101 | 'title' => __('Meet EA Content Protection', 'essential-addons-for-elementor-lite'), |
| 102 | 'messages' => __('Put a restriction on any of your content and protect your privacy.', 'essential-addons-for-elementor-lite'), |
| 103 | ]), |
| 104 | ] |
| 105 | ); |
| 106 | |
| 107 | $element->end_controls_section(); |
| 108 | } |
| 109 | |
| 110 | public function section_tooltip($element) |
| 111 | { |
| 112 | $element->start_controls_section( |
| 113 | 'eael_ext_section_tooltip_section', |
| 114 | [ |
| 115 | 'label' => __('<i class="eaicon-logo"></i> Advanced Tooltip', 'essential-addons-elementor'), |
| 116 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 117 | ] |
| 118 | ); |
| 119 | |
| 120 | $element->add_control( |
| 121 | 'eael_ext_section_tooltip_pro_required', |
| 122 | [ |
| 123 | 'type' => Controls_Manager::RAW_HTML, |
| 124 | 'raw' => $this->teaser_template([ |
| 125 | 'title' => __('Meet EA Advanced Tooltip', 'essential-addons-for-elementor-lite'), |
| 126 | 'messages' => __('Highlight any Elementor widgets with a key message when they are hovered.', 'essential-addons-for-elementor-lite'), |
| 127 | ]), |
| 128 | ] |
| 129 | ); |
| 130 | |
| 131 | $element->end_controls_section(); |
| 132 | } |
| 133 | |
| 134 | } |
| 135 |