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