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