PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.75
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.75
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-progressbar.php
premium-addons-for-elementor / widgets Last commit date
dep 1 month ago premium-banner.php 1 month ago premium-blog.php 1 month ago premium-button.php 1 month ago premium-carousel.php 1 month ago premium-contactform.php 1 month ago premium-countdown.php 1 month ago premium-counter.php 1 month ago premium-dual-header.php 1 month ago premium-fancytext.php 1 month ago premium-grid.php 1 month ago premium-icon-list.php 1 month ago premium-image-button.php 1 month ago premium-image-scroll.php 1 month ago premium-image-separator.php 1 month ago premium-lottie.php 1 month ago premium-maps.php 1 month ago premium-media-wheel.php 1 month ago premium-mobile-menu.php 1 month ago premium-modalbox.php 1 month ago premium-nav-menu.php 1 month ago premium-notifications.php 1 month ago premium-person.php 1 month ago premium-pinterest-feed.php 1 month ago premium-post-ticker.php 1 month ago premium-pricing-table.php 1 month ago premium-progressbar.php 1 month ago premium-search-form.php 1 month ago premium-svg-drawer.php 1 month ago premium-tcloud.php 1 month ago premium-testimonials.php 1 month ago premium-textual-showcase.php 1 month ago premium-tiktok-feed.php 1 month ago premium-title.php 1 month ago premium-videobox.php 1 month ago premium-vscroll.php 2 months ago premium-weather.php 1 month ago premium-world-clock.php 1 month ago
premium-progressbar.php
1997 lines
1 <?php
2 /**
3 * Premium Progress Bar.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Plugin;
10 use Elementor\Widget_Base;
11 use Elementor\Utils;
12 use Elementor\Controls_Manager;
13 use Elementor\Icons_Manager;
14 use Elementor\Repeater;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
16 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
17 use Elementor\Group_Control_Typography;
18 use PremiumAddons\Includes\Controls\Premium_Background;
19 use Elementor\Group_Control_Border;
20
21 // PremiumAddons Classes.
22 use PremiumAddons\Admin\Includes\Admin_Helper;
23 use PremiumAddons\Includes\Helper_Functions;
24
25 if ( ! defined( 'ABSPATH' ) ) {
26 exit; // If this file is called directly, abort.
27 }
28
29 /**
30 * Class Premium_Progressbar
31 */
32 class Premium_Progressbar extends Widget_Base {
33
34 /**
35 * Check if the icon draw is enabled.
36 *
37 * @since 4.9.26
38 * @access private
39 *
40 * @var bool
41 */
42 private $is_draw_enabled = null;
43
44 /**
45 * Check Icon Draw Option.
46 *
47 * @since 4.9.26
48 * @access public
49 */
50 public function check_icon_draw() {
51
52 if ( null === $this->is_draw_enabled ) {
53 $this->is_draw_enabled = Admin_Helper::check_svg_draw( 'premium-progressbar' );
54 }
55
56 return $this->is_draw_enabled;
57 }
58
59 /**
60 * Retrieve Widget Name.
61 *
62 * @since 1.0.0
63 * @access public
64 */
65 public function get_name() {
66 return 'premium-addon-progressbar';
67 }
68
69 /**
70 * Retrieve Widget Title.
71 *
72 * @since 1.0.0
73 * @access public
74 */
75 public function get_title() {
76 return __( 'Progress Bar', 'premium-addons-for-elementor' );
77 }
78
79 /**
80 * Retrieve Widget Icon.
81 *
82 * @since 1.0.0
83 * @access public
84 *
85 * @return string widget icon.
86 */
87 public function get_icon() {
88 return 'pa-progress-bar';
89 }
90
91 /**
92 * Retrieve Widget Categories.
93 *
94 * @since 1.5.1
95 * @access public
96 *
97 * @return array Widget categories.
98 */
99 public function get_categories() {
100 return array( 'premium-elements' );
101 }
102
103 /**
104 * Retrieve Widget Dependent CSS.
105 *
106 * @since 1.0.0
107 * @access public
108 *
109 * @return array CSS style handles.
110 */
111 public function get_style_depends() {
112 return array(
113 'premium-addons',
114 );
115 }
116
117 /**
118 * Retrieve Widget Dependent JS.
119 *
120 * @since 1.0.0
121 * @access public
122 *
123 * @return array JS script handles.
124 */
125 public function get_script_depends() {
126
127 $is_edit = Helper_Functions::is_edit_mode();
128
129 $scripts = array();
130
131 if ( $is_edit ) {
132
133 $draw_scripts = $this->check_icon_draw() ? array( 'pa-tweenmax', 'pa-motionpath' ) : array();
134
135 $scripts = array_merge( $draw_scripts, array( 'lottie-js' ) );
136
137 } else {
138 $settings = $this->get_settings();
139
140 if ( 'yes' === $settings['draw_svg'] ) {
141 $scripts[] = 'pa-tweenmax';
142 $scripts[] = 'pa-motionpath';
143 }
144
145 if ( 'animation' === $settings['icon_type'] ) {
146 $scripts[] = 'lottie-js';
147 }
148 }
149
150 $scripts[] = 'premium-addons';
151
152 return $scripts;
153 }
154
155 /**
156 * Retrieve Widget Keywords.
157 *
158 * @since 1.0.0
159 * @access public
160 *
161 * @return string Widget keywords.
162 */
163 public function get_keywords() {
164 return array( 'pa', 'premium', 'premium progress bar', 'circle', 'chart', 'line', 'graph', 'percent' );
165 }
166
167 protected function is_dynamic_content(): bool {
168 return false;
169 }
170
171 /**
172 * Retrieve Widget Support URL.
173 *
174 * @access public
175 *
176 * @return string support URL.
177 */
178 public function get_custom_help_url() {
179 return 'https://premiumaddons.com/support/';
180 }
181
182 public function has_widget_inner_wrapper(): bool {
183 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
184 }
185
186 /**
187 * Register Progress Bar controls.
188 *
189 * @since 1.0.0
190 * @access protected
191 */
192 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
193
194 $draw_icon = $this->check_icon_draw();
195
196 $this->start_controls_section(
197 'premium_progressbar_labels',
198 array(
199 'label' => __( 'Progress Bar Settings', 'premium-addons-for-elementor' ),
200 )
201 );
202
203 $this->add_control(
204 'layout_type',
205 array(
206 'label' => __( 'Type', 'premium-addons-for-elementor' ),
207 'type' => Controls_Manager::SELECT,
208 'options' => array(
209 'line' => __( 'Line', 'premium-addons-for-elementor' ),
210 'half-circle' => __( 'Half Circle', 'premium-addons-for-elementor' ),
211 'circle' => __( 'Circle', 'premium-addons-for-elementor' ),
212 'dots' => __( 'Dots', 'premium-addons-for-elementor' ),
213 ),
214 'default' => 'line',
215 'label_block' => true,
216 )
217 );
218
219 $this->add_responsive_control(
220 'dot_size',
221 array(
222 'label' => __( 'Dot Size', 'premium-addons-for-elementor' ),
223 'type' => Controls_Manager::SLIDER,
224 'range' => array(
225 'px' => array(
226 'min' => 1,
227 'max' => 60,
228 ),
229 ),
230 'default' => array(
231 'size' => 25,
232 'unit' => 'px',
233 ),
234 'condition' => array(
235 'layout_type' => 'dots',
236 ),
237 'render_type' => 'template',
238 'selectors' => array(
239 '{{WRAPPER}} .progress-segment' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
240 ),
241 )
242 );
243
244 $this->add_responsive_control(
245 'dot_spacing',
246 array(
247 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
248 'type' => Controls_Manager::SLIDER,
249 'range' => array(
250 'px' => array(
251 'min' => 1,
252 'max' => 10,
253 ),
254 ),
255 'default' => array(
256 'size' => 8,
257 'unit' => 'px',
258 ),
259 'condition' => array(
260 'layout_type' => 'dots',
261 ),
262 'render_type' => 'template',
263 'selectors' => array(
264 '{{WRAPPER}} .progress-segment:not(:first-child):not(:last-child)' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 ); margin-left: calc( {{SIZE}}{{UNIT}}/2 )',
265 '{{WRAPPER}} .progress-segment:first-child' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 )',
266 '{{WRAPPER}} .progress-segment:last-child' => 'margin-left: calc( {{SIZE}}{{UNIT}}/2 )',
267 ),
268 )
269 );
270
271 $this->add_responsive_control(
272 'circle_size',
273 array(
274 'label' => __( 'Size', 'premium-addons-for-elementor' ),
275 'type' => Controls_Manager::SLIDER,
276 'range' => array(
277 'px' => array(
278 'min' => 50,
279 'max' => 500,
280 'step' => 1,
281 ),
282 ),
283 'default' => array(
284 'size' => 200,
285 ),
286 'selectors' => array(
287 '{{WRAPPER}} .premium-progressbar-circle-wrap, {{WRAPPER}} .premium-progressbar-hf-container' => 'width: {{SIZE}}px; height: {{SIZE}}px',
288 '{{WRAPPER}} .premium-progressbar-hf-circle-wrap' => 'width: {{SIZE}}{{UNIT}}; height: calc({{SIZE}} / 2 * 1{{UNIT}});',
289 '{{WRAPPER}} .premium-progressbar-hf-labels' => 'width: {{SIZE}}{{UNIT}};',
290 ),
291 'condition' => array(
292 'layout_type' => array( 'half-circle', 'circle' ),
293 ),
294 )
295 );
296
297 $this->add_control(
298 'premium_progressbar_select_label',
299 array(
300 'label' => __( 'Labels', 'premium-addons-for-elementor' ),
301 'type' => Controls_Manager::SELECT,
302 'default' => 'left_right_labels',
303 'options' => array(
304 'left_right_labels' => __( 'Left & Right Labels', 'premium-addons-for-elementor' ),
305 'more_labels' => __( 'Multiple Labels', 'premium-addons-for-elementor' ),
306 ),
307 'label_block' => true,
308 'condition' => array(
309 'layout_type!' => array( 'half-circle', 'circle' ),
310 ),
311 )
312 );
313
314 $this->add_control(
315 'premium_progressbar_left_label',
316 array(
317 'label' => __( 'Left Label', 'premium-addons-for-elementor' ),
318 'type' => Controls_Manager::TEXT,
319 'dynamic' => array( 'active' => true ),
320 'default' => __( 'My Skill', 'premium-addons-for-elementor' ),
321 'label_block' => true,
322 'condition' => array(
323 'premium_progressbar_select_label' => 'left_right_labels',
324 ),
325 )
326 );
327
328 $this->add_responsive_control(
329 'title_width',
330 array(
331 'label' => __( 'Title Max Width', 'premium-addons-for-elementor' ),
332 'type' => Controls_Manager::SLIDER,
333 'size_units' => array( 'px', '%', 'em' ),
334 'selectors' => array(
335 '{{WRAPPER}} .premium-progressbar-left-label' => 'max-width: {{SIZE}}{{UNIT}}',
336 ),
337 'condition' => array(
338 'layout_type' => array( 'half-circle', 'circle' ),
339 ),
340 )
341 );
342
343 $this->add_control(
344 'premium_progressbar_right_label',
345 array(
346 'label' => __( 'Right Label', 'premium-addons-for-elementor' ),
347 'type' => Controls_Manager::TEXT,
348 'dynamic' => array( 'active' => true ),
349 'default' => __( '50%', 'premium-addons-for-elementor' ),
350 'label_block' => true,
351 'condition' => array(
352 'premium_progressbar_select_label' => 'left_right_labels',
353 'layout_type!' => array( 'half-circle', 'circle' ),
354 ),
355 )
356 );
357
358 $common_conditions = array(
359 'layout_type' => array( 'half-circle', 'circle' ),
360 );
361
362 $this->add_control(
363 'icon_type',
364 array(
365 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
366 'type' => Controls_Manager::SELECT,
367 'options' => array(
368 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
369 'image' => __( 'Custom Image', 'premium-addons-for-elementor' ),
370 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
371 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
372 ),
373 'default' => 'icon',
374 'separator' => 'before',
375 'condition' => $common_conditions,
376 )
377 );
378
379 $this->add_control(
380 'icon_select',
381 array(
382 'label' => __( 'Select an Icon', 'premium-addons-for-elementor' ),
383 'type' => Controls_Manager::ICONS,
384 'condition' => array_merge(
385 $common_conditions,
386 array(
387 'icon_type' => 'icon',
388 )
389 ),
390 )
391 );
392
393 $this->add_control(
394 'image_upload',
395 array(
396 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
397 'type' => Controls_Manager::MEDIA,
398 'default' => array(
399 'url' => Utils::get_placeholder_image_src(),
400 ),
401 'condition' => array_merge(
402 $common_conditions,
403 array(
404 'icon_type' => 'image',
405 )
406 ),
407 )
408 );
409
410 $this->add_control(
411 'custom_svg',
412 array(
413 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
414 'type' => Controls_Manager::TEXTAREA,
415 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
416 'condition' => array_merge(
417 $common_conditions,
418 array(
419 'icon_type' => 'svg',
420 )
421 ),
422 'ai' => array(
423 'active' => false,
424 ),
425 )
426 );
427
428 $this->add_control(
429 'lottie_url',
430 array(
431 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
432 'type' => Controls_Manager::TEXT,
433 'dynamic' => array( 'active' => true ),
434 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
435 'label_block' => true,
436 'condition' => array_merge(
437 $common_conditions,
438 array(
439 'icon_type' => 'animation',
440 )
441 ),
442 'ai' => array(
443 'active' => false,
444 ),
445 )
446 );
447
448 $this->add_control(
449 'draw_svg',
450 array(
451 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
452 'type' => Controls_Manager::SWITCHER,
453 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=ZLr0bRe0RAY" target="_blank">tutorial</a>',
454 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
455 'condition' => array_merge(
456 $common_conditions,
457 array(
458 'icon_type' => array( 'icon', 'svg' ),
459 'icon_select[library]!' => 'svg',
460 )
461 ),
462 )
463 );
464
465 $animation_conds = array(
466 'terms' => array(
467 array(
468 'relation' => 'or',
469 'terms' => array(
470 array(
471 'name' => 'layout_type',
472 'value' => 'half-circle',
473 ),
474 array(
475 'name' => 'layout_type',
476 'value' => 'circle',
477 ),
478 ),
479 ),
480 array(
481 'relation' => 'or',
482 'terms' => array(
483 array(
484 'name' => 'icon_type',
485 'value' => 'animation',
486 ),
487 array(
488 'terms' => array(
489 array(
490 'relation' => 'or',
491 'terms' => array(
492 array(
493 'name' => 'icon_type',
494 'value' => 'icon',
495 ),
496 array(
497 'name' => 'icon_type',
498 'value' => 'svg',
499 ),
500 ),
501 ),
502 array(
503 'name' => 'draw_svg',
504 'value' => 'yes',
505 ),
506 ),
507 ),
508 ),
509 ),
510 ),
511 );
512
513 if ( $draw_icon ) {
514 $this->add_control(
515 'path_width',
516 array(
517 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
518 'type' => Controls_Manager::SLIDER,
519 'range' => array(
520 'px' => array(
521 'min' => 0,
522 'max' => 50,
523 'step' => 0.1,
524 ),
525 ),
526 'condition' => array_merge(
527 $common_conditions,
528 array(
529 'icon_type' => array( 'icon', 'svg' ),
530 )
531 ),
532 'selectors' => array(
533 '{{WRAPPER}} .premium-progressbar-circle-content svg *' => 'stroke-width: {{SIZE}}',
534 ),
535 )
536 );
537
538 $this->add_control(
539 'svg_sync',
540 array(
541 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
542 'type' => Controls_Manager::SWITCHER,
543 'condition' => array_merge(
544 $common_conditions,
545 array(
546 'icon_type' => array( 'icon', 'svg' ),
547 'draw_svg' => 'yes',
548 )
549 ),
550 )
551 );
552
553 $this->add_control(
554 'frames',
555 array(
556 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
557 'type' => Controls_Manager::NUMBER,
558 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
559 'default' => 5,
560 'min' => 1,
561 'max' => 100,
562 'condition' => array_merge(
563 $common_conditions,
564 array(
565 'icon_type' => array( 'icon', 'svg' ),
566 'draw_svg' => 'yes',
567 )
568 ),
569 )
570 );
571 } else {
572
573 Helper_Functions::get_draw_svg_notice(
574 $this,
575 'bar',
576 array_merge(
577 $common_conditions,
578 array(
579 'icon_type' => array( 'icon', 'svg' ),
580 'icon_select[library]!' => 'svg',
581 )
582 )
583 );
584
585 }
586
587 $this->add_control(
588 'lottie_loop',
589 array(
590 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
591 'type' => Controls_Manager::SWITCHER,
592 'return_value' => 'true',
593 'default' => 'true',
594 'conditions' => $animation_conds,
595 )
596 );
597
598 $this->add_control(
599 'lottie_reverse',
600 array(
601 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
602 'type' => Controls_Manager::SWITCHER,
603 'return_value' => 'true',
604 'conditions' => $animation_conds,
605 )
606 );
607
608 if ( $draw_icon ) {
609 $this->add_control(
610 'start_point',
611 array(
612 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
613 'type' => Controls_Manager::SLIDER,
614 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
615 'default' => array(
616 'unit' => '%',
617 'size' => 0,
618 ),
619 'condition' => array_merge(
620 $common_conditions,
621 array(
622 'icon_type' => array( 'icon', 'svg' ),
623 'draw_svg' => 'yes',
624 'lottie_reverse!' => 'true',
625 )
626 ),
627 )
628 );
629
630 $this->add_control(
631 'end_point',
632 array(
633 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
634 'type' => Controls_Manager::SLIDER,
635 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
636 'default' => array(
637 'unit' => '%',
638 'size' => 0,
639 ),
640 'condition' => array_merge(
641 $common_conditions,
642 array(
643 'icon_type' => array( 'icon', 'svg' ),
644 'draw_svg' => 'yes',
645 'lottie_reverse' => 'true',
646 )
647 ),
648
649 )
650 );
651
652 $this->add_control(
653 'svg_hover',
654 array(
655 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
656 'type' => Controls_Manager::SWITCHER,
657 'return_value' => 'true',
658 'condition' => array_merge(
659 $common_conditions,
660 array(
661 'icon_type' => array( 'icon', 'svg' ),
662 'draw_svg' => 'yes',
663 )
664 ),
665 )
666 );
667
668 $this->add_control(
669 'svg_yoyo',
670 array(
671 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
672 'type' => Controls_Manager::SWITCHER,
673 'condition' => array_merge(
674 $common_conditions,
675 array(
676 'icon_type' => array( 'icon', 'svg' ),
677 'draw_svg' => 'yes',
678 'lottie_loop' => 'true',
679 )
680 ),
681 )
682 );
683 }
684
685 $this->add_responsive_control(
686 'icon_size',
687 array(
688 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
689 'type' => Controls_Manager::SLIDER,
690 'condition' => array_merge(
691 $common_conditions,
692 array(
693 'icon_type!' => 'svg',
694 )
695 ),
696 'default' => array(
697 'unit' => 'px',
698 'size' => 30,
699 ),
700 'selectors' => array(
701 '{{WRAPPER}} .premium-progressbar-circle-content i' => 'font-size: {{SIZE}}px',
702 '{{WRAPPER}} .premium-progressbar-circle-content svg, {{WRAPPER}} .premium-progressbar-circle-content img' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important',
703 ),
704 )
705 );
706
707 $this->add_responsive_control(
708 'svg_icon_width',
709 array(
710 'label' => __( 'Width', 'premium-addons-for-elementor' ),
711 'type' => Controls_Manager::SLIDER,
712 'size_units' => array( 'px', 'em', '%' ),
713 'range' => array(
714 'px' => array(
715 'min' => 1,
716 'max' => 600,
717 ),
718 'em' => array(
719 'min' => 1,
720 'max' => 30,
721 ),
722 ),
723 'default' => array(
724 'size' => 100,
725 'unit' => 'px',
726 ),
727 'condition' => array_merge(
728 $common_conditions,
729 array(
730 'icon_type' => 'svg',
731 )
732 ),
733 'selectors' => array(
734 '{{WRAPPER}} .premium-progressbar-circle-content svg' => 'width: {{SIZE}}{{UNIT}};',
735 ),
736 )
737 );
738
739 $this->add_responsive_control(
740 'svg_icon_height',
741 array(
742 'label' => __( 'Height', 'premium-addons-for-elementor' ),
743 'type' => Controls_Manager::SLIDER,
744 'size_units' => array( 'px', 'em' ),
745 'range' => array(
746 'px' => array(
747 'min' => 1,
748 'max' => 300,
749 ),
750 'em' => array(
751 'min' => 1,
752 'max' => 30,
753 ),
754 ),
755 'condition' => array_merge(
756 $common_conditions,
757 array(
758 'icon_type' => 'svg',
759 )
760 ),
761 'selectors' => array(
762 '{{WRAPPER}} .premium-progressbar-circle-content svg' => 'height: {{SIZE}}{{UNIT}}',
763 ),
764 )
765 );
766
767 $this->add_control(
768 'show_percentage_value',
769 array(
770 'label' => __( 'Show Percentage Value', 'premium-addons-for-elementor' ),
771 'type' => Controls_Manager::SWITCHER,
772 'default' => 'yes',
773 'separator' => 'before',
774 'condition' => array(
775 'layout_type' => array( 'half-circle', 'circle' ),
776 ),
777 )
778 );
779
780 $repeater = new REPEATER();
781
782 $repeater->add_control(
783 'text',
784 array(
785 'label' => __( 'Label', 'premium-addons-for-elementor' ),
786 'type' => Controls_Manager::TEXT,
787 'dynamic' => array( 'active' => true ),
788 'label_block' => true,
789 'placeholder' => __( 'label', 'premium-addons-for-elementor' ),
790 'default' => __( 'label', 'premium-addons-for-elementor' ),
791 )
792 );
793
794 $repeater->add_control(
795 'number',
796 array(
797 'label' => __( 'Percentage', 'premium-addons-for-elementor' ),
798 'dynamic' => array( 'active' => true ),
799 'type' => Controls_Manager::TEXT,
800 'default' => 50,
801 )
802 );
803
804 $this->add_control(
805 'premium_progressbar_multiple_label',
806 array(
807 'label' => __( 'Label', 'premium-addons-for-elementor' ),
808 'type' => Controls_Manager::REPEATER,
809 'default' => array(
810 array(
811 'text' => __( 'Label', 'premium-addons-for-elementor' ),
812 'number' => 50,
813 ),
814 ),
815 'fields' => $repeater->get_controls(),
816 'condition' => array(
817 'premium_progressbar_select_label' => 'more_labels',
818 'layout_type!' => 'circle',
819 ),
820 )
821 );
822
823 $this->add_control(
824 'premium_progress_bar_space_percentage_switcher',
825 array(
826 'label' => __( 'Enable Percentage', 'premium-addons-for-elementor' ),
827 'type' => Controls_Manager::SWITCHER,
828 'default' => 'yes',
829 'description' => __( 'Enable percentage for labels', 'premium-addons-for-elementor' ),
830 'condition' => array(
831 'premium_progressbar_select_label' => 'more_labels',
832 'layout_type!' => 'circle',
833 ),
834 )
835 );
836
837 $this->add_control(
838 'premium_progressbar_select_label_icon',
839 array(
840 'label' => __( 'Labels Indicator', 'premium-addons-for-elementor' ),
841 'type' => Controls_Manager::SELECT,
842 'default' => 'line_pin',
843 'options' => array(
844 '' => __( 'None', 'premium-addons-for-elementor' ),
845 'line_pin' => __( 'Pin', 'premium-addons-for-elementor' ),
846 'arrow' => __( 'Arrow', 'premium-addons-for-elementor' ),
847 ),
848 'condition' => array(
849 'premium_progressbar_select_label' => 'more_labels',
850 'layout_type!' => 'circle',
851 ),
852 )
853 );
854
855 $this->add_control(
856 'premium_progressbar_more_labels_align',
857 array(
858 'label' => __( 'Labels Alignment', 'premium-addons-for-elementor' ),
859 'type' => Controls_Manager::CHOOSE,
860 'options' => array(
861 'left' => array(
862 'title' => __( 'Left', 'premium-addons-for-elementor' ),
863 'icon' => 'eicon-text-align-left',
864 ),
865 'center' => array(
866 'title' => __( 'Center', 'premium-addons-for-elementor' ),
867 'icon' => 'eicon-text-align-center',
868 ),
869 'right' => array(
870 'title' => __( 'Right', 'premium-addons-for-elementor' ),
871 'icon' => 'eicon-text-align-right',
872 ),
873 ),
874 'default' => 'center',
875 'condition' => array(
876 'premium_progressbar_select_label' => 'more_labels',
877 'layout_type!' => 'circle',
878 ),
879 )
880 );
881
882 $this->add_control(
883 'premium_progressbar_progress_percentage',
884 array(
885 'label' => __( 'Value', 'premium-addons-for-elementor' ),
886 'type' => Controls_Manager::TEXT,
887 'dynamic' => array( 'active' => true ),
888 'default' => 50,
889 'ai' => array(
890 'active' => false,
891 ),
892 )
893 );
894
895 $this->add_control(
896 'premium_progressbar_progress_style',
897 array(
898 'label' => __( 'Style', 'premium-addons-for-elementor' ),
899 'type' => Controls_Manager::SELECT,
900 'default' => 'solid',
901 'options' => array(
902 'solid' => __( 'Solid', 'premium-addons-for-elementor' ),
903 'stripped' => __( 'Striped', 'premium-addons-for-elementor' ),
904 'gradient' => __( 'Animated Gradient', 'premium-addons-for-elementor' ),
905 ),
906 'condition' => array(
907 'layout_type' => 'line',
908 ),
909 )
910 );
911
912 $this->add_control(
913 'premium_progressbar_speed',
914 array(
915 'label' => __( 'Speed (milliseconds)', 'premium-addons-for-elementor' ),
916 'type' => Controls_Manager::NUMBER,
917 'render_type' => 'template',
918 'selectors' => array(
919 '{{WRAPPER}} .premium-progressbar-hf-circle-progress' => 'transition-duration: {{VALUE}}ms',
920 ),
921 )
922 );
923
924 $this->add_control(
925 'premium_progressbar_progress_animation',
926 array(
927 'label' => __( 'Animated', 'premium-addons-for-elementor' ),
928 'type' => Controls_Manager::SWITCHER,
929 'condition' => array(
930 'premium_progressbar_progress_style' => 'stripped',
931 'layout_type' => 'line',
932 ),
933 )
934 );
935
936 $this->add_control(
937 'gradient_colors',
938 array(
939 'label' => __( 'Gradient Colors', 'premium-addons-for-elementor' ),
940 'type' => Controls_Manager::TEXT,
941 'description' => __( 'Enter Colors separated with \' , \'.', 'premium-addons-for-elementor' ),
942 'default' => '#6EC1E4,#54595F',
943 'label_block' => true,
944 'condition' => array(
945 'layout_type' => 'line',
946 'premium_progressbar_progress_style' => 'gradient',
947 ),
948 'ai' => array(
949 'active' => false,
950 ),
951 )
952 );
953
954 $this->add_control(
955 'half_prefix_label',
956 array(
957 'label' => __( 'Prefix Label', 'premium-addons-for-elementor' ),
958 'type' => Controls_Manager::TEXT,
959 'dynamic' => array( 'active' => true ),
960 'default' => '0',
961 'condition' => array(
962 'layout_type' => 'half-circle',
963 ),
964 'separator' => 'before',
965 )
966 );
967
968 $this->add_control(
969 'half_suffix_label',
970 array(
971 'label' => __( 'Suffix Label', 'premium-addons-for-elementor' ),
972 'type' => Controls_Manager::TEXT,
973 'dynamic' => array( 'active' => true ),
974 'default' => __( '100%', 'premium-addons-for-elementor' ),
975 'condition' => array(
976 'layout_type' => 'half-circle',
977 ),
978 )
979 );
980
981 $this->add_control(
982 'magic_scroll',
983 array(
984 'label' => __( 'Use With Magic Scroll', 'premium-addons-for-elementor' ),
985 'type' => Controls_Manager::SWITCHER,
986 'description' => __( 'Enable this option if you want to animate the progress bar using ', 'premium-addons-for-elementor' ) . '<a href="https://premiumaddons.com/elementor-magic-scroll-global-addon/" target="_blank">Magic Scroll addon.</a>',
987 'condition' => array(
988 'layout_type!' => 'dots',
989 ),
990 )
991 );
992
993 $this->end_controls_section();
994
995 $this->start_controls_section(
996 'section_pa_docs',
997 array(
998 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
999 )
1000 );
1001
1002 $doc1_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/premium-progress-bar-widget/', 'progress-widget', 'wp-editor', 'get-support' );
1003
1004 $this->add_control(
1005 'doc_1',
1006 array(
1007 'type' => Controls_Manager::RAW_HTML,
1008 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc1_url, __( 'Getting started »', 'premium-addons-for-elementor' ) ),
1009 'content_classes' => 'editor-pa-doc',
1010 )
1011 );
1012
1013 Helper_Functions::register_element_feedback_controls( $this );
1014
1015 $this->end_controls_section();
1016
1017 $this->start_controls_section(
1018 'premium_progressbar_progress_bar_settings',
1019 array(
1020 'label' => __( 'Progress Bar', 'premium-addons-for-elementor' ),
1021 'tab' => Controls_Manager::TAB_STYLE,
1022 )
1023 );
1024
1025 $this->add_control(
1026 'premium_progressbar_progress_bar_height',
1027 array(
1028 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1029 'type' => Controls_Manager::SLIDER,
1030 'default' => array(
1031 'size' => 25,
1032 ),
1033 'label_block' => true,
1034 'selectors' => array(
1035 '{{WRAPPER}} .premium-progressbar-bar-wrap, {{WRAPPER}} .premium-progressbar-bar' => 'height: {{SIZE}}px;',
1036 ),
1037 'condition' => array(
1038 'layout_type' => 'line',
1039 ),
1040 )
1041 );
1042
1043 $this->add_control(
1044 'premium_progressbar_progress_bar_radius',
1045 array(
1046 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1047 'type' => Controls_Manager::SLIDER,
1048 'size_units' => array( 'px', '%', 'em' ),
1049 'range' => array(
1050 'px' => array(
1051 'min' => 0,
1052 'max' => 60,
1053 ),
1054 ),
1055 'selectors' => array(
1056 '{{WRAPPER}} .premium-progressbar-bar-wrap, {{WRAPPER}} .premium-progressbar-bar, {{WRAPPER}} .progress-segment' => 'border-radius: {{SIZE}}{{UNIT}};',
1057 ),
1058 'condition' => array(
1059 'layout_type!' => array( 'half-circle', 'circle' ),
1060 ),
1061 )
1062 );
1063
1064 $this->add_control(
1065 'circle_border_width',
1066 array(
1067 'label' => __( 'Border Width', 'premium-addons-for-elementor' ),
1068 'type' => Controls_Manager::SLIDER,
1069 'selectors' => array(
1070 '{{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .premium-progressbar-circle div, {{WRAPPER}} .premium-progressbar-circle-inner, {{WRAPPER}} .premium-progressbar-hf-circle-progress' => 'border-width: {{SIZE}}{{UNIT}}',
1071 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'transform: translateX( calc( {{SIZE}} / 4 * 1{{UNIT}} ) )',
1072 ),
1073 'condition' => array(
1074 'layout_type' => array( 'half-circle', 'circle' ),
1075 ),
1076 )
1077 );
1078
1079 $this->add_control(
1080 'circle_base_border_color',
1081 array(
1082 'label' => __( 'Border Color', 'premium-addons-for-elementor' ),
1083 'type' => Controls_Manager::COLOR,
1084 'global' => array(
1085 'default' => Global_Colors::COLOR_PRIMARY,
1086 ),
1087 'selectors' => array(
1088 '{{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .premium-progressbar-circle-inner' => 'border-color: {{VALUE}};',
1089 ),
1090 'condition' => array(
1091 'layout_type' => array( 'half-circle', 'circle' ),
1092 ),
1093 )
1094 );
1095
1096 $this->add_control(
1097 'fill_colors_title',
1098 array(
1099 'label' => __( 'Fill', 'premium-addons-for-elementor' ),
1100 'type' => Controls_Manager::HEADING,
1101 )
1102 );
1103
1104 $this->add_group_control(
1105 Premium_Background::get_type(),
1106 array(
1107 'name' => 'premium_progressbar_progress_color',
1108 'types' => array( 'classic', 'gradient' ),
1109 'selector' => '{{WRAPPER}} .premium-progressbar-bar, {{WRAPPER}} .segment-inner',
1110 'condition' => array(
1111 'layout_type!' => array( 'half-circle', 'circle' ),
1112 ),
1113 )
1114 );
1115
1116 $this->add_control(
1117 'circle_fill_color',
1118 array(
1119 'label' => __( 'Select Color', 'premium-addons-for-elementor' ),
1120 'type' => Controls_Manager::COLOR,
1121 'global' => array(
1122 'default' => Global_Colors::COLOR_SECONDARY,
1123 ),
1124 'condition' => array(
1125 'layout_type' => array( 'half-circle', 'circle' ),
1126 ),
1127 'selectors' => array(
1128 '{{WRAPPER}} .premium-progressbar-circle div, {{WRAPPER}} .premium-progressbar-hf-circle-progress' => 'border-color: {{VALUE}};',
1129 ),
1130 )
1131 );
1132
1133 $this->add_control(
1134 'base_colors_title',
1135 array(
1136 'label' => __( 'Base', 'premium-addons-for-elementor' ),
1137 'type' => Controls_Manager::HEADING,
1138 )
1139 );
1140
1141 $this->add_group_control(
1142 Premium_Background::get_type(),
1143 array(
1144 'name' => 'premium_progressbar_background',
1145 'types' => array( 'classic', 'gradient' ),
1146 'selector' => '{{WRAPPER}} .premium-progressbar-bar-wrap:not(.premium-progressbar-dots), {{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .progress-segment, {{WRAPPER}} .premium-progressbar-circle-inner',
1147 )
1148 );
1149
1150 $this->add_responsive_control(
1151 'premium_progressbar_container_margin',
1152 array(
1153 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1154 'type' => Controls_Manager::DIMENSIONS,
1155 'size_units' => array( 'px', 'em', '%' ),
1156 'selectors' => array(
1157 '{{WRAPPER}} .premium-progressbar-bar-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1158 ),
1159 'condition' => array(
1160 'layout_type!' => array( 'half-circle', 'circle' ),
1161 ),
1162 )
1163 );
1164
1165 $this->end_controls_section();
1166
1167 $this->start_controls_section(
1168 'premium_progressbar_labels_section',
1169 array(
1170 'label' => __( 'Labels', 'premium-addons-for-elementor' ),
1171 'tab' => Controls_Manager::TAB_STYLE,
1172 'condition' => array(
1173 'premium_progressbar_select_label' => 'left_right_labels',
1174 ),
1175 )
1176 );
1177
1178 $this->add_control(
1179 'premium_progressbar_left_label_hint',
1180 array(
1181 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1182 'type' => Controls_Manager::HEADING,
1183 )
1184 );
1185
1186 $this->add_control(
1187 'premium_progressbar_left_label_color',
1188 array(
1189 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1190 'type' => Controls_Manager::COLOR,
1191 'global' => array(
1192 'default' => Global_Colors::COLOR_PRIMARY,
1193 ),
1194 'selectors' => array(
1195 '{{WRAPPER}} .premium-progressbar-left-label' => 'color: {{VALUE}};',
1196 ),
1197 )
1198 );
1199
1200 $this->add_group_control(
1201 Group_Control_Typography::get_type(),
1202 array(
1203 'name' => 'left_label_typography',
1204 'global' => array(
1205 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1206 ),
1207 'selector' => '{{WRAPPER}} .premium-progressbar-left-label',
1208 )
1209 );
1210
1211 $this->add_responsive_control(
1212 'premium_progressbar_left_label_margin',
1213 array(
1214 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1215 'type' => Controls_Manager::DIMENSIONS,
1216 'size_units' => array( 'px', 'em', '%' ),
1217 'selectors' => array(
1218 '{{WRAPPER}} .premium-progressbar-left-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1219 ),
1220 )
1221 );
1222
1223 $this->add_control(
1224 'premium_progressbar_right_label_hint',
1225 array(
1226 'label' => __( 'Percentage', 'premium-addons-for-elementor' ),
1227 'type' => Controls_Manager::HEADING,
1228 'separator' => 'before',
1229 )
1230 );
1231
1232 $this->add_control(
1233 'premium_progressbar_right_label_color',
1234 array(
1235 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1236 'type' => Controls_Manager::COLOR,
1237 'global' => array(
1238 'default' => Global_Colors::COLOR_PRIMARY,
1239 ),
1240 'selectors' => array(
1241 '{{WRAPPER}} .premium-progressbar-right-label' => 'color: {{VALUE}};',
1242 ),
1243 )
1244 );
1245
1246 $this->add_group_control(
1247 Group_Control_Typography::get_type(),
1248 array(
1249 'name' => 'right_label_typography',
1250 'global' => array(
1251 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1252 ),
1253 'selector' => '{{WRAPPER}} .premium-progressbar-right-label',
1254 )
1255 );
1256
1257 $this->add_responsive_control(
1258 'premium_progressbar_right_label_margin',
1259 array(
1260 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1261 'type' => Controls_Manager::DIMENSIONS,
1262 'size_units' => array( 'px', 'em', '%' ),
1263 'selectors' => array(
1264 '{{WRAPPER}} .premium-progressbar-right-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1265 ),
1266 )
1267 );
1268
1269 $this->end_controls_section();
1270
1271 $this->start_controls_section(
1272 'icon_style',
1273 array(
1274 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
1275 'tab' => Controls_Manager::TAB_STYLE,
1276 'condition' => array(
1277 'layout_type' => array( 'half-circle', 'circle' ),
1278 ),
1279 )
1280 );
1281
1282 $this->add_control(
1283 'icon_color',
1284 array(
1285 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1286 'type' => Controls_Manager::COLOR,
1287 'global' => array(
1288 'default' => Global_Colors::COLOR_PRIMARY,
1289 ),
1290 'selectors' => array(
1291 '{{WRAPPER}} .premium-progressbar-circle-icon' => 'color: {{VALUE}}',
1292 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1293 ),
1294 'condition' => array(
1295 'icon_type' => array( 'icon', 'svg' ),
1296 ),
1297 )
1298 );
1299
1300 if ( $draw_icon ) {
1301 $this->add_control(
1302 'stroke_color',
1303 array(
1304 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1305 'type' => Controls_Manager::COLOR,
1306 'global' => array(
1307 'default' => Global_Colors::COLOR_ACCENT,
1308 ),
1309 'condition' => array(
1310 'icon_type' => array( 'icon', 'svg' ),
1311 ),
1312 'selectors' => array(
1313 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
1314 ),
1315 )
1316 );
1317 }
1318
1319 $this->add_control(
1320 'svg_color',
1321 array(
1322 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1323 'type' => Controls_Manager::COLOR,
1324 'global' => false,
1325 'separator' => 'after',
1326 'condition' => array(
1327 'icon_type' => array( 'icon', 'svg' ),
1328 'draw_svg' => 'yes',
1329 ),
1330 )
1331 );
1332
1333 $this->add_control(
1334 'icon_background_color',
1335 array(
1336 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1337 'type' => Controls_Manager::COLOR,
1338 'selectors' => array(
1339 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'background-color: {{VALUE}};',
1340 ),
1341 'condition' => array(
1342 'icon_type!' => 'image',
1343 ),
1344 )
1345 );
1346
1347 $this->add_group_control(
1348 Group_Control_Border::get_type(),
1349 array(
1350 'name' => 'icon_border',
1351 'selector' => '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg',
1352 )
1353 );
1354
1355 $this->add_responsive_control(
1356 'icon_border_radius',
1357 array(
1358 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1359 'type' => Controls_Manager::DIMENSIONS,
1360 'size_units' => array( 'px', 'em', '%' ),
1361 'selectors' => array(
1362 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1363 ),
1364 )
1365 );
1366
1367 $this->add_responsive_control(
1368 'icon_margin',
1369 array(
1370 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1371 'type' => Controls_Manager::DIMENSIONS,
1372 'size_units' => array( 'px', 'em', '%' ),
1373 'selectors' => array(
1374 '{{WRAPPER}} .premium-progressbar-circle-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1375 ),
1376 )
1377 );
1378
1379 $this->add_responsive_control(
1380 'icon_padding',
1381 array(
1382 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1383 'type' => Controls_Manager::DIMENSIONS,
1384 'size_units' => array( 'px', 'em', '%' ),
1385 'selectors' => array(
1386 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1387 ),
1388 )
1389 );
1390
1391 $this->end_controls_section();
1392
1393 $this->start_controls_section(
1394 'premium_progressbar_multiple_labels_section',
1395 array(
1396 'label' => __( 'Multiple Labels', 'premium-addons-for-elementor' ),
1397 'tab' => Controls_Manager::TAB_STYLE,
1398 'condition' => array(
1399 'premium_progressbar_select_label' => 'more_labels',
1400 ),
1401 )
1402 );
1403
1404 $this->add_control(
1405 'premium_progressbar_multiple_label_color',
1406 array(
1407 'label' => __( 'Labels\' Color', 'premium-addons-for-elementor' ),
1408 'type' => Controls_Manager::COLOR,
1409 'global' => array(
1410 'default' => Global_Colors::COLOR_PRIMARY,
1411 ),
1412 'selectors' => array(
1413 '{{WRAPPER}} .premium-progressbar-center-label' => 'color: {{VALUE}};',
1414 ),
1415 )
1416 );
1417
1418 $this->add_group_control(
1419 Group_Control_Typography::get_type(),
1420 array(
1421 'label' => __( 'Labels\' Typography', 'premium-addons-for-elementor' ),
1422 'name' => 'more_label_typography',
1423 'global' => array(
1424 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1425 ),
1426 'selector' => '{{WRAPPER}} .premium-progressbar-center-label',
1427 )
1428 );
1429
1430 $this->add_control(
1431 'premium_progressbar_value_label_color',
1432 array(
1433 'label' => __( 'Percentage Color', 'premium-addons-for-elementor' ),
1434 'type' => Controls_Manager::COLOR,
1435 'global' => array(
1436 'default' => Global_Colors::COLOR_PRIMARY,
1437 ),
1438 'condition' => array(
1439 'premium_progress_bar_space_percentage_switcher' => 'yes',
1440 ),
1441 'selectors' => array(
1442 '{{WRAPPER}} .premium-progressbar-percentage' => 'color: {{VALUE}};',
1443 ),
1444 )
1445 );
1446
1447 $this->add_group_control(
1448 Group_Control_Typography::get_type(),
1449 array(
1450 'label' => __( 'Percentage Typography', 'premium-addons-for-elementor' ),
1451 'name' => 'percentage_typography',
1452 'condition' => array(
1453 'premium_progress_bar_space_percentage_switcher' => 'yes',
1454 ),
1455 'global' => array(
1456 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1457 ),
1458 'selector' => '{{WRAPPER}} .premium-progressbar-percentage',
1459 )
1460 );
1461
1462 $this->end_controls_section();
1463
1464 $this->start_controls_section(
1465 'premium_progressbar_multiple_labels_arrow_section',
1466 array(
1467 'label' => __( 'Arrow', 'premium-addons-for-elementor' ),
1468 'tab' => Controls_Manager::TAB_STYLE,
1469 'condition' => array(
1470 'premium_progressbar_select_label' => 'more_labels',
1471 'premium_progressbar_select_label_icon' => 'arrow',
1472 ),
1473 )
1474 );
1475
1476 $this->add_control(
1477 'premium_progressbar_arrow_color',
1478 array(
1479 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1480 'type' => Controls_Manager::COLOR,
1481 'global' => array(
1482 'default' => Global_Colors::COLOR_PRIMARY,
1483 ),
1484 'condition' => array(
1485 'premium_progressbar_select_label_icon' => 'arrow',
1486 ),
1487 'selectors' => array(
1488 '{{WRAPPER}} .premium-progressbar-arrow' => 'color: {{VALUE}}',
1489 ),
1490 )
1491 );
1492
1493 $this->add_responsive_control(
1494 'premium_arrow_size',
1495 array(
1496 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1497 'type' => Controls_Manager::SLIDER,
1498 'size_units' => array( 'px', 'em' ),
1499 'condition' => array(
1500 'premium_progressbar_select_label_icon' => 'arrow',
1501 ),
1502 'selectors' => array(
1503 '{{WRAPPER}} .premium-progressbar-arrow' => 'border-width: {{SIZE}}{{UNIT}};',
1504 ),
1505 )
1506 );
1507
1508 $this->end_controls_section();
1509
1510 $this->start_controls_section(
1511 'premium_progressbar_multiple_labels_pin_section',
1512 array(
1513 'label' => __( 'Indicator', 'premium-addons-for-elementor' ),
1514 'tab' => Controls_Manager::TAB_STYLE,
1515 'condition' => array(
1516 'premium_progressbar_select_label' => 'more_labels',
1517 'premium_progressbar_select_label_icon' => 'line_pin',
1518 ),
1519 )
1520 );
1521
1522 $this->add_control(
1523 'premium_progressbar_line_pin_color',
1524 array(
1525 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1526 'type' => Controls_Manager::COLOR,
1527 'global' => array(
1528 'default' => Global_Colors::COLOR_SECONDARY,
1529 ),
1530 'condition' => array(
1531 'premium_progressbar_select_label_icon' => 'line_pin',
1532 ),
1533 'selectors' => array(
1534 '{{WRAPPER}} .premium-progressbar-pin' => 'border-color: {{VALUE}};',
1535 ),
1536 )
1537 );
1538
1539 $this->add_responsive_control(
1540 'premium_pin_size',
1541 array(
1542 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1543 'type' => Controls_Manager::SLIDER,
1544 'size_units' => array( 'px', 'em' ),
1545 'condition' => array(
1546 'premium_progressbar_select_label_icon' => 'line_pin',
1547 ),
1548 'selectors' => array(
1549 '{{WRAPPER}} .premium-progressbar-pin' => 'border-left-width: {{SIZE}}{{UNIT}};',
1550 ),
1551 )
1552 );
1553
1554 $this->add_responsive_control(
1555 'premium_pin_height',
1556 array(
1557 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1558 'type' => Controls_Manager::SLIDER,
1559 'size_units' => array( 'px', 'em' ),
1560 'condition' => array(
1561 'premium_progressbar_select_label_icon' => 'line_pin',
1562 ),
1563 'selectors' => array(
1564 '{{WRAPPER}} .premium-progressbar-pin' => 'height: {{SIZE}}{{UNIT}};',
1565 ),
1566 )
1567 );
1568
1569 $this->end_controls_section();
1570
1571 $this->start_controls_section(
1572 'prefix_suffix_style',
1573 array(
1574 'label' => __( 'Prefix & Suffix', 'premium-addons-for-elementor' ),
1575 'tab' => Controls_Manager::TAB_STYLE,
1576 'condition' => array(
1577 'layout_type' => 'half-circle',
1578 ),
1579 )
1580 );
1581
1582 $this->add_responsive_control(
1583 'labels_top_spacing',
1584 array(
1585 'label' => __( 'Top Spacing', 'premium-addons-for-elementor' ),
1586 'type' => Controls_Manager::SLIDER,
1587 'range' => array(
1588 'px' => array(
1589 'min' => 1,
1590 'max' => 300,
1591 ),
1592 ),
1593 'selectors' => array(
1594 '{{WRAPPER}} .premium-progressbar-hf-labels' => 'margin-top: {{SIZE}}px;',
1595 ),
1596 )
1597 );
1598
1599 $this->add_control(
1600 'prefix_title',
1601 array(
1602 'label' => __( 'Prefix', 'premium-addons-for-elementor' ),
1603 'type' => Controls_Manager::HEADING,
1604 )
1605 );
1606
1607 $this->add_control(
1608 'prefix_label_color',
1609 array(
1610 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1611 'type' => Controls_Manager::COLOR,
1612 'global' => array(
1613 'default' => Global_Colors::COLOR_PRIMARY,
1614 ),
1615 'selectors' => array(
1616 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'color: {{VALUE}};',
1617 ),
1618 )
1619 );
1620
1621 $this->add_group_control(
1622 Group_Control_Typography::get_type(),
1623 array(
1624 'name' => 'prefix_label_typo',
1625 'global' => array(
1626 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1627 ),
1628 'selector' => '{{WRAPPER}} .premium-progressbar-hf-label-left',
1629 )
1630 );
1631
1632 $pfx_direction = is_rtl() ? 'right' : 'left';
1633 $sfx_direction = is_rtl() ? 'left' : 'right';
1634
1635 $this->add_responsive_control(
1636 'prefix_spacing',
1637 array(
1638 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1639 'type' => Controls_Manager::SLIDER,
1640 'selectors' => array(
1641 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'margin-' . $pfx_direction . ': {{SIZE}}px;',
1642 ),
1643 )
1644 );
1645
1646 $this->add_control(
1647 'suffix_title',
1648 array(
1649 'label' => __( 'Suffix', 'premium-addons-for-elementor' ),
1650 'type' => Controls_Manager::HEADING,
1651 )
1652 );
1653
1654 $this->add_control(
1655 'suffix_label_color',
1656 array(
1657 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1658 'type' => Controls_Manager::COLOR,
1659 'separator' => 'before',
1660 'global' => array(
1661 'default' => Global_Colors::COLOR_PRIMARY,
1662 ),
1663 'selectors' => array(
1664 '{{WRAPPER}} .premium-progressbar-hf-label-right' => 'color: {{VALUE}};',
1665 ),
1666 )
1667 );
1668
1669 $this->add_group_control(
1670 Group_Control_Typography::get_type(),
1671 array(
1672 'name' => 'suffix_label_typo',
1673 'global' => array(
1674 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1675 ),
1676 'selector' => '{{WRAPPER}} .premium-progressbar-hf-label-right',
1677 )
1678 );
1679
1680 $this->add_responsive_control(
1681 'suffix_spacing',
1682 array(
1683 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1684 'type' => Controls_Manager::SLIDER,
1685 'selectors' => array(
1686 '{{WRAPPER}} .premium-progressbar-hf-label-right' => 'margin-' . $sfx_direction . ': {{SIZE}}px;',
1687 ),
1688 )
1689 );
1690
1691 $this->end_controls_section();
1692 }
1693
1694 /**
1695 * Render Progress Bar widget output on the frontend.
1696 *
1697 * Written in PHP and used to generate the final HTML.
1698 *
1699 * @since 1.0.0
1700 * @access protected
1701 */
1702 protected function render() {
1703
1704 $settings = $this->get_settings_for_display();
1705
1706 $this->add_inline_editing_attributes( 'premium_progressbar_left_label' );
1707 $this->add_render_attribute( 'premium_progressbar_left_label', 'class', 'premium-progressbar-left-label' );
1708
1709 $this->add_inline_editing_attributes( 'premium_progressbar_right_label' );
1710 $this->add_render_attribute( 'premium_progressbar_right_label', 'class', 'premium-progressbar-right-label' );
1711
1712 $length = isset( $settings['premium_progressbar_progress_percentage']['size'] ) ? $settings['premium_progressbar_progress_percentage']['size'] : $settings['premium_progressbar_progress_percentage'];
1713
1714 $style = $settings['premium_progressbar_progress_style'];
1715 $type = $settings['layout_type'];
1716
1717 $progressbar_settings = array(
1718 'progress_length' => $length,
1719 'speed' => ! empty( $settings['premium_progressbar_speed'] ) ? $settings['premium_progressbar_speed'] : 1000,
1720 'type' => $type,
1721 'mScroll' => $settings['magic_scroll'],
1722 );
1723
1724 if ( 'dots' === $type ) {
1725 $progressbar_settings['dot'] = $settings['dot_size']['size'];
1726 $progressbar_settings['spacing'] = $settings['dot_spacing']['size'];
1727 }
1728
1729 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-container' );
1730
1731 if ( 'stripped' === $style ) {
1732 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-striped' );
1733 } elseif ( 'gradient' === $style ) {
1734 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-gradient' );
1735 $progressbar_settings['gradient'] = $settings['gradient_colors'];
1736 }
1737
1738 if ( 'yes' === $settings['premium_progressbar_progress_animation'] ) {
1739 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-active' );
1740 }
1741
1742 $this->add_render_attribute( 'progressbar', 'data-settings', wp_json_encode( $progressbar_settings ) );
1743
1744 if ( 'circle' !== $type && 'half-circle' !== $type ) {
1745 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar-bar-wrap' );
1746
1747 if ( 'dots' === $type ) {
1748 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar-dots' );
1749 }
1750 } else {
1751
1752 $class = 'half-circle' === $type ? '-hf' : '';
1753
1754 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar' . $class . '-circle-wrap' );
1755
1756 }
1757
1758 if ( 'yes' === $settings['draw_svg'] ) {
1759
1760 $this->add_render_attribute(
1761 'progressbar',
1762 'class',
1763 array(
1764 'elementor-invisible',
1765 'premium-drawer-hover',
1766 )
1767 );
1768 }
1769
1770 ?>
1771
1772 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'progressbar' ) ); ?>>
1773
1774 <?php if ( 'left_right_labels' === $settings['premium_progressbar_select_label'] ) : ?>
1775 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_left_label' ) ); ?>>
1776 <?php echo wp_kses_post( $settings['premium_progressbar_left_label'] ); ?>
1777 </p>
1778 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_right_label' ) ); ?>>
1779 <?php echo wp_kses_post( 'yes' !== $settings['magic_scroll'] ? $settings['premium_progressbar_right_label'] : '0%' ); ?>
1780 </p>
1781 <?php endif; ?>
1782
1783 <?php if ( 'more_labels' === $settings['premium_progressbar_select_label'] ) : ?>
1784 <div class="premium-progressbar-container-label" style="position:relative;">
1785 <?php
1786 $direction = is_rtl() ? 'right' : 'left';
1787
1788 foreach ( $settings['premium_progressbar_multiple_label'] as $item ) {
1789 if ( 'center' === $this->get_settings( 'premium_progressbar_more_labels_align' ) ) {
1790 if ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1791 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1792 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1793 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1794 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1795 } else {
1796 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1797 }
1798 } elseif ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1799 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1800 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1801 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%)">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1802 } else {
1803 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . '</p></div>';
1804 }
1805 } elseif ( 'left' === $this->get_settings( 'premium_progressbar_more_labels_align' ) ) {
1806 if ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1807 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1808 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-10%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1809 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1810 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1811 } else {
1812 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1813 }
1814 } elseif ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1815 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-10%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1816 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1817 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1818 } else {
1819 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . '</p></div>';
1820 }
1821 } elseif ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1822 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1823 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-82%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1824 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1825 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-95%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1826 } else {
1827 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-96%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1828 }
1829 } elseif ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1830 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-71%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1831 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1832 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-97%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1833 } else {
1834 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-96%);">' . esc_attr( $item['text'] ) . '</p></div>';
1835 }
1836 }
1837 ?>
1838 </div>
1839 <?php endif; ?>
1840
1841 <?php if ( 'circle' !== $type ) : ?>
1842 <div class="clearfix"></div>
1843 <?php endif; ?>
1844
1845 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'wrap' ) ); ?>>
1846 <?php if ( 'line' === $type ) : ?>
1847 <div class="premium-progressbar-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
1848 <?php elseif ( 'circle' === $type ) : ?>
1849
1850 <div class="premium-progressbar-circle-base"></div>
1851 <div class="premium-progressbar-circle">
1852 <div class="premium-progressbar-circle-left"></div>
1853 <div class="premium-progressbar-circle-right"></div>
1854 </div>
1855
1856 <?php $this->render_progressbar_content(); ?>
1857
1858 <?php elseif ( 'half-circle' === $type ) : ?>
1859
1860 <div class="premium-progressbar-hf-container">
1861 <div class="premium-progressbar-hf-circle">
1862 <div class="premium-progressbar-hf-circle-progress"></div>
1863 </div>
1864
1865 <div class="premium-progressbar-circle-inner"></div>
1866 </div>
1867
1868 <?php $this->render_progressbar_content(); ?>
1869
1870 <?php endif; ?>
1871 </div>
1872
1873 <?php if ( 'half-circle' === $type ) : ?>
1874 <div class="premium-progressbar-hf-labels">
1875 <span class="premium-progressbar-hf-label-left">
1876 <?php echo wp_kses_post( $settings['half_prefix_label'] ); ?>
1877 </span>
1878 <span class="premium-progressbar-hf-label-right">
1879 <?php echo wp_kses_post( $settings['half_suffix_label'] ); ?>
1880 </span>
1881 </div>
1882 <?php endif; ?>
1883
1884 </div>
1885
1886 <?php
1887 }
1888
1889 /**
1890 * Get Progressbar Content
1891 *
1892 * @since 4.9.13
1893 * @access private
1894 */
1895 private function render_progressbar_content() {
1896
1897 $settings = $this->get_settings_for_display();
1898
1899 $icon_type = $settings['icon_type'];
1900
1901 if ( 'icon' === $icon_type || 'svg' === $icon_type ) {
1902
1903 $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' );
1904
1905 if ( ( 'yes' === $settings['draw_svg'] && 'icon' === $icon_type ) || 'svg' === $icon_type ) {
1906 $this->add_render_attribute( 'icon', 'class', 'premium-progressbar-circle-icon' );
1907 }
1908
1909 if ( 'yes' === $settings['draw_svg'] ) {
1910
1911 // if ( 'icon' === $icon_type ) {
1912
1913 // $this->add_render_attribute( 'icon', 'class', $settings['icon_select']['value'] );
1914
1915 // }
1916
1917 $this->add_render_attribute(
1918 'icon',
1919 array(
1920 'class' => 'premium-svg-drawer',
1921 'data-svg-reverse' => $settings['lottie_reverse'],
1922 'data-svg-loop' => $settings['lottie_loop'],
1923 'data-svg-sync' => $settings['svg_sync'],
1924 'data-svg-hover' => $settings['svg_hover'],
1925 'data-svg-fill' => $settings['svg_color'],
1926 'data-svg-frames' => $settings['frames'],
1927 'data-svg-yoyo' => $settings['svg_yoyo'],
1928 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
1929 )
1930 );
1931
1932 } else {
1933 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
1934 }
1935 } elseif ( 'animation' === $icon_type ) {
1936 $this->add_render_attribute(
1937 'progress_lottie',
1938 array(
1939 'class' => array(
1940 'premium-progressbar-circle-icon',
1941 'premium-lottie-animation',
1942 ),
1943 'data-lottie-url' => $settings['lottie_url'],
1944 'data-lottie-loop' => $settings['lottie_loop'],
1945 'data-lottie-reverse' => $settings['lottie_reverse'],
1946 )
1947 );
1948 }
1949
1950 ?>
1951
1952 <div class="premium-progressbar-circle-content">
1953
1954 <?php
1955 if ( 'icon' === $icon_type ) :
1956 if ( 'yes' !== $settings['draw_svg'] ) :
1957 Icons_Manager::render_icon(
1958 $settings['icon_select'],
1959 array(
1960 'class' => array( 'premium-progressbar-circle-icon', 'premium-svg-nodraw', 'premium-drawable-icon' ),
1961 'aria-hidden' => 'true',
1962 )
1963 );
1964 else :
1965 echo Helper_Functions::get_svg_by_icon(
1966 $settings['icon_select'],
1967 $this->get_render_attribute_string( 'icon' )
1968 );
1969 endif;
1970
1971 elseif ( 'svg' === $icon_type ) :
1972 ?>
1973 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
1974 <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); ?>
1975 </div>
1976 <?php
1977 elseif ( 'image' === $icon_type ) :
1978 ?>
1979 <img class="premium-progressbar-circle-icon" src="<?php echo esc_attr( $settings['image_upload']['url'] ); ?>">
1980 <?php else : ?>
1981 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'progress_lottie' ) ); ?>></div>
1982 <?php endif; ?>
1983
1984 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_left_label' ) ); ?>>
1985 <?php echo wp_kses_post( $settings['premium_progressbar_left_label'] ); ?>
1986 </p>
1987 <?php if ( 'yes' === $settings['show_percentage_value'] ) : ?>
1988 <?php if ( 'yes' === $settings['show_percentage_value'] ) : ?>
1989 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_right_label' ) ); ?>>0%</p>
1990 <?php endif; ?>
1991 <?php endif; ?>
1992 </div>
1993
1994 <?php
1995 }
1996 }
1997