progressbar.php
574 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | use \Elementor\ElementsKit_Widget_Progressbar_Handler as Handler; |
| 5 | use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager; |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 8 | |
| 9 | class ElementsKit_Widget_Progressbar extends Widget_Base { |
| 10 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 11 | |
| 12 | public $base; |
| 13 | |
| 14 | public function __construct( $data = [], $args = null ) { |
| 15 | parent::__construct( $data, $args ); |
| 16 | } |
| 17 | |
| 18 | public function get_script_depends() { |
| 19 | return ['ekit-animate-numbers', 'ekit-progressbar']; |
| 20 | } |
| 21 | |
| 22 | public function get_name() { |
| 23 | return Handler::get_name(); |
| 24 | } |
| 25 | |
| 26 | public function get_title() { |
| 27 | return Handler::get_title(); |
| 28 | } |
| 29 | |
| 30 | public function get_icon() { |
| 31 | return Handler::get_icon(); |
| 32 | } |
| 33 | |
| 34 | public function get_categories() { |
| 35 | return Handler::get_categories(); |
| 36 | } |
| 37 | |
| 38 | public function get_keywords() { |
| 39 | return Handler::get_keywords(); |
| 40 | } |
| 41 | |
| 42 | public function get_help_url() { |
| 43 | return 'https://wpmet.com/doc/progress-bar/'; |
| 44 | } |
| 45 | protected function is_dynamic_content(): bool { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | protected function register_controls() { |
| 50 | $this->start_controls_section( |
| 51 | 'ekit_progressbar_content', [ |
| 52 | 'label' => esc_html__( 'Progress Bar', 'elementskit-lite' ), |
| 53 | ] |
| 54 | ); |
| 55 | |
| 56 | $this->add_control( |
| 57 | 'ekit_progressbar_style', |
| 58 | [ |
| 59 | 'label' =>esc_html__( 'Style', 'elementskit-lite' ), |
| 60 | 'type' => Controls_Manager::SELECT, |
| 61 | 'default' => '', |
| 62 | 'options' => [ |
| 63 | '' => esc_html__( 'Default', 'elementskit-lite' ), |
| 64 | 'inner-content skill-big' => esc_html__( 'Inner Content', 'elementskit-lite' ), |
| 65 | 'skilltrack-style2' => esc_html__( 'Bar Shadow', 'elementskit-lite' ), |
| 66 | 'tooltip-style3' => esc_html__( 'Tooltip', 'elementskit-lite' ), |
| 67 | 'tooltip-style2' => esc_html__( 'Tooltip Box', 'elementskit-lite' ), |
| 68 | 'tooltip-style' => esc_html__( 'Tooltip Rounded', 'elementskit-lite' ), |
| 69 | 'pin-style' => esc_html__( 'Tooltip Circle', 'elementskit-lite' ), |
| 70 | 'style-switch' => esc_html__( 'Switch', 'elementskit-lite' ), |
| 71 | 'style-ribbon' => esc_html__( 'Ribbon', 'elementskit-lite' ), |
| 72 | 'style-stripe skill-medium tooltip-style' => esc_html__( 'Stripe', 'elementskit-lite' ), |
| 73 | ], |
| 74 | ] |
| 75 | ); |
| 76 | |
| 77 | $this->add_control( |
| 78 | 'ekit_progressbar_icons', |
| 79 | [ |
| 80 | 'label' => esc_html__('Add Icon', 'elementskit-lite'), |
| 81 | 'label_block' => true, |
| 82 | 'type' => Controls_Manager::ICONS, |
| 83 | 'fa4compatibility' => 'ekit_progressbar_icon', |
| 84 | 'default' => [ |
| 85 | 'value' => 'icon icon-arrow-right', |
| 86 | 'library' => 'ekiticons', |
| 87 | ], |
| 88 | 'condition' => [ |
| 89 | 'ekit_progressbar_style' => ['inner-content skill-big'], |
| 90 | ], |
| 91 | ] |
| 92 | ); |
| 93 | |
| 94 | |
| 95 | $this->add_control( |
| 96 | 'ekit_progressbar_title', |
| 97 | [ |
| 98 | 'label' => esc_html__('Title', 'elementskit-lite'), |
| 99 | 'label_block' => true, |
| 100 | 'type' => Controls_Manager::TEXT, |
| 101 | 'dynamic' => [ |
| 102 | 'active' => true, |
| 103 | ], |
| 104 | 'default' => 'WordPress', |
| 105 | ] |
| 106 | ); |
| 107 | |
| 108 | $this->add_control( |
| 109 | 'ekit_progressbar_percentage', |
| 110 | [ |
| 111 | 'label' => esc_html__('Percentage', 'elementskit-lite'), |
| 112 | 'type' => Controls_Manager::NUMBER, |
| 113 | 'dynamic' => [ |
| 114 | 'active' => true, |
| 115 | ], |
| 116 | 'min' => 1, |
| 117 | 'max' => 100, |
| 118 | 'step' => 1, |
| 119 | 'default' => 90, |
| 120 | ] |
| 121 | ); |
| 122 | |
| 123 | $this->add_control( |
| 124 | 'ekit_progressbar_percentage_show', |
| 125 | [ |
| 126 | 'label' => esc_html__('Hide Percentage Number? ', 'elementskit-lite'), |
| 127 | 'type' => Controls_Manager::SWITCHER, |
| 128 | 'default' => 'no', |
| 129 | 'return_value' => 'none', |
| 130 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 131 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 132 | 'selectors' => [ |
| 133 | '{{WRAPPER}} .skillbar-group .number-percentage-wraper' => 'display: {{VALUE}};', |
| 134 | ], |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $this->add_responsive_control( |
| 139 | 'ekit_progressbar_data_duration', |
| 140 | [ |
| 141 | 'label' => esc_html__('Animation Duration', 'elementskit-lite'), |
| 142 | 'type' => Controls_Manager::SLIDER, |
| 143 | 'dynamic' => [ |
| 144 | 'active' => true, |
| 145 | ], |
| 146 | 'size_units' => [ 'px'], |
| 147 | 'range' => [ |
| 148 | 'px' => [ |
| 149 | 'min' => 100, |
| 150 | 'max' => 10000, |
| 151 | 'step' => 5, |
| 152 | ], |
| 153 | |
| 154 | ], |
| 155 | 'default' => [ |
| 156 | 'size' => 3500, |
| 157 | ], |
| 158 | |
| 159 | ] |
| 160 | ); |
| 161 | |
| 162 | $this->end_controls_section(); |
| 163 | |
| 164 | |
| 165 | // Bar Styles |
| 166 | $this->start_controls_section( |
| 167 | 'ekit_progressbar_bar_style', [ |
| 168 | 'label' =>esc_html__( 'Bar', 'elementskit-lite' ), |
| 169 | 'tab' => Controls_Manager::TAB_STYLE, |
| 170 | ] |
| 171 | ); |
| 172 | |
| 173 | $this->add_group_control( |
| 174 | Group_Control_Background::get_type(), |
| 175 | [ |
| 176 | 'name' => 'ekit_progressbar_background', |
| 177 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 178 | 'types' => [ 'classic', 'gradient' ], |
| 179 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-bar', |
| 180 | 'default' => '#f5f5f5' |
| 181 | ] |
| 182 | ); |
| 183 | |
| 184 | $this->add_responsive_control( |
| 185 | 'ekit_progressbar_bar_height', |
| 186 | [ |
| 187 | 'label' => esc_html__('Height', 'elementskit-lite'), |
| 188 | 'type' => Controls_Manager::SLIDER, |
| 189 | 'size_units' => ['px', 'em'], |
| 190 | 'range' => [ |
| 191 | 'px' => [ |
| 192 | 'min' => 1, |
| 193 | 'max' => 200, |
| 194 | ], |
| 195 | ], |
| 196 | 'separator' => 'before', |
| 197 | 'condition' => [ |
| 198 | 'ekit_progressbar_style!' => ['style-switch'], |
| 199 | ], |
| 200 | 'selectors' => [ |
| 201 | '{{WRAPPER}} .skillbar-group .skill-bar' => 'height: {{SIZE}}{{UNIT}};', |
| 202 | ], |
| 203 | ] |
| 204 | ); |
| 205 | |
| 206 | $this->add_group_control( |
| 207 | Group_Control_Box_Shadow::get_type(), |
| 208 | [ |
| 209 | 'name' => 'ekit_progressbar_bar_shadow', |
| 210 | 'label' => esc_html__( 'Shadow', 'elementskit-lite' ), |
| 211 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-bar', |
| 212 | ] |
| 213 | ); |
| 214 | |
| 215 | $this->add_responsive_control( |
| 216 | 'ekit_progressbar_bar_radius', |
| 217 | [ |
| 218 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 219 | 'type' => Controls_Manager::DIMENSIONS, |
| 220 | 'size_units' => [ 'px', '%', 'em' ], |
| 221 | 'selectors' => [ |
| 222 | '{{WRAPPER}} .skillbar-group .skill-bar' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 223 | ], |
| 224 | ] |
| 225 | ); |
| 226 | |
| 227 | $this->add_responsive_control( |
| 228 | 'ekit_progressbar_bar_padding', |
| 229 | [ |
| 230 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 231 | 'type' => Controls_Manager::DIMENSIONS, |
| 232 | 'size_units' => [ 'px', '%', 'em' ], |
| 233 | 'condition' => [ |
| 234 | 'ekit_progressbar_style!' => ['style-switch'], |
| 235 | ], |
| 236 | 'selectors' => [ |
| 237 | '{{WRAPPER}} .skillbar-group .skill-bar' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 238 | ], |
| 239 | ] |
| 240 | ); |
| 241 | |
| 242 | $this->add_responsive_control( |
| 243 | 'ekit_progressbar_bar_margin', |
| 244 | [ |
| 245 | 'label' => esc_html__( 'Margin Bottom', 'elementskit-lite' ), |
| 246 | 'type' => Controls_Manager::SLIDER, |
| 247 | 'size_units' => ['px', 'em'], |
| 248 | 'selectors' => [ |
| 249 | '{{WRAPPER}} .skillbar-group .skill-bar' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 250 | ], |
| 251 | |
| 252 | ] |
| 253 | ); |
| 254 | |
| 255 | $this->end_controls_section(); |
| 256 | |
| 257 | |
| 258 | // Track Styles |
| 259 | $this->start_controls_section( |
| 260 | 'ekit_progressbar_track_style', [ |
| 261 | 'label' =>esc_html__( 'Track', 'elementskit-lite' ), |
| 262 | 'tab' => Controls_Manager::TAB_STYLE, |
| 263 | ] |
| 264 | ); |
| 265 | |
| 266 | $this->add_group_control( |
| 267 | Group_Control_Background::get_type(), |
| 268 | [ |
| 269 | 'name' => 'ekit_progressbar_track_color', |
| 270 | 'label' => esc_html__( 'Track Color', 'elementskit-lite' ), |
| 271 | 'types' => [ 'classic', 'gradient' ], |
| 272 | |
| 273 | 'condition' => [ |
| 274 | 'ekit_progressbar_style!' => ['style-stripe skill-medium tooltip-style'], |
| 275 | ], |
| 276 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-track', |
| 277 | ] |
| 278 | ); |
| 279 | //ekit_progressbar_style style-stripe skill-medium tooltip-style |
| 280 | $this->add_responsive_control( |
| 281 | 'ekit_progressbar_strip_color', [ |
| 282 | 'label' => esc_html__( 'Stripe Color', 'elementskit-lite' ), |
| 283 | 'type' => Controls_Manager::COLOR, |
| 284 | 'condition' => [ |
| 285 | 'ekit_progressbar_style' => ['style-stripe skill-medium tooltip-style'], |
| 286 | ], |
| 287 | 'selectors' => [ |
| 288 | '{{WRAPPER}} .style-stripe .single-skill-bar .skill-track' => 'background: repeating-linear-gradient(to right, {{VALUE}}, {{VALUE}} 4px, #FFFFFF 4px, #FFFFFF 8px);', |
| 289 | ], |
| 290 | |
| 291 | ] |
| 292 | ); |
| 293 | |
| 294 | $this->add_responsive_control( |
| 295 | 'ekit_progressbar_switch_color', [ |
| 296 | 'label' => esc_html__( 'Switch Color', 'elementskit-lite' ), |
| 297 | 'type' => Controls_Manager::COLOR, |
| 298 | 'condition' => [ |
| 299 | 'ekit_progressbar_style' => ['style-switch'], |
| 300 | ], |
| 301 | 'selectors' => [ |
| 302 | '{{WRAPPER}} .skillbar-group .single-skill-bar .skill-track:before' => 'border-color: {{VALUE}};', |
| 303 | '{{WRAPPER}} .skillbar-group .single-skill-bar .skill-track:after' => 'color: {{VALUE}};' |
| 304 | ], |
| 305 | ] |
| 306 | ); |
| 307 | |
| 308 | $this->add_group_control( |
| 309 | Group_Control_Box_Shadow::get_type(), |
| 310 | [ |
| 311 | 'name' => 'ekit_progressbar_track_shadow', |
| 312 | 'label' => esc_html__( 'Shadow', 'elementskit-lite' ), |
| 313 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-track', |
| 314 | ] |
| 315 | ); |
| 316 | |
| 317 | $this->add_responsive_control( |
| 318 | 'ekit_progressbar_track_radius', |
| 319 | [ |
| 320 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 321 | 'type' => Controls_Manager::DIMENSIONS, |
| 322 | 'size_units' => [ 'px', '%', 'em' ], |
| 323 | 'selectors' => [ |
| 324 | '{{WRAPPER}} .skillbar-group .skill-track' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 325 | ], |
| 326 | ] |
| 327 | ); |
| 328 | |
| 329 | $this->end_controls_section(); |
| 330 | |
| 331 | |
| 332 | // Title Styles |
| 333 | $this->start_controls_section( |
| 334 | 'ekit_progressbar_title_style', [ |
| 335 | 'label' =>esc_html__( 'Title', 'elementskit-lite' ), |
| 336 | 'tab' => Controls_Manager::TAB_STYLE, |
| 337 | ] |
| 338 | ); |
| 339 | |
| 340 | $this->add_responsive_control( |
| 341 | 'ekit_progressbar_title_color', [ |
| 342 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 343 | 'type' => Controls_Manager::COLOR, |
| 344 | 'selectors' => [ |
| 345 | '{{WRAPPER}} .skillbar-group .skill-title' => 'color: {{VALUE}};' |
| 346 | ], |
| 347 | ] |
| 348 | ); |
| 349 | |
| 350 | $this->add_group_control( |
| 351 | Group_Control_Typography::get_type(), [ |
| 352 | 'name' => 'ekit_progressbar_title_typography', |
| 353 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-title', |
| 354 | ] |
| 355 | ); |
| 356 | |
| 357 | $this->add_group_control( |
| 358 | Group_Control_Text_Shadow::get_type(), [ |
| 359 | 'name' => 'ekit_progressbar_title_shadow', |
| 360 | 'selector' => '{{WRAPPER}} .skillbar-group .skill-title', |
| 361 | ] |
| 362 | ); |
| 363 | |
| 364 | $this->add_responsive_control( |
| 365 | 'ekit_progressbar_margin_bottom', |
| 366 | [ |
| 367 | 'type' => Controls_Manager::SLIDER, |
| 368 | 'label' => esc_html__( 'Margin Bottom', 'elementskit-lite' ), |
| 369 | 'size_units' => ['px'], |
| 370 | 'range' => [ |
| 371 | 'px' => [ |
| 372 | 'min' => 1, |
| 373 | 'max' => 100, |
| 374 | ], |
| 375 | ], |
| 376 | 'selectors' => [ |
| 377 | '{{WRAPPER}} .skill-bar-content' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 378 | ], |
| 379 | ] |
| 380 | ); |
| 381 | |
| 382 | $this->end_controls_section(); |
| 383 | |
| 384 | |
| 385 | // Percent Styles |
| 386 | $this->start_controls_section( |
| 387 | 'ekit_progressbar_percent_style', [ |
| 388 | 'label' =>esc_html__( 'Percent', 'elementskit-lite' ), |
| 389 | 'tab' => Controls_Manager::TAB_STYLE, |
| 390 | ] |
| 391 | ); |
| 392 | |
| 393 | $this->add_responsive_control( |
| 394 | 'ekit_progressbar_percent_color', [ |
| 395 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 396 | 'type' => Controls_Manager::COLOR, |
| 397 | 'selectors' => [ |
| 398 | '{{WRAPPER}} .skillbar-group .number-percentage-wraper' => 'color: {{VALUE}};' |
| 399 | ], |
| 400 | ] |
| 401 | ); |
| 402 | |
| 403 | $this->add_group_control( |
| 404 | Group_Control_Typography::get_type(), [ |
| 405 | 'name' => 'ekit_progressbar_percent_typography', |
| 406 | 'selector' => '{{WRAPPER}} .skillbar-group .number-percentage-wraper', |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | $this->add_responsive_control( |
| 411 | 'ekit_progressbar_percent_tooltip_bg', [ |
| 412 | 'label' => esc_html__( 'Background Color', 'elementskit-lite' ), |
| 413 | 'type' => Controls_Manager::COLOR, |
| 414 | 'condition' => [ |
| 415 | 'ekit_progressbar_style' => ['tooltip-style', 'style-stripe skill-medium tooltip-style'], |
| 416 | ], |
| 417 | 'selectors' => [ |
| 418 | '{{WRAPPER}} .skillbar-group .single-skill-bar .svg-content > svg' => 'fill: {{VALUE}};' |
| 419 | ], |
| 420 | ] |
| 421 | ); |
| 422 | |
| 423 | $this->add_responsive_control( |
| 424 | 'ekit_progressbar_percent_pin_bg', [ |
| 425 | 'label' => esc_html__( 'Background Color', 'elementskit-lite' ), |
| 426 | 'type' => Controls_Manager::COLOR, |
| 427 | 'condition' => [ |
| 428 | 'ekit_progressbar_style' => ['style-ribbon', 'pin-style', 'tooltip-style2', 'tooltip-style3'], |
| 429 | ], |
| 430 | 'selectors' => [ |
| 431 | '{{WRAPPER}} .skillbar-group .single-skill-bar .number-percentage-wraper, |
| 432 | {{WRAPPER}} .skillbar-group.pin-style .single-skill-bar .number-percentage-wraper:before' => 'background-color: {{VALUE}};', |
| 433 | '{{WRAPPER}} .skillbar-group .single-skill-bar .number-percentage-wraper:before' => 'color: {{VALUE}};', |
| 434 | ], |
| 435 | ] |
| 436 | ); |
| 437 | |
| 438 | $this->add_group_control( |
| 439 | Group_Control_Text_Shadow::get_type(), [ |
| 440 | 'name' => 'ekit_progressbar_percent_shadow', |
| 441 | 'selector' => '{{WRAPPER}} .skillbar-group .number-percentage-wraper', |
| 442 | ] |
| 443 | ); |
| 444 | |
| 445 | $this->end_controls_section(); |
| 446 | |
| 447 | // Icon Styles |
| 448 | $this->start_controls_section( |
| 449 | 'ekit_progressbar_icon_style', [ |
| 450 | 'label' => esc_html__( 'Icon', 'elementskit-lite' ), |
| 451 | 'tab' => Controls_Manager::TAB_STYLE, |
| 452 | 'condition' => [ |
| 453 | 'ekit_progressbar_style!' => '', |
| 454 | 'ekit_progressbar_style' => 'inner-content skill-big' |
| 455 | ] |
| 456 | ] |
| 457 | ); |
| 458 | |
| 459 | $this->add_responsive_control( |
| 460 | 'ekit_progressbar_icon_color', [ |
| 461 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 462 | 'type' => Controls_Manager::COLOR, |
| 463 | 'selectors' => [ |
| 464 | '{{WRAPPER}} .skillbar-group .skill-track > span i' => 'color: {{VALUE}};', |
| 465 | '{{WRAPPER}} .skillbar-group .skill-track > span svg path' => 'stroke: {{VALUE}}; fill: {{VALUE}};', |
| 466 | ], |
| 467 | ] |
| 468 | ); |
| 469 | $this->add_responsive_control( |
| 470 | 'ekit_progressbar_icon_typography', |
| 471 | [ |
| 472 | 'type' => Controls_Manager::SLIDER, |
| 473 | 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ), |
| 474 | 'size_units' => ['px', 'em'], |
| 475 | 'range' => [ |
| 476 | 'px' => [ |
| 477 | 'min' => 1, |
| 478 | 'max' => 200, |
| 479 | ], |
| 480 | ], |
| 481 | 'default' => ['unit' => 'px', 'size' => '15'], |
| 482 | 'selectors' => [ |
| 483 | '{{WRAPPER}} .skillbar-group .skill-track > span i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 484 | '{{WRAPPER}} .skillbar-group .skill-track > span svg' => 'max-width: {{SIZE}}{{UNIT}};', |
| 485 | ], |
| 486 | ] |
| 487 | ); |
| 488 | |
| 489 | $this->end_controls_section(); |
| 490 | |
| 491 | $this->insert_pro_message(); |
| 492 | } |
| 493 | |
| 494 | protected function render( ) { |
| 495 | echo '<div class="ekit-wid-con" >'; |
| 496 | $this->render_raw(); |
| 497 | echo '</div>'; |
| 498 | } |
| 499 | |
| 500 | protected function render_raw( ) { |
| 501 | $settings = $this->get_settings_for_display(); |
| 502 | extract($settings); |
| 503 | |
| 504 | ?> |
| 505 | <div class="waypoint-tigger"> |
| 506 | <div class="skillbar-group <?php echo esc_attr( $ekit_progressbar_style ); ?>" data-progress-bar=""> |
| 507 | <div class="single-skill-bar"> |
| 508 | <?php if ( 'style-switch' != $ekit_progressbar_style ): ?> |
| 509 | <div class="skill-bar-content"> |
| 510 | <span class="skill-title"><?php echo esc_html( $ekit_progressbar_title ); ?></span> |
| 511 | </div><!-- .skill-bar-content END --> |
| 512 | <div class="skill-bar"> |
| 513 | <div class="skill-track"> |
| 514 | <?php if ( 'inner-content skill-big' == $ekit_progressbar_style ): |
| 515 | |
| 516 | // new icon |
| 517 | $migrated = isset( $settings['__fa4_migrated']['ekit_progressbar_icons'] ); |
| 518 | // Check if its a new widget without previously selected icon using the old Icon control |
| 519 | $is_new = empty( $settings['ekit_progressbar_icon'] ); |
| 520 | ?> |
| 521 | |
| 522 | <span class="skill-track-icon" > |
| 523 | <?php |
| 524 | // new icon |
| 525 | $migrated = isset( $settings['__fa4_migrated']['ekit_progressbar_icons'] ); |
| 526 | // Check if its a new widget without previously selected icon using the old Icon control |
| 527 | $is_new = empty( $settings['ekit_progressbar_icon'] ); |
| 528 | if ( $is_new || $migrated ) { |
| 529 | // new icon |
| 530 | Icons_Manager::render_icon( $settings['ekit_progressbar_icons'], [ 'aria-hidden' => 'true' ] ); |
| 531 | } else { |
| 532 | ?> |
| 533 | <i class="<?php echo esc_attr($settings['ekit_progressbar_icon']); ?>" aria-hidden="true"></i> |
| 534 | <?php |
| 535 | } |
| 536 | ?> |
| 537 | </span> |
| 538 | <?php endif; ?> |
| 539 | |
| 540 | <div class="number-percentage-wraper"> |
| 541 | <span class="number-percentage" data-value="<?php echo esc_attr( $ekit_progressbar_percentage ); ?>" data-animation-duration="<?php echo esc_attr( $ekit_progressbar_data_duration['size'] ); ?>">0</span>% |
| 542 | |
| 543 | <?php if ( 'tooltip-style' == $ekit_progressbar_style ): ?> |
| 544 | <div class="svg-content"> |
| 545 | <svg version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" preserveAspectRatio="none" viewBox="0 0 116 79.6"> <g> <path d="M0,18.3v21.3C0,49.8,8.2,58,18.3,58h5.9c7.8,0,15.3,3.1,20.8,8.6l13,13l13-13c5.5-5.5,13-8.6,20.8-8.6h5.9 c10.1,0,18.3-8.2,18.3-18.3V18.3C116,8.2,107.8,0,97.7,0H18.3C8.2,0,0,8.2,0,18.3z"/></g></svg> |
| 546 | </div> |
| 547 | <?php elseif( 'style-stripe skill-medium tooltip-style' == $ekit_progressbar_style ): ?> |
| 548 | <div class="svg-content"> |
| 549 | <svg version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink" preserveAspectRatio="none" viewBox="0 0 116 79.6"> <g> <path d="M0,18.3v21.3C0,49.8,8.2,58,18.3,58h5.9c7.8,0,15.3,3.1,20.8,8.6l13,13l13-13c5.5-5.5,13-8.6,20.8-8.6h5.9 c10.1,0,18.3-8.2,18.3-18.3V18.3C116,8.2,107.8,0,97.7,0H18.3C8.2,0,0,8.2,0,18.3z"/></g></svg> |
| 550 | </div> |
| 551 | <?php endif; ?> |
| 552 | </div> |
| 553 | </div> |
| 554 | </div><!-- .skill-bar END --> |
| 555 | <?php else: ?> |
| 556 | <div class="content-group"> |
| 557 | <div class="skill-bar-content"> |
| 558 | <span class="skill-title"><?php echo esc_html( $ekit_progressbar_title ); ?></span> |
| 559 | </div><!-- .skill-bar-content END --> |
| 560 | <div class="skill-bar"> |
| 561 | <div class="skill-track"></div> |
| 562 | </div><!-- .skill-bar END --> |
| 563 | </div> |
| 564 | <span class="number-percentage-wraper"> |
| 565 | <span class="number-percentage" data-value="<?php echo esc_attr( $ekit_progressbar_percentage ); ?>" data-animation-duration="<?php echo esc_attr( $ekit_progressbar_data_duration['size'] ); ?>">0</span>% |
| 566 | </span> |
| 567 | <?php endif; ?> |
| 568 | </div><!-- .single-skill-bar END --> |
| 569 | </div><!-- .skillbar-group END --> |
| 570 | </div> |
| 571 | <?php |
| 572 | } |
| 573 | } |
| 574 |