Custom_JS.php
1 year ago
Hover_Effect.php
1 year ago
Post_Duplicator.php
1 year ago
Promotion.php
1 year ago
Reading_Progress.php
3 years ago
Scroll_to_Top.php
1 year ago
Table_of_Content.php
1 year ago
Wrapper_Link.php
1 year ago
index.php
3 years ago
Promotion.php
185 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 | if ( ! apply_filters( 'eael/pro_enabled', false ) ) { |
| 14 | add_action( 'elementor/element/section/section_layout/after_section_end', [ $this, 'section_parallax' ], 10 ); |
| 15 | add_action( 'elementor/element/section/section_layout/after_section_end', [ $this, 'section_particles' ], 10 ); |
| 16 | add_action( 'elementor/element/common/_section_style/after_section_end', [ $this, 'content_protection' ], 10 ); |
| 17 | add_action( 'elementor/element/common/_section_style/after_section_end', [ $this, 'section_tooltip' ], 10 ); |
| 18 | add_action( 'elementor/element/common/_section_style/after_section_end', [ $this, 'conditional_display' ] ); |
| 19 | add_action( 'elementor/element/column/section_advanced/after_section_end', [ $this, 'conditional_display' ] ); |
| 20 | add_action( 'elementor/element/section/section_advanced/after_section_end', [ $this, 'conditional_display' ] ); |
| 21 | add_action( 'elementor/element/common/_section_style/after_section_end', [ $this, 'smooth_animation' ] ); |
| 22 | add_action( 'elementor/element/column/section_advanced/after_section_end', [ $this, 'smooth_animation' ] ); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | public function teaser_template($texts) |
| 27 | { |
| 28 | $html = '<div class="ea-nerd-box"> |
| 29 | <div class="ea-nerd-box-icon"> |
| 30 | <img src="' . EAEL_PLUGIN_URL . 'assets/admin/images/icon-ea-new-logo.svg' . '"> |
| 31 | </div> |
| 32 | <div class="ea-nerd-box-title">' . $texts['title'] . '</div> |
| 33 | <div class="ea-nerd-box-message">' . $texts['messages'] . '</div> |
| 34 | <a class="ea-nerd-box-link elementor-button elementor-button-default" href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank"> |
| 35 | ' . __('Upgrade Essential Addons', 'essential-addons-for-elementor-lite') . ' |
| 36 | </a> |
| 37 | </div>'; |
| 38 | |
| 39 | return $html; |
| 40 | } |
| 41 | |
| 42 | public function section_parallax($element) |
| 43 | { |
| 44 | $element->start_controls_section( |
| 45 | 'eael_ext_section_parallax_section', |
| 46 | [ |
| 47 | 'label' => __('<i class="eaicon-logo"></i> Parallax', 'essential-addons-for-elementor-lite'), |
| 48 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 49 | ] |
| 50 | ); |
| 51 | |
| 52 | $element->add_control( |
| 53 | 'eael_ext_section_parallax_pro_required', |
| 54 | [ |
| 55 | 'type' => Controls_Manager::RAW_HTML, |
| 56 | 'raw' => $this->teaser_template([ |
| 57 | 'title' => __('Meet EA Parallax', 'essential-addons-for-elementor-lite'), |
| 58 | 'messages' => __('Create stunning Parallax effects on your site and blow everyone away.', 'essential-addons-for-elementor-lite'), |
| 59 | ]), |
| 60 | ] |
| 61 | ); |
| 62 | |
| 63 | $element->end_controls_section(); |
| 64 | } |
| 65 | |
| 66 | public function section_particles($element) |
| 67 | { |
| 68 | $element->start_controls_section( |
| 69 | 'eael_ext_section_particles_section', |
| 70 | [ |
| 71 | 'label' => __('<i class="eaicon-logo"></i> Particles', 'essential-addons-for-elementor-lite'), |
| 72 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 73 | ] |
| 74 | ); |
| 75 | |
| 76 | $element->add_control( |
| 77 | 'eael_ext_section_particles_pro_required', |
| 78 | [ |
| 79 | 'type' => Controls_Manager::RAW_HTML, |
| 80 | 'raw' => $this->teaser_template([ |
| 81 | 'title' => __('Meet EA Particles', 'essential-addons-for-elementor-lite'), |
| 82 | 'messages' => __('Create stunning Particles effects on your site and blow everyone away.', 'essential-addons-for-elementor-lite'), |
| 83 | ]), |
| 84 | ] |
| 85 | ); |
| 86 | |
| 87 | $element->end_controls_section(); |
| 88 | } |
| 89 | |
| 90 | public function content_protection($element) |
| 91 | { |
| 92 | $element->start_controls_section( |
| 93 | 'eael_ext_content_protection_section', |
| 94 | [ |
| 95 | 'label' => __('<i class="eaicon-logo"></i> Content Protection', 'essential-addons-for-elementor-lite'), |
| 96 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $element->add_control( |
| 101 | 'eael_ext_content_protection_pro_required', |
| 102 | [ |
| 103 | 'type' => Controls_Manager::RAW_HTML, |
| 104 | 'raw' => $this->teaser_template([ |
| 105 | 'title' => __('Meet EA Content Protection', 'essential-addons-for-elementor-lite'), |
| 106 | 'messages' => __('Put a restriction on any of your content and protect your privacy.', 'essential-addons-for-elementor-lite'), |
| 107 | ]), |
| 108 | ] |
| 109 | ); |
| 110 | |
| 111 | $element->end_controls_section(); |
| 112 | } |
| 113 | |
| 114 | public function section_tooltip($element) |
| 115 | { |
| 116 | $element->start_controls_section( |
| 117 | 'eael_ext_section_tooltip_section', |
| 118 | [ |
| 119 | 'label' => __('<i class="eaicon-logo"></i> Advanced Tooltip', 'essential-addons-for-elementor-lite'), |
| 120 | 'tab' => Controls_Manager::TAB_ADVANCED, |
| 121 | ] |
| 122 | ); |
| 123 | |
| 124 | $element->add_control( |
| 125 | 'eael_ext_section_tooltip_pro_required', |
| 126 | [ |
| 127 | 'type' => Controls_Manager::RAW_HTML, |
| 128 | 'raw' => $this->teaser_template([ |
| 129 | 'title' => __('Meet EA Advanced Tooltip', 'essential-addons-for-elementor-lite'), |
| 130 | 'messages' => __('Highlight any Elementor widgets with a key message when they are hovered.', 'essential-addons-for-elementor-lite'), |
| 131 | ]), |
| 132 | ] |
| 133 | ); |
| 134 | |
| 135 | $element->end_controls_section(); |
| 136 | } |
| 137 | |
| 138 | public function conditional_display( $element ) { |
| 139 | $element->start_controls_section( |
| 140 | 'eael_conditional_display_section', |
| 141 | [ |
| 142 | 'label' => __( '<i class="eaicon-logo"></i> Conditional Display', 'essential-addons-for-elementor-lite' ), |
| 143 | 'tab' => Controls_Manager::TAB_ADVANCED |
| 144 | ] |
| 145 | ); |
| 146 | |
| 147 | $element->add_control( |
| 148 | 'eael_conditional_display_section_pro_required', |
| 149 | [ |
| 150 | 'type' => Controls_Manager::RAW_HTML, |
| 151 | 'raw' => $this->teaser_template( [ |
| 152 | 'title' => __( 'Meet EA Conditional Display', 'essential-addons-for-elementor-lite' ), |
| 153 | 'messages' => __( "Control any section, column, container or widget’s visibility with your own logic.", 'essential-addons-for-elementor-lite' ), |
| 154 | ] ), |
| 155 | ] |
| 156 | ); |
| 157 | |
| 158 | $element->end_controls_section(); |
| 159 | } |
| 160 | |
| 161 | public function smooth_animation( $element ) { |
| 162 | $element->start_controls_section( |
| 163 | 'eael_smooth_animation_section', |
| 164 | [ |
| 165 | 'label' => __( '<i class="eaicon-logo"></i> Interactive Animations', 'essential-addons-for-elementor-lite' ), |
| 166 | 'tab' => Controls_Manager::TAB_ADVANCED |
| 167 | ] |
| 168 | ); |
| 169 | |
| 170 | $element->add_control( |
| 171 | 'eael_smooth_animation_section_pro_required', |
| 172 | [ |
| 173 | 'type' => Controls_Manager::RAW_HTML, |
| 174 | 'raw' => $this->teaser_template( [ |
| 175 | 'title' => __( 'Meet EA Interactive Animations', 'essential-addons-for-elementor-lite' ), |
| 176 | 'messages' => __( "Witness magic in Elementor - animate any section, column, container, or widget", 'essential-addons-for-elementor-lite' ), |
| 177 | ] ), |
| 178 | ] |
| 179 | ); |
| 180 | |
| 181 | $element->end_controls_section(); |
| 182 | } |
| 183 | |
| 184 | } |
| 185 |