PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 2.5.6
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v2.5.6
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-banner.php
premium-addons-for-elementor / widgets Last commit date
premium-banner.php 7 years ago premium-blog.php 7 years ago premium-button.php 7 years ago premium-carousel.php 7 years ago premium-contactform.php 7 years ago premium-countdown.php 7 years ago premium-counter.php 7 years ago premium-dual-header.php 7 years ago premium-fancytext.php 7 years ago premium-grid.php 7 years ago premium-image-button.php 7 years ago premium-imageseparator.php 7 years ago premium-maps.php 7 years ago premium-modalbox.php 7 years ago premium-person.php 7 years ago premium-pricing-table.php 7 years ago premium-progressbar.php 7 years ago premium-testimonials.php 7 years ago premium-title.php 7 years ago premium-videobox.php 7 years ago
premium-banner.php
812 lines
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
5
6 class Premium_Banner_Widget extends Widget_Base {
7
8 protected $templateInstance;
9
10 public function getTemplateInstance() {
11 return $this->templateInstance = premium_Template_Tags::getInstance();
12 }
13
14 public function get_name() {
15 return 'premium-addon-banner';
16 }
17
18 public function get_title() {
19 return \PremiumAddons\Helper_Functions::get_prefix() . ' Banner';
20 }
21
22 public function get_icon() {
23 return 'pa-banner';
24 }
25
26 public function get_categories() {
27 return [ 'premium-elements' ];
28 }
29
30 public function get_script_depends()
31 {
32 return ['premium-addons-js'];
33 }
34
35 // Adding the controls fields for the premium banner
36 // This will controls the animation, colors and background, dimensions etc
37 protected function _register_controls() {
38
39 $this->start_controls_section(
40 'premium_banner_global_settings',
41 [
42 'label' => esc_html__( 'Image', 'premium-addons-for-elementor' )
43 ]
44 );
45
46 $this->add_control(
47 'premium_banner_image',
48 [
49 'label' => esc_html__( 'Upload Image', 'premium-addons-for-elementor' ),
50 'description' => esc_html__( 'Select an image for the Banner', 'premium-addons-for-elementor' ),
51 'type' => Controls_Manager::MEDIA,
52 'default' => [
53 'url' => Utils::get_placeholder_image_src()
54 ],
55 'show_external' => true
56 ]
57 );
58
59 $this->add_control('premium_banner_link_url_switch',
60 [
61 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
62 'type' => Controls_Manager::SWITCHER,
63 ]
64 );
65
66 $this->add_control(
67 'premium_banner_image_link_switcher',
68 [
69 'label' => esc_html__( 'Custom Link', 'premium-addons-for-elementor' ),
70 'type' => Controls_Manager::SWITCHER,
71 'default' => '',
72 'description' => esc_html__( 'Add a custom link to the banner', 'premium-addons-for-elementor' ),
73 'condition' => [
74 'premium_banner_link_url_switch' => 'yes',
75 ],
76 ]
77 );
78
79 $this->add_control(
80 'premium_banner_image_custom_link',
81 [
82 'label' => esc_html__( 'Set custom Link', 'premium-addons-for-elementor' ),
83 'type' => Controls_Manager::URL,
84 'description' => esc_html__( 'What custom link you want to set to banner?', 'premium-addons-for-elementor' ),
85 'condition' => [
86 'premium_banner_image_link_switcher' => 'yes',
87 'premium_banner_link_url_switch' => 'yes',
88 ],
89 'show_external' => false,
90 ]
91 );
92
93 $this->add_control(
94 'premium_banner_image_existing_page_link',
95 [
96 'label' => esc_html__( 'Existing Page', 'premium-addons-for-elementor' ),
97 'type' => Controls_Manager::SELECT2,
98 'description' => esc_html__( 'Link the banner with an existing page', 'premium-addons-for-elementor' ),
99 'condition' => [
100 'premium_banner_image_link_switcher!' => 'yes',
101 'premium_banner_link_url_switch' => 'yes',
102 ],
103 'multiple' => false,
104 'options' => $this->getTemplateInstance()->get_all_post()
105 ]
106 );
107
108 $this->add_control(
109 'premium_banner_image_link_open_new_tab',
110 [
111 'label' => esc_html__( 'New Tab', 'premium-addons-for-elementor' ),
112 'type' => Controls_Manager::SWITCHER,
113 'default' => '',
114 'description' => esc_html__( 'Choose if you want the link be opened in a new tab or not', 'premium-addons-for-elementor' ),
115 'condition' => [
116 'premium_banner_link_url_switch' => 'yes',
117 ],
118 ]
119 );
120
121 $this->add_control(
122 'premium_banner_image_link_add_nofollow',
123 [
124 'label' => esc_html__( 'Nofollow Option', 'premium-addons-for-elementor' ),
125 'type' => Controls_Manager::SWITCHER,
126 'default' => '',
127 'description' => esc_html__('if you choose yes, the link will not be counted in search engines', 'premium-addons-for-elementor' ),
128 'condition' => [
129 'premium_banner_link_url_switch' => 'yes',
130 ],
131 ]
132 );
133
134 $this->add_control(
135 'premium_banner_image_animation',
136 [
137 'label' => esc_html__( 'Effect', 'premium-addons-for-elementor' ),
138 'type' => Controls_Manager::SELECT,
139 'default' => 'premium_banner_animation1',
140 'description' => esc_html__( 'Choose a hover effect for the banner', 'premium-addons-for-elementor' ),
141 'options' => [
142 'premium_banner_animation1' => 'Effect 1',
143 'premium_banner_animation5' => 'Effect 2',
144 'premium_banner_animation13' => 'Effect 3',
145 'premium_banner_animation2' => 'Effect 4',
146 'premium_banner_animation4' => 'Effect 5',
147 'premium_banner_animation6' => 'Effect 6'
148 ]
149 ]
150 );
151
152 $this->add_control(
153 'premium_banner_active',
154 [
155 'label' => esc_html__( 'Always Hovered', 'premium-addons-for-elementor' ),
156 'type' => Controls_Manager::SWITCHER,
157 'description' => esc_html__( 'Choose if you want the effect to be always triggered', 'premium-addons-for-elementor' ),
158
159 ]
160 );
161
162 $this->add_control(
163 'premium_banner_hover_effect',
164 [
165 'label' => esc_html__('Hover Effect', 'premium-addons-for-elementor'),
166 'type' => Controls_Manager::SELECT,
167 'options' => [
168 'none' => esc_html__('None', 'premium-addons-for-elementor'),
169 'zoomin' => esc_html__('Zoom In', 'premium-addons-for-elementor'),
170 'zoomout' => esc_html__('Zoom Out', 'premium-addons-for-elementor'),
171 'scale' => esc_html__('Scale', 'premium-addons-for-elementor'),
172 'grayscale' => esc_html__('Grayscale', 'premium-addons-for-elementor'),
173 'blur' => esc_html__('Blur', 'premium-addons-for-elementor'),
174 'bright' => esc_html__('Bright', 'premium-addons-for-elementor'),
175 'sepia' => esc_html__('Sepia', 'premium-addons-for-elementor'),
176 ],
177 'default' => 'none',
178 ]
179 );
180
181 $this->add_control(
182 'premium_banner_height',
183 [
184 'label' => esc_html__( 'Height', 'premium-addons-for-elementor' ),
185 'type' => Controls_Manager::SELECT,
186 'options' => [
187 'default' => 'Default',
188 'custom' => 'Custom',
189 ],
190 'default' => 'default',
191 'description' => esc_html__( 'Choose if you want to set a custom height for the banner or keep it as it is', 'premium-addons-for-elementor' ),
192
193 ]
194 );
195
196 $this->add_responsive_control(
197 'premium_banner_custom_height',
198 [
199 'label' => esc_html__( 'Min Height', 'premium-addons-for-elementor' ),
200 'type' => Controls_Manager::NUMBER,
201 'description' => esc_html__( 'Set a minimum height value in pixels', 'premium-addons-for-elementor' ),
202 'condition' => [
203 'premium_banner_height' => 'custom'
204 ],
205 'selectors' => [
206 '{{WRAPPER}} .premium_addons-banner-ib' => 'height: {{VALUE}}px;'
207 ]
208 ]
209 );
210
211 $this->add_responsive_control(
212 'premium_banner_img_vertical_align',
213 [
214 'label' => esc_html__( 'Vertical Align', 'premium-addons-for-elementor' ),
215 'type' => Controls_Manager::SELECT,
216 'condition' => [
217 'premium_banner_height' => 'custom'
218 ],
219 'options' => [
220 'flex-start' => esc_html__('Top', 'premium-addons-for-elementor'),
221 'center' => esc_html__('Middle', 'premium-addons-for-elementor'),
222 'flex-end' => esc_html__('Bottom', 'premium-addons-for-elementor'),
223 'inherit' => esc_html__('Full', 'premium-addons-for-elementor'),
224 ],
225 'default' => 'flex-start',
226 'selectors' => [
227 '{{WRAPPER}} .premium_addons-banner-img-wrap' => 'align-items: {{VALUE}}; -webkit-align-items: {{VALUE}};'
228 ]
229 ]
230 );
231
232 $this->add_control(
233 'premium_banner_extra_class',
234 [
235 'label' => esc_html__( 'Extra Class', 'premium-addons-for-elementor' ),
236 'type' => Controls_Manager::TEXT,
237 'description' => esc_html__( 'Add extra class name that will be applied to the banner, and you can use this class for your customizations.', 'premium-addons-for-elementor' ),
238 ]
239 );
240
241
242 $this->end_controls_section();
243
244 $this->start_controls_section(
245 'premium_banner_image_section',
246 [
247 'label' => esc_html__( 'Content', 'premium-addons-for-elementor' )
248 ]
249 );
250
251 $this->add_control(
252 'premium_banner_title',
253 [
254 'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
255 'placeholder' => esc_html__( 'Give a title to this banner', 'premium-addons-for-elementor' ),
256 'description' => esc_html__( 'Give a title to this banner', 'premium-addons-for-elementor' ),
257 'type' => Controls_Manager::TEXT,
258 'dynamic' => [ 'active' => true ],
259 'default' => esc_html__( 'Premium Banner', 'premium-addons-for-elementor' ),
260 'label_block' => false
261 ]
262 );
263
264 $this->add_control(
265 'premium_banner_title_tag',
266 [
267 'label' => esc_html__( 'HTML Tag', 'premium-addons-for-elementor' ),
268 'description' => esc_html__( 'Select a heading tag for the title. Headings are defined with H1 to H6 tags', 'premium-addons-for-elementor' ),
269 'type' => Controls_Manager::SELECT,
270 'default' => 'h3',
271 'options' => [
272 'h1' => 'H1',
273 'h2' => 'H2',
274 'h3' => 'H3',
275 'h4' => 'H4',
276 'h5' => 'H5',
277 'h6' => 'H6',
278 ],
279 'label_block' => true,
280 ]
281 );
282
283
284 $this->add_control(
285 'premium_banner_description_hint',
286 [
287 'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
288 'type' => Controls_Manager::HEADING,
289 ]
290 );
291
292 $this->add_control(
293 'premium_banner_description',
294 [
295 'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
296 'description' => esc_html__( 'Give the description to this banner', 'premium-addons-for-elementor' ),
297 'type' => Controls_Manager::WYSIWYG,
298 'dynamic' => [ 'active' => true ],
299 'default' => esc_html__( 'Premium Banner gives you a wide range of styles and options that you will definitely fall in love with', 'premium-addons-for-elementor' ),
300 'label_block' => true
301 ]
302 );
303
304 $this->add_control(
305 'premium_banner_link_switcher',
306 [
307 'label' => esc_html__('Button', 'premium-addons-for-elementor'),
308 'type' => Controls_Manager::SWITCHER,
309 'condition' => [
310 'premium_banner_link_url_switch!' => 'yes'
311 ]
312 ]
313 );
314
315
316 $this->add_control(
317 'premium_banner_more_text',
318 [
319 'label' => esc_html__('Text','premium-addons-for-elementor'),
320 'type' => Controls_Manager::TEXT,
321 'dynamic' => [ 'active' => true ],
322 'default' => 'Click Here',
323 'condition' => [
324 'premium_banner_link_switcher' => 'yes',
325 'premium_banner_link_url_switch!' => 'yes'
326 ]
327 ]
328 );
329
330 $this->add_control(
331 'premium_banner_link_selection',
332 [
333 'label' => esc_html__('Link Type', 'premium-addons-for-elementor'),
334 'type' => Controls_Manager::SELECT,
335 'options' => [
336 'url' => esc_html__('URL', 'premium-addons-for-elementor'),
337 'link' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
338 ],
339 'default' => 'url',
340 'label_block' => true,
341 'condition' => [
342 'premium_banner_link_switcher' => 'yes',
343 'premium_banner_link_url_switch!' => 'yes'
344 ]
345 ]
346 );
347
348 $this->add_control(
349 'premium_banner_link',
350 [
351 'label' => esc_html__('Link', 'premium-addons-for-elementor'),
352 'type' => Controls_Manager::URL,
353 'default' => [
354 'url' => '#',
355 ],
356 'placeholder' => 'https://premiumaddons.com/',
357 'label_block' => true,
358 'condition' => [
359 'premium_banner_link_selection' => 'url',
360 'premium_banner_link_switcher' => 'yes',
361 'premium_banner_link_url_switch!' => 'yes'
362 ]
363 ]
364 );
365
366 $this->add_control(
367 'premium_banner_existing_link',
368 [
369 'label' => esc_html__('Existing Page', 'premium-addons-for-elementor'),
370 'type' => Controls_Manager::SELECT2,
371 'options' => $this->getTemplateInstance()->get_all_post(),
372 'multiple' => false,
373 'condition' => [
374 'premium_banner_link_selection' => 'link',
375 'premium_banner_link_switcher' => 'yes',
376 'premium_banner_link_url_switch!' => 'yes'
377 ],
378 'label_block' => true,
379 ]
380 );
381
382
383 $this->add_control('premium_banner_title_text_align',
384 [
385 'label' => esc_html__('Alignment', 'premium-addons-for-elementor'),
386 'type' => Controls_Manager::CHOOSE,
387 'options' => [
388 'left' => [
389 'title' => esc_html__('Left', 'premium-addons-for-elementor'),
390 'icon' => 'fa fa-align-left'
391 ],
392 'center' => [
393 'title' => esc_html__('Center', 'premium-addons-for-elementor'),
394 'icon' => 'fa fa-align-center'
395 ],
396 'right' => [
397 'title' => esc_html__('Right', 'premium-addons-for-elementor'),
398 'icon' => 'fa fa-align-right'
399 ],
400 ],
401 'default' => 'left',
402 'toggle' => false,
403 'selectors' => [
404 '{{WRAPPER}} .premium_addons-banner-ib-title, {{WRAPPER}} .premium_addons-banner-ib-content, {{WRAPPER}} .premium-banner-read-more' => 'text-align: {{VALUE}};',
405 ]
406 ]
407 );
408
409 $this->end_controls_section();
410
411 $this->start_controls_section('premium_banner_responsive_section',
412 [
413 'label' => esc_html__('Responsive', 'premium-addons-for-elementor'),
414 ]);
415
416 $this->add_control('premium_banner_responsive_switcher',
417 [
418 'label' => esc_html__('Responsive Controls', 'premium-addons-for-elementor'),
419 'type' => Controls_Manager::SWITCHER,
420 'description' => esc_html__('If the description text is not suiting well on specific screen sizes, you may enable this option which will hide the description text.', 'premium-addons-for-elementor')
421 ]);
422
423 $this->add_control('premium_banner_min_range',
424 [
425 'label' => esc_html__('Minimum Size', 'premium-addons-for-elementor'),
426 'type' => Controls_Manager::NUMBER,
427 'description'=> esc_html__('Note: minimum size for extra small screens is 1px.','premium-addons-for-elementor'),
428 'default' => 1,
429 'condition' => [
430 'premium_banner_responsive_switcher' => 'yes'
431 ],
432 ]);
433
434 $this->add_control('premium_banner_max_range',
435 [
436 'label' => esc_html__('Maximum Size', 'premium-addons-for-elementor'),
437 'type' => Controls_Manager::NUMBER,
438 'description'=> esc_html__('Note: maximum size for extra small screens is 767px.','premium-addons-for-elementor'),
439 'default' => 767,
440 'condition' => [
441 'premium_banner_responsive_switcher' => 'yes'
442 ],
443 ]);
444
445 $this->end_controls_section();
446
447 $this->start_controls_section(
448 'premium_banner_opacity_style',
449 [
450 'label' => esc_html__( 'Image', 'premium-addons-for-elementor' ),
451 'tab' => Controls_Manager::TAB_STYLE
452 ]
453 );
454
455 $this->add_control(
456 'premium_banner_image_bg_color',
457 [
458 'label' => esc_html__( 'Background Color', 'premium-addons-for-elementor' ),
459 'type' => Controls_Manager::COLOR,
460 'selectors' => [
461 '{{WRAPPER}} .premium_addons-banner-ib' => 'background: {{VALUE}};',
462 ]
463 ]
464 );
465
466 $this->add_control(
467 'premium_banner_image_opacity',
468 [
469 'label' => esc_html__( 'Image Opacity', 'premium-addons-for-elementor' ),
470 'type' => Controls_Manager::SLIDER,
471 'default' => [
472 'size' => 1,
473 ],
474 'range' => [
475 'px' => [
476 'min' => 0,
477 'max' => 1,
478 'step' => .1,
479 ]
480 ],
481 'selectors' => [
482 '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img' => 'opacity: {{SIZE}};',
483 ],
484 ]
485 );
486
487
488 $this->add_control(
489 'premium_banner_image_hover_opacity',
490 [
491 'label' => esc_html__( 'Hover Opacity', 'premium-addons-for-elementor' ),
492 'type' => Controls_Manager::SLIDER,
493 'default' => [
494 'size' => 1,
495 ],
496 'range' => [
497 'px' => [
498 'min' => 0,
499 'max' => 1,
500 'step' => .1,
501 ]
502 ],
503 'selectors' => [
504 '{{WRAPPER}} .premium_addons-banner-ib .premium_addons-banner-ib-img.active' => 'opacity: {{SIZE}};',
505 ],
506 ]
507 );
508
509 $this->end_controls_section();
510
511 $this->start_controls_section(
512 'premium_banner_title_style',
513 [
514 'label' => esc_html__( 'Title', 'premium-addons-for-elementor' ),
515 'tab' => Controls_Manager::TAB_STYLE
516 ]
517 );
518
519 $this->add_control(
520 'premium_banner_color_of_title',
521 [
522 'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
523 'type' => Controls_Manager::COLOR,
524 'scheme' => [
525 'type' => Scheme_Color::get_type(),
526 'value' => Scheme_Color::COLOR_1,
527 ],
528 'selectors' => [
529 '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title' => 'color: {{VALUE}};'
530 ],
531 ]
532 );
533
534 $this->add_control(
535 'premium_banner_style2_title_bg',
536 [
537 'label' => esc_html__( 'Title Background', 'premium-addons-for-elementor' ),
538 'type' => Controls_Manager::COLOR,
539 'default' => '#f2f2f2',
540 'description' => esc_html__( 'Choose a background color for the title', 'premium-addons-for-elementor' ),
541 'condition' => [
542 'premium_banner_image_animation' => 'premium_banner_animation5'
543 ],
544 'selectors' => [
545 '{{WRAPPER}} .premium_banner_animation5 .premium_addons-banner-ib-desc' => 'background: {{VALUE}};',
546 ],
547 ]
548 );
549
550 $this->add_group_control(
551 Group_Control_Typography::get_type(),
552 [
553 'name' => 'premium_banner_title_typography',
554 'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title',
555 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
556 ]
557 );
558
559 $this->add_group_control(
560 Group_Control_Text_Shadow::get_type(),
561 [
562 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
563 'name' => 'premium_banner_title_shadow',
564 'selector' => '{{WRAPPER}} .premium_addons-banner-ib-desc .premium_banner_title',
565 ]
566 );
567
568 $this->end_controls_section();
569
570 $this->start_controls_section(
571 'premium_banner_styles_of_content',
572 [
573 'label' => esc_html__( 'Description', 'premium-addons-for-elementor' ),
574 'tab' => Controls_Manager::TAB_STYLE
575 ]
576 );
577
578 $this->add_control(
579 'premium_banner_color_of_content',
580 [
581 'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
582 'type' => Controls_Manager::COLOR,
583 'scheme' => [
584 'type' => Scheme_Color::get_type(),
585 'value' => Scheme_Color::COLOR_3,
586 ],
587 'selectors' => [
588 '{{WRAPPER}} .premium_banner .premium_banner_content' => 'color: {{VALUE}};'
589 ],
590 ]
591 );
592
593 $this->add_group_control(
594 Group_Control_Typography::get_type(),
595 [
596 'name' => 'premium_banner_content_typhography',
597 'selector' => '{{WRAPPER}} .premium_banner .premium_banner_content',
598 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
599 ]
600 );
601
602 $this->add_group_control(
603 Group_Control_Text_Shadow::get_type(),
604 [
605 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
606 'name' => 'premium_banner_description_shadow',
607 'selector' => '{{WRAPPER}} .premium_banner .premium_banner_content',
608 ]
609 );
610
611 $this->end_controls_section();
612
613 $this->start_controls_section(
614 'premium_banner_styles_of_button',
615 [
616 'label' => esc_html__( 'Button', 'premium-addons-for-elementor' ),
617 'tab' => Controls_Manager::TAB_STYLE,
618 'condition' => [
619 'premium_banner_link_switcher' => 'yes',
620 'premium_banner_link_url_switch!' => 'yes'
621 ]
622 ]
623 );
624
625 $this->add_control(
626 'premium_banner_color_of_button',
627 [
628 'label' => esc_html__( 'Color', 'premium-addons-for-elementor' ),
629 'type' => Controls_Manager::COLOR,
630 'scheme' => [
631 'type' => Scheme_Color::get_type(),
632 'value' => Scheme_Color::COLOR_3,
633 ],
634 'selectors' => [
635 '{{WRAPPER}} .premium_banner .premium-banner-link' => 'color: {{VALUE}};'
636 ],
637 ]
638 );
639
640 $this->add_control(
641 'premium_banner_hover_color_of_button',
642 [
643 'label' => esc_html__( 'Hover Color', 'premium-addons-for-elementor' ),
644 'type' => Controls_Manager::COLOR,
645 'scheme' => [
646 'type' => Scheme_Color::get_type(),
647 'value' => Scheme_Color::COLOR_3,
648 ],
649 'selectors' => [
650 '{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'color: {{VALUE}};'
651 ],
652 ]
653 );
654
655 $this->add_group_control(
656 Group_Control_Typography::get_type(),
657 [
658 'name' => 'premium_banner_button_typhography',
659 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
660 'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
661 ]
662 );
663
664 $this->add_control(
665 'premium_banner_backcolor_of_button',
666 [
667 'label' => esc_html__( 'Background Color', 'premium-addons-for-elementor' ),
668 'type' => Controls_Manager::COLOR,
669 'selectors' => [
670 '{{WRAPPER}} .premium_banner .premium-banner-link' => 'background-color: {{VALUE}};'
671 ],
672 ]
673 );
674
675 $this->add_control(
676 'premium_banner_hover_backcolor_of_buttin',
677 [
678 'label' => esc_html__( 'Hover Background Color', 'premium-addons-for-elementor' ),
679 'type' => Controls_Manager::COLOR,
680 'selectors' => [
681 '{{WRAPPER}} .premium_banner .premium-banner-link:hover' => 'background-color: {{VALUE}};'
682 ],
683 ]
684 );
685
686 $this->add_group_control(
687 Group_Control_Border::get_type(),
688 [
689 'name' => 'premium_banner_button_border',
690 'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
691 ]
692 );
693
694 $this->add_control('premium_banner_button_border_radius',
695 [
696 'label' => esc_html__('Border Radius', 'premium-addons-for-elementor'),
697 'type' => Controls_Manager::SLIDER,
698 'size_units' => ['px', '%' ,'em'],
699 'selectors' => [
700 '{{WRAPPER}} .premium_banner .premium-banner-link' => 'border-radius: {{SIZE}}{{UNIT}};'
701 ]
702 ]
703 );
704
705 $this->add_group_control(
706 Group_Control_Text_Shadow::get_type(),
707 [
708 'label' => esc_html__('Shadow','premium-addons-for-elementor'),
709 'name' => 'premium_banner_button_shadow',
710 'selector' => '{{WRAPPER}} .premium_banner .premium-banner-link',
711 ]
712 );
713
714 $this->add_responsive_control('premium_banner_button_padding',
715 [
716 'label' => esc_html__('Padding', 'premium-addons-for-elementor'),
717 'type' => Controls_Manager::DIMENSIONS,
718 'size_units' => ['px', 'em', '%'],
719 'selectors' => [
720 '{{WRAPPER}} .premium_banner .premium-banner-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
721 ]
722 ]);
723
724 $this->end_controls_section();
725
726 }
727
728
729 protected function render() {
730 $settings = $this->get_settings_for_display(); // All the settings values stored in $settings varaiable
731 $this->add_inline_editing_attributes('premium_banner_title');
732 $this->add_inline_editing_attributes('premium_banner_description', 'advanced');
733
734 $title_tag = $settings[ 'premium_banner_title_tag' ];
735 $title = $settings[ 'premium_banner_title' ];
736 $full_title = '<'. $title_tag . ' class="premium_addons-banner-ib-title ult-responsive premium_banner_title"><div '. $this->get_render_attribute_string('premium_banner_title') .'>' .$title. '</div></'.$title_tag.'>';
737
738 $link = isset( $settings['premium_banner_image_link_switcher'] ) && $settings['premium_banner_image_link_switcher'] != '' ? $settings['premium_banner_image_custom_link']['url'] : get_permalink( $settings['premium_banner_image_existing_page_link'] );
739
740 $link_title = $settings['premium_banner_image_link_switcher'] != 'yes' ? get_the_title( $settings['premium_banner_image_existing_page_link'] ) : '';
741
742 $open_new_tab = $settings['premium_banner_image_link_open_new_tab'] == 'yes' ? ' target="_blank"' : '';
743 $nofollow_link = $settings['premium_banner_image_link_add_nofollow'] == 'yes' ? ' rel="nofollow"' : '';
744 $full_link = '<a class="premium_addons-banner-ib-link" href="'. $link .'" title="'. $link_title .'"'. $open_new_tab . $nofollow_link . '></a>';
745 $animation_class = $settings['premium_banner_image_animation'];
746 $hover_class = ' ' . $settings['premium_banner_hover_effect'];
747 $extra_class = isset( $settings['premium_banner_extra_class'] ) && $settings['premium_banner_extra_class'] != '' ? ' '. $settings['premium_banner_extra_class'] : '';
748 $active = $settings['premium_banner_active'] == 'yes' ? ' active' : '';
749 $full_class = $animation_class.$hover_class.$extra_class.$active;
750 $min_size = $settings['premium_banner_min_range'].'px';
751 $max_size = $settings['premium_banner_max_range'].'px';
752
753
754 $banner_url = 'url' == $settings['premium_banner_link_selection'] ? $settings['premium_banner_link']['url'] : get_permalink($settings['premium_banner_existing_link']);
755
756 ob_start();
757 ?>
758 <div class="premium_banner" id="premium-banner-<?php echo esc_attr($this->get_id()); ?>">
759 <div class="premium_addons-banner-ib <?php echo $full_class; ?> premium-banner-min-height">
760 <?php if( isset( $settings['premium_banner_image']['url'] ) && $settings['premium_banner_image']['url'] != '' ): ?>
761 <?php if($settings['premium_banner_height'] == 'custom' ): ?>
762 <div class="premium_addons-banner-img-wrap">
763 <?php endif; ?>
764 <img class="premium_addons-banner-ib-img" alt="null" src="<?php echo $settings['premium_banner_image']['url']; ?>">
765 <?php if($settings['premium_banner_height'] == 'custom' ): ?>
766 </div>
767 <?php endif; ?>
768 <?php endif; ?>
769 <div class="premium_addons-banner-ib-desc">
770 <?php echo $full_title; ?>
771 <div class="premium_addons-banner-ib-content premium_banner_content">
772 <div <?php echo $this->get_render_attribute_string('premium_banner_description'); ?>><?php echo $settings[ 'premium_banner_description' ]; ?></div>
773 </div>
774 <?php if( 'yes' == $settings['premium_banner_link_switcher'] && !empty( $settings['premium_banner_more_text'] ) ) : ?>
775
776 <div class ="premium-banner-read-more">
777 <a class = "premium-banner-link" <?php if( !empty( $banner_url ) ) : ?> href="<?php echo esc_url( $banner_url ); ?>"<?php endif;?><?php if( !empty( $settings['premium_banner_link']['is_external'] ) ) : ?> target="_blank" <?php endif; ?><?php if( !empty($settings['premium_banner_link']['nofollow'] ) ) : ?> rel="nofollow" <?php endif; ?>><?php echo esc_html( $settings['premium_banner_more_text'] ); ?></a>
778 </div>
779
780 <?php endif; ?>
781 </div>
782 <?php
783 if( $settings['premium_banner_link_url_switch'] == 'yes' && (!empty( $settings['premium_banner_image_custom_link']['url'] ) || !empty($settings['premium_banner_image_existing_page_link'] )) ) {
784 echo $full_link;
785 }
786 ?>
787 </div>
788 <?php if($settings['premium_banner_responsive_switcher'] == 'yes') : ?>
789 <style>
790 @media(min-width: <?php echo $min_size; ?> ) and (max-width:<?php echo $max_size; ?>){
791 #premium-banner-<?php echo esc_attr($this->get_id()); ?> .premium_addons-banner-ib-content {
792 display: none;
793 }
794 }
795 </style>
796 <?php endif; ?>
797
798 </div>
799 <?php $output = ob_get_clean();
800 echo $output;
801 }
802
803 protected function content_template() {
804
805 ?>
806
807
808 <?php
809 }
810 }
811
812 Plugin::instance()->widgets_manager->register_widget_type( new Premium_Banner_Widget() );