theme-elements
6 months ago
accordion.php
6 months ago
audio.php
6 months ago
before-after.php
6 months ago
button.php
6 months ago
carousel-navigation.php
6 months ago
circle-chart.php
6 months ago
contact-box.php
6 months ago
contact-form.php
6 months ago
custom-list.php
6 months ago
divider.php
6 months ago
gallery.php
6 months ago
gmap.php
6 months ago
heading-modern.php
6 months ago
icon.php
6 months ago
image.php
6 months ago
mailchimp.php
6 months ago
modern-button.php
6 months ago
products-grid.php
6 months ago
quote.php
6 months ago
recent-comments.php
6 months ago
recent-posts-grid-carousel.php
6 months ago
recent-posts-land-style.php
6 months ago
recent-posts-masonry.php
6 months ago
recent-posts-tiles-carousel.php
6 months ago
recent-posts-tiles.php
6 months ago
recent-posts-timeline.php
6 months ago
recent-products.php
6 months ago
responsive-table.php
6 months ago
search.php
6 months ago
staff.php
6 months ago
svg.php
6 months ago
tabs.php
6 months ago
testimonial.php
6 months ago
text.php
6 months ago
touch-slider.php
6 months ago
video.php
6 months ago
staff.php
994 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Image_Size; |
| 8 | use Elementor\Group_Control_Typography; |
| 9 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 10 | use Elementor\Utils; |
| 11 | use Elementor\Group_Control_Border; |
| 12 | |
| 13 | |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; // Exit if accessed directly. |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Elementor 'Staff' widget. |
| 20 | * |
| 21 | * Elementor widget that displays an 'Staff' with lightbox. |
| 22 | * |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class Staff extends Widget_Base { |
| 26 | |
| 27 | /** |
| 28 | * Get widget name. |
| 29 | * |
| 30 | * Retrieve 'Staff' widget name. |
| 31 | * |
| 32 | * @since 1.0.0 |
| 33 | * @access public |
| 34 | * |
| 35 | * @return string Widget name. |
| 36 | */ |
| 37 | public function get_name() { |
| 38 | return 'aux_staff'; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Get widget title. |
| 43 | * |
| 44 | * Retrieve 'Staff' widget title. |
| 45 | * |
| 46 | * @since 1.0.0 |
| 47 | * @access public |
| 48 | * |
| 49 | * @return string Widget title. |
| 50 | */ |
| 51 | public function get_title() { |
| 52 | return __('Staff', 'auxin-elements' ); |
| 53 | } |
| 54 | |
| 55 | public function has_widget_inner_wrapper(): bool { |
| 56 | return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /** |
| 61 | * Get widget icon. |
| 62 | * |
| 63 | * Retrieve 'Staff' widget icon. |
| 64 | * |
| 65 | * @since 1.0.0 |
| 66 | * @access public |
| 67 | * |
| 68 | * @return string Widget icon. |
| 69 | */ |
| 70 | public function get_icon() { |
| 71 | return 'eicon-person auxin-badge'; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Get widget categories. |
| 76 | * |
| 77 | * Retrieve 'Staff' widget icon. |
| 78 | * |
| 79 | * @since 1.0.0 |
| 80 | * @access public |
| 81 | * |
| 82 | * @return string Widget icon. |
| 83 | */ |
| 84 | public function get_categories() { |
| 85 | return array( 'auxin-core' ); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Register 'Staff' widget controls. |
| 90 | * |
| 91 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 92 | * |
| 93 | * @since 1.0.0 |
| 94 | * @access protected |
| 95 | */ |
| 96 | protected function register_controls() { |
| 97 | |
| 98 | /*-----------------------------------------------------------------------------------*/ |
| 99 | /* content_section |
| 100 | /*-----------------------------------------------------------------------------------*/ |
| 101 | |
| 102 | $this->start_controls_section( |
| 103 | 'content_section', |
| 104 | array( |
| 105 | 'label' => __('Content', 'auxin-elements' ), |
| 106 | ) |
| 107 | ); |
| 108 | |
| 109 | $this->add_control( |
| 110 | 'title', |
| 111 | array( |
| 112 | 'label' => __('Staff Name','auxin-elements' ), |
| 113 | 'description' => __('Text title, leave it empty if you don`t need title.', 'auxin-elements'), |
| 114 | 'type' => Controls_Manager::TEXT, |
| 115 | 'default' => 'John Doe' |
| 116 | ) |
| 117 | ); |
| 118 | |
| 119 | $this->add_control( |
| 120 | 'subtitle', |
| 121 | array( |
| 122 | 'label' => __('Staff Occupation','auxin-elements' ), |
| 123 | 'type' => Controls_Manager::TEXT, |
| 124 | 'default' => 'Manager' |
| 125 | ) |
| 126 | ); |
| 127 | |
| 128 | $this->add_control( |
| 129 | 'staff_link', |
| 130 | array( |
| 131 | 'label' => __('Staff Page Link','auxin-elements' ), |
| 132 | 'type' => Controls_Manager::URL, |
| 133 | 'placeholder' => 'https://your-link.com', |
| 134 | 'show_external' => false, |
| 135 | 'dynamic' => [ |
| 136 | 'active' => true |
| 137 | ] |
| 138 | ) |
| 139 | ); |
| 140 | |
| 141 | |
| 142 | $this->add_control( |
| 143 | 'content', |
| 144 | array( |
| 145 | 'label' => __('Content','auxin-elements'), |
| 146 | 'description' => __('Enter a text as a text content.','auxin-elements'), |
| 147 | 'type' => Controls_Manager::TEXTAREA |
| 148 | ) |
| 149 | ); |
| 150 | |
| 151 | $this->add_control( |
| 152 | 'max_words', |
| 153 | array( |
| 154 | 'label' => __('Maximum Words','auxin-elements' ), |
| 155 | 'description' => __('Limit the number of words in the Content','auxin-elements' ), |
| 156 | 'type' => Controls_Manager::NUMBER, |
| 157 | 'default' => '', |
| 158 | 'step' => 1, |
| 159 | 'condition' => array( |
| 160 | 'content!' => '', |
| 161 | ) |
| 162 | ) |
| 163 | ); |
| 164 | |
| 165 | $this->end_controls_section(); |
| 166 | |
| 167 | /*-----------------------------------------------------------------------------------*/ |
| 168 | /* image_section |
| 169 | /*-----------------------------------------------------------------------------------*/ |
| 170 | |
| 171 | $this->start_controls_section( |
| 172 | 'image_section', |
| 173 | array( |
| 174 | 'label' => __('Image', 'auxin-elements' ), |
| 175 | ) |
| 176 | ); |
| 177 | |
| 178 | $this->add_control( |
| 179 | 'staff_img', |
| 180 | array( |
| 181 | 'label' => __('Image','auxin-elements' ), |
| 182 | 'type' => Controls_Manager::MEDIA, |
| 183 | 'default' => array( |
| 184 | 'url' => Utils::get_placeholder_image_src() |
| 185 | ), |
| 186 | ) |
| 187 | ); |
| 188 | |
| 189 | $this->add_group_control( |
| 190 | Group_Control_Image_Size::get_type(), |
| 191 | array( |
| 192 | 'name' => 'staff_img', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. |
| 193 | 'separator' => 'none', |
| 194 | 'default' => 'full' |
| 195 | ) |
| 196 | ); |
| 197 | |
| 198 | $this->add_control( |
| 199 | 'img_shape', |
| 200 | array( |
| 201 | 'label' => __('Image shape','auxin-elements'), |
| 202 | 'type' => 'aux-visual-select', |
| 203 | 'options' => array( |
| 204 | 'circle' => array( |
| 205 | 'label' => __('Circle', 'auxin-elements'), |
| 206 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-circle.svg' |
| 207 | ), |
| 208 | 'semi-circle' => array( |
| 209 | 'label' => __('Semi-circle', 'auxin-elements'), |
| 210 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-semi-circle.svg' |
| 211 | ), |
| 212 | 'round-rect' => array( |
| 213 | 'label' => __('Round Rectangle', 'auxin-elements'), |
| 214 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-round-rectangle.svg' |
| 215 | ), |
| 216 | 'rect' => array( |
| 217 | 'label' => __('Rectangle', 'auxin-elements'), |
| 218 | 'image' => AUXIN_URL . 'images/visual-select/icon-style-rectangle.svg' |
| 219 | ) |
| 220 | ), |
| 221 | 'default' => 'circle' |
| 222 | ) |
| 223 | ); |
| 224 | |
| 225 | $this->add_control( |
| 226 | 'preloadable', |
| 227 | array( |
| 228 | 'label' => __('Preload image','auxin-elements' ), |
| 229 | 'type' => Controls_Manager::SWITCHER, |
| 230 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 231 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 232 | 'return_value' => 'yes', |
| 233 | 'default' => 'no' |
| 234 | ) |
| 235 | ); |
| 236 | |
| 237 | $this->add_control( |
| 238 | 'preload_preview', |
| 239 | array( |
| 240 | 'label' => __('While loading image display','auxin-elements' ), |
| 241 | 'label_block' => true, |
| 242 | 'type' => Controls_Manager::SELECT, |
| 243 | 'options' => auxin_get_preloadable_previews(), |
| 244 | 'return_value' => 'yes', |
| 245 | 'default' => 'yes', |
| 246 | 'condition' => array( |
| 247 | 'preloadable' => 'yes' |
| 248 | ) |
| 249 | ) |
| 250 | ); |
| 251 | |
| 252 | $this->add_control( |
| 253 | 'preload_bgcolor', |
| 254 | array( |
| 255 | 'label' => __( 'Placeholder color while loading image', 'auxin-elements' ), |
| 256 | 'type' => Controls_Manager::COLOR, |
| 257 | 'condition' => array( |
| 258 | 'preloadable' => 'yes', |
| 259 | 'preload_preview' => array('simple-spinner', 'simple-spinner-light', 'simple-spinner-dark') |
| 260 | ) |
| 261 | ) |
| 262 | ); |
| 263 | |
| 264 | $this->end_controls_section(); |
| 265 | |
| 266 | /*-----------------------------------------------------------------------------------*/ |
| 267 | /* social_section |
| 268 | /*-----------------------------------------------------------------------------------*/ |
| 269 | |
| 270 | $this->start_controls_section( |
| 271 | 'social_section', |
| 272 | array( |
| 273 | 'label' => __('Social', 'auxin-elements' ), |
| 274 | ) |
| 275 | ); |
| 276 | |
| 277 | $this->add_control( |
| 278 | 'socials', |
| 279 | array( |
| 280 | 'label' => __('Enable Socials','auxin-elements' ), |
| 281 | 'type' => Controls_Manager::SWITCHER, |
| 282 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 283 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 284 | 'default' => 'no' |
| 285 | ) |
| 286 | ); |
| 287 | |
| 288 | $this->add_control( |
| 289 | 'social_twitter', |
| 290 | array( |
| 291 | 'label' => __('Twitter Address','auxin-elements' ), |
| 292 | 'type' => Controls_Manager::URL, |
| 293 | 'placeholder' => 'https://your-link.com', |
| 294 | 'show_external' => false, |
| 295 | 'condition' => [ |
| 296 | 'socials' => 'yes' |
| 297 | ], |
| 298 | 'dynamic' => [ |
| 299 | 'active' => true |
| 300 | ] |
| 301 | ) |
| 302 | ); |
| 303 | |
| 304 | $this->add_control( |
| 305 | 'social_facebook', |
| 306 | array( |
| 307 | 'label' => __('Facebook Address','auxin-elements' ), |
| 308 | 'type' => Controls_Manager::URL, |
| 309 | 'placeholder' => 'https://your-link.com', |
| 310 | 'show_external' => false, |
| 311 | 'condition' => [ |
| 312 | 'socials' => 'yes' |
| 313 | ], |
| 314 | 'dynamic' => [ |
| 315 | 'active' => true |
| 316 | ] |
| 317 | ) |
| 318 | ); |
| 319 | |
| 320 | $this->add_control( |
| 321 | 'social_gp', |
| 322 | array( |
| 323 | 'label' => __('Google Plus Address','auxin-elements' ), |
| 324 | 'type' => Controls_Manager::URL, |
| 325 | 'placeholder' => 'https://your-link.com', |
| 326 | 'show_external' => false, |
| 327 | 'condition' => [ |
| 328 | 'socials' => 'yes' |
| 329 | ], |
| 330 | 'dynamic' => [ |
| 331 | 'active' => true |
| 332 | ] |
| 333 | ) |
| 334 | ); |
| 335 | |
| 336 | $this->add_control( |
| 337 | 'social_flickr', |
| 338 | array( |
| 339 | 'label' => __('Flickr Address','auxin-elements' ), |
| 340 | 'type' => Controls_Manager::URL, |
| 341 | 'placeholder' => 'https://your-link.com', |
| 342 | 'show_external' => false, |
| 343 | 'condition' => [ |
| 344 | 'socials' => 'yes' |
| 345 | ], |
| 346 | 'dynamic' => [ |
| 347 | 'active' => true |
| 348 | ] |
| 349 | ) |
| 350 | ); |
| 351 | |
| 352 | $this->add_control( |
| 353 | 'social_delicious', |
| 354 | array( |
| 355 | 'label' => __('Delicious Address','auxin-elements' ), |
| 356 | 'type' => Controls_Manager::URL, |
| 357 | 'placeholder' => 'https://your-link.com', |
| 358 | 'show_external' => false, |
| 359 | 'condition' => [ |
| 360 | 'socials' => 'yes' |
| 361 | ], |
| 362 | 'dynamic' => [ |
| 363 | 'active' => true |
| 364 | ] |
| 365 | ) |
| 366 | ); |
| 367 | |
| 368 | $this->add_control( |
| 369 | 'social_pinterest', |
| 370 | array( |
| 371 | 'label' => __('Pinterest Address','auxin-elements' ), |
| 372 | 'type' => Controls_Manager::URL, |
| 373 | 'placeholder' => 'https://your-link.com', |
| 374 | 'show_external' => false, |
| 375 | 'condition' => [ |
| 376 | 'socials' => 'yes' |
| 377 | ], |
| 378 | 'dynamic' => [ |
| 379 | 'active' => true |
| 380 | ] |
| 381 | ) |
| 382 | ); |
| 383 | |
| 384 | $this->add_control( |
| 385 | 'social_github', |
| 386 | array( |
| 387 | 'label' => __('GitHub Address','auxin-elements' ), |
| 388 | 'type' => Controls_Manager::URL, |
| 389 | 'placeholder' => 'https://your-link.com', |
| 390 | 'show_external' => false, |
| 391 | 'condition' => [ |
| 392 | 'socials' => 'yes' |
| 393 | ], |
| 394 | 'dynamic' => [ |
| 395 | 'active' => true |
| 396 | ] |
| 397 | ) |
| 398 | ); |
| 399 | |
| 400 | $this->add_control( |
| 401 | 'social_instagram', |
| 402 | array( |
| 403 | 'label' => __('Instagram Address','auxin-elements' ), |
| 404 | 'type' => Controls_Manager::URL, |
| 405 | 'placeholder' => 'https://your-link.com', |
| 406 | 'show_external' => false, |
| 407 | 'condition' => [ |
| 408 | 'socials' => 'yes' |
| 409 | ], |
| 410 | 'dynamic' => [ |
| 411 | 'active' => true |
| 412 | ] |
| 413 | ) |
| 414 | ); |
| 415 | |
| 416 | $this->add_control( |
| 417 | 'social_dribbble', |
| 418 | array( |
| 419 | 'label' => __('Dribbble Address','auxin-elements' ), |
| 420 | 'type' => Controls_Manager::URL, |
| 421 | 'placeholder' => 'https://your-link.com', |
| 422 | 'show_external' => false, |
| 423 | 'condition' => [ |
| 424 | 'socials' => 'yes' |
| 425 | ], |
| 426 | 'dynamic' => [ |
| 427 | 'active' => true |
| 428 | ] |
| 429 | ) |
| 430 | ); |
| 431 | |
| 432 | $this->add_control( |
| 433 | 'social_linkedin', |
| 434 | array( |
| 435 | 'label' => __('LinkedIn Address','auxin-elements' ), |
| 436 | 'type' => Controls_Manager::URL, |
| 437 | 'placeholder' => 'https://your-link.com', |
| 438 | 'show_external' => false, |
| 439 | 'condition' => [ |
| 440 | 'socials' => 'yes' |
| 441 | ], |
| 442 | 'dynamic' => [ |
| 443 | 'active' => true |
| 444 | ] |
| 445 | ) |
| 446 | ); |
| 447 | |
| 448 | $this->end_controls_section(); |
| 449 | |
| 450 | /*-----------------------------------------------------------------------------------*/ |
| 451 | /* title_style_section |
| 452 | /*-----------------------------------------------------------------------------------*/ |
| 453 | |
| 454 | $this->start_controls_section( |
| 455 | 'title_style_section', |
| 456 | array( |
| 457 | 'label' => __( 'Title', 'auxin-elements' ), |
| 458 | 'tab' => Controls_Manager::TAB_STYLE, |
| 459 | 'condition' => array( |
| 460 | 'title!' => '', |
| 461 | ), |
| 462 | ) |
| 463 | ); |
| 464 | |
| 465 | $this->start_controls_tabs( 'title_colors' ); |
| 466 | |
| 467 | $this->start_controls_tab( |
| 468 | 'title_color_normal', |
| 469 | array( |
| 470 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 471 | 'condition' => array( |
| 472 | 'title!' => '', |
| 473 | ), |
| 474 | ) |
| 475 | ); |
| 476 | |
| 477 | $this->add_control( |
| 478 | 'title_color', |
| 479 | array( |
| 480 | 'label' => __( 'Color', 'auxin-elements' ), |
| 481 | 'type' => Controls_Manager::COLOR, |
| 482 | 'selectors' => array( |
| 483 | '{{WRAPPER}} .col-title a, {{WRAPPER}} .col-title' => 'color: {{VALUE}} !important;', |
| 484 | ), |
| 485 | 'condition' => array( |
| 486 | 'title!' => '', |
| 487 | ), |
| 488 | ) |
| 489 | ); |
| 490 | |
| 491 | $this->end_controls_tab(); |
| 492 | |
| 493 | $this->start_controls_tab( |
| 494 | 'title_color_hover', |
| 495 | array( |
| 496 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 497 | 'condition' => array( |
| 498 | 'title!' => '', |
| 499 | ), |
| 500 | ) |
| 501 | ); |
| 502 | |
| 503 | $this->add_control( |
| 504 | 'title_hover_color', |
| 505 | array( |
| 506 | 'label' => __( 'Color', 'auxin-elements' ), |
| 507 | 'type' => Controls_Manager::COLOR, |
| 508 | 'selectors' => array( |
| 509 | '{{WRAPPER}} .col-title a:hover' => 'color: {{VALUE}} !important;', |
| 510 | ), |
| 511 | 'condition' => array( |
| 512 | 'title!' => '', |
| 513 | ), |
| 514 | ) |
| 515 | ); |
| 516 | |
| 517 | $this->end_controls_tab(); |
| 518 | |
| 519 | $this->end_controls_tabs(); |
| 520 | |
| 521 | $this->add_group_control( |
| 522 | Group_Control_Typography::get_type(), |
| 523 | array( |
| 524 | 'name' => 'title_typography', |
| 525 | 'global' => [ |
| 526 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 527 | ], |
| 528 | 'selector' => '{{WRAPPER}} .col-title, {{WRAPPER}} .col-title a', |
| 529 | 'condition' => array( |
| 530 | 'title!' => '', |
| 531 | ), |
| 532 | ) |
| 533 | ); |
| 534 | |
| 535 | $this->add_responsive_control( |
| 536 | 'title_margin_top', |
| 537 | array( |
| 538 | 'label' => __( 'Top space', 'auxin-elements' ), |
| 539 | 'type' => Controls_Manager::SLIDER, |
| 540 | 'range' => array( |
| 541 | 'px' => array( |
| 542 | 'max' => 100, |
| 543 | ), |
| 544 | ), |
| 545 | 'selectors' => array( |
| 546 | '{{WRAPPER}} .aux-staff-content .col-title' => 'margin-top: {{SIZE}}{{UNIT}};', |
| 547 | ), |
| 548 | 'condition' => array( |
| 549 | 'title!' => '' |
| 550 | ) |
| 551 | ) |
| 552 | ); |
| 553 | |
| 554 | $this->add_responsive_control( |
| 555 | 'title_margin_bottom', |
| 556 | array( |
| 557 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 558 | 'type' => Controls_Manager::SLIDER, |
| 559 | 'range' => array( |
| 560 | 'px' => array( |
| 561 | 'max' => 100, |
| 562 | ), |
| 563 | ), |
| 564 | 'selectors' => array( |
| 565 | '{{WRAPPER}} .aux-staff-content .col-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 566 | ), |
| 567 | 'condition' => array( |
| 568 | 'title!' => '' |
| 569 | ) |
| 570 | ) |
| 571 | ); |
| 572 | |
| 573 | $this->end_controls_section(); |
| 574 | |
| 575 | /*-----------------------------------------------------------------------------------*/ |
| 576 | /* subtitle_style_section |
| 577 | /*-----------------------------------------------------------------------------------*/ |
| 578 | |
| 579 | $this->start_controls_section( |
| 580 | 'subtitle_style_section', |
| 581 | array( |
| 582 | 'label' => __( 'Subtitle', 'auxin-elements' ), |
| 583 | 'tab' => Controls_Manager::TAB_STYLE, |
| 584 | 'condition' => array( |
| 585 | 'subtitle!' => '', |
| 586 | ), |
| 587 | ) |
| 588 | ); |
| 589 | |
| 590 | $this->add_control( |
| 591 | 'subtitle_color', |
| 592 | array( |
| 593 | 'label' => __( 'Color', 'auxin-elements' ), |
| 594 | 'type' => Controls_Manager::COLOR, |
| 595 | 'selectors' => array( |
| 596 | '{{WRAPPER}} .col-subtitle' => 'color: {{VALUE}} !important;', |
| 597 | ), |
| 598 | 'condition' => array( |
| 599 | 'subtitle!' => '', |
| 600 | ), |
| 601 | ) |
| 602 | ); |
| 603 | |
| 604 | $this->add_group_control( |
| 605 | Group_Control_Typography::get_type(), |
| 606 | array( |
| 607 | 'name' => 'subtitle_typography', |
| 608 | 'global' => [ |
| 609 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 610 | ], |
| 611 | 'selector' => '{{WRAPPER}} .aux-staff-content .col-subtitle', |
| 612 | 'condition' => array( |
| 613 | 'subtitle!' => '', |
| 614 | ), |
| 615 | ) |
| 616 | ); |
| 617 | |
| 618 | $this->add_responsive_control( |
| 619 | 'subtitle_margin_bottom', |
| 620 | array( |
| 621 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 622 | 'type' => Controls_Manager::SLIDER, |
| 623 | 'range' => array( |
| 624 | 'px' => array( |
| 625 | 'max' => 100, |
| 626 | ), |
| 627 | ), |
| 628 | 'selectors' => array( |
| 629 | '{{WRAPPER}} .col-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 630 | ), |
| 631 | 'condition' => array( |
| 632 | 'subtitle!' => '', |
| 633 | ), |
| 634 | ) |
| 635 | ); |
| 636 | |
| 637 | $this->end_controls_section(); |
| 638 | |
| 639 | /*-----------------------------------------------------------------------------------*/ |
| 640 | /* content_style_section |
| 641 | /*-----------------------------------------------------------------------------------*/ |
| 642 | |
| 643 | $this->start_controls_section( |
| 644 | 'content_style_section', |
| 645 | array( |
| 646 | 'label' => __( 'Content', 'auxin-elements' ), |
| 647 | 'tab' => Controls_Manager::TAB_STYLE, |
| 648 | 'condition' => array( |
| 649 | 'content!' => '', |
| 650 | ), |
| 651 | ) |
| 652 | ); |
| 653 | |
| 654 | $this->add_control( |
| 655 | 'content_color', |
| 656 | array( |
| 657 | 'label' => __( 'Color', 'auxin-elements' ), |
| 658 | 'type' => Controls_Manager::COLOR, |
| 659 | 'selectors' => array( |
| 660 | '{{WRAPPER}} .entry-content' => 'color: {{VALUE}} !important;', |
| 661 | ), |
| 662 | 'condition' => array( |
| 663 | 'content!' => '', |
| 664 | ), |
| 665 | ) |
| 666 | ); |
| 667 | |
| 668 | $this->add_group_control( |
| 669 | Group_Control_Typography::get_type(), |
| 670 | array( |
| 671 | 'name' => 'content_typography', |
| 672 | 'global' => [ |
| 673 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 674 | ], |
| 675 | 'selector' => '{{WRAPPER}} .entry-content', |
| 676 | 'condition' => array( |
| 677 | 'content!' => '', |
| 678 | ), |
| 679 | ) |
| 680 | ); |
| 681 | |
| 682 | $this->add_responsive_control( |
| 683 | 'content_margin_bottom', |
| 684 | array( |
| 685 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 686 | 'type' => Controls_Manager::SLIDER, |
| 687 | 'range' => array( |
| 688 | 'px' => array( |
| 689 | 'max' => 100, |
| 690 | ), |
| 691 | ), |
| 692 | 'selectors' => array( |
| 693 | '{{WRAPPER}} .entry-content' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 694 | ), |
| 695 | 'condition' => array( |
| 696 | 'content!' => '', |
| 697 | ), |
| 698 | ) |
| 699 | ); |
| 700 | |
| 701 | $this->end_controls_section(); |
| 702 | |
| 703 | /*-----------------------------------------------------------------------------------*/ |
| 704 | /* content_style_section |
| 705 | /*-----------------------------------------------------------------------------------*/ |
| 706 | |
| 707 | $this->start_controls_section( |
| 708 | 'socials_style_section', |
| 709 | array( |
| 710 | 'label' => __( 'Socials', 'auxin-elements' ), |
| 711 | 'tab' => Controls_Manager::TAB_STYLE, |
| 712 | 'condition' => array( |
| 713 | 'socials' => 'yes' |
| 714 | ), |
| 715 | ) |
| 716 | ); |
| 717 | |
| 718 | $this->start_controls_tabs( 'socials_colors' ); |
| 719 | |
| 720 | $this->start_controls_tab( |
| 721 | 'socials_color_normal', |
| 722 | array( |
| 723 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 724 | 'condition' => array( |
| 725 | 'socials' => 'yes' |
| 726 | ), |
| 727 | ) |
| 728 | ); |
| 729 | |
| 730 | $this->add_control( |
| 731 | 'socials_color', |
| 732 | array( |
| 733 | 'label' => __( 'Color', 'auxin-elements' ), |
| 734 | 'type' => Controls_Manager::COLOR, |
| 735 | 'selectors' => array( |
| 736 | '{{WRAPPER}} .aux-social-list a' => 'color: {{VALUE}};', |
| 737 | ), |
| 738 | 'condition' => array( |
| 739 | 'socials' => 'yes' |
| 740 | ), |
| 741 | ) |
| 742 | ); |
| 743 | |
| 744 | $this->end_controls_tab(); |
| 745 | |
| 746 | $this->start_controls_tab( |
| 747 | 'socials_color_hover', |
| 748 | array( |
| 749 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 750 | 'condition' => array( |
| 751 | 'socials' => 'yes' |
| 752 | ), |
| 753 | ) |
| 754 | ); |
| 755 | |
| 756 | $this->add_control( |
| 757 | 'socials_hover_color', |
| 758 | array( |
| 759 | 'label' => __( 'Color', 'auxin-elements' ), |
| 760 | 'type' => Controls_Manager::COLOR, |
| 761 | 'selectors' => array( |
| 762 | '{{WRAPPER}} .aux-social-list a:hover' => 'color: {{VALUE}};', |
| 763 | ), |
| 764 | 'condition' => array( |
| 765 | 'socials' => 'yes' |
| 766 | ), |
| 767 | ) |
| 768 | ); |
| 769 | |
| 770 | $this->end_controls_tab(); |
| 771 | |
| 772 | $this->end_controls_tabs(); |
| 773 | |
| 774 | $this->add_control( |
| 775 | 'icon_align', |
| 776 | array( |
| 777 | 'label' => __('Icon Direction', 'auxin-elements'), |
| 778 | 'type' => Controls_Manager::SELECT, |
| 779 | 'default' => 'aux-horizontal', |
| 780 | 'options' => array( |
| 781 | 'aux-vertical' => __( 'Vertical' , 'auxin-elements' ), |
| 782 | 'aux-horizontal' => __( 'Horizontal' , 'auxin-elements' ), |
| 783 | ), |
| 784 | 'condition' => array( |
| 785 | 'socials' => 'yes' |
| 786 | ) |
| 787 | ) |
| 788 | ); |
| 789 | |
| 790 | |
| 791 | $this->add_control( |
| 792 | 'icon_size', |
| 793 | array( |
| 794 | 'label' => __('Socials Icon size', 'auxin-elements'), |
| 795 | 'type' => Controls_Manager::SELECT, |
| 796 | 'default' => 'aux-medium', |
| 797 | 'options' => array( |
| 798 | 'aux-small' => __( 'Small' , 'auxin-elements' ), |
| 799 | 'aux-medium' => __( 'Medium' , 'auxin-elements' ), |
| 800 | 'aux-large' => __( 'Large' , 'auxin-elements' ), |
| 801 | 'aux-extra-large' => __( 'X-Large' , 'auxin-elements' ) |
| 802 | ), |
| 803 | 'condition' => array( |
| 804 | 'socials' => 'yes' |
| 805 | ) |
| 806 | ) |
| 807 | ); |
| 808 | |
| 809 | $this->add_group_control( |
| 810 | Group_Control_Border::get_type(), |
| 811 | array( |
| 812 | 'name' => 'socials_separator', |
| 813 | 'label' => __( 'Separator', 'auxin-elements' ), |
| 814 | 'selector' => '{{WRAPPER}} .aux-widget-staff .aux-staff-footer', |
| 815 | ) |
| 816 | ); |
| 817 | |
| 818 | $this->add_responsive_control( |
| 819 | 'socials_padding', |
| 820 | array( |
| 821 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 822 | 'type' => Controls_Manager::DIMENSIONS, |
| 823 | 'size_units' => array( 'px', '%' ), |
| 824 | 'selectors' => array( |
| 825 | '{{WRAPPER}} .aux-widget-staff .aux-staff-footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 826 | ), |
| 827 | 'condition' => array( |
| 828 | 'socials' => 'yes' |
| 829 | ) |
| 830 | ) |
| 831 | ); |
| 832 | |
| 833 | $this->end_controls_section(); |
| 834 | |
| 835 | /*-----------------------------------------------------------------------------------*/ |
| 836 | /* Wrapper section |
| 837 | /*-----------------------------------------------------------------------------------*/ |
| 838 | |
| 839 | $this->start_controls_section( |
| 840 | 'wrapper_style_section', |
| 841 | array( |
| 842 | 'label' => __( 'Wrappers', 'auxin-elements' ), |
| 843 | 'tab' => Controls_Manager::TAB_STYLE, |
| 844 | 'condition' => array( |
| 845 | 'title!' => '', |
| 846 | ), |
| 847 | ) |
| 848 | ); |
| 849 | |
| 850 | $this->add_control( |
| 851 | 'layout_style', |
| 852 | array( |
| 853 | 'label' => __('Layout','auxin-elements'), |
| 854 | 'type' => 'aux-visual-select', |
| 855 | 'style_items' => 'max-width:31%;', |
| 856 | 'options' => array( |
| 857 | 'top' => array( |
| 858 | 'label' => __('Top', 'auxin-elements'), |
| 859 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-top.svg' |
| 860 | ), |
| 861 | 'right' => array( |
| 862 | 'label' => __('Right', 'auxin-elements'), |
| 863 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-right.svg' |
| 864 | ), |
| 865 | 'bottom' => array( |
| 866 | 'label' => __('Bottom', 'auxin-elements'), |
| 867 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-bottom.svg' |
| 868 | ), |
| 869 | 'left' => array( |
| 870 | 'label' => __('Left', 'auxin-elements'), |
| 871 | 'image' => AUXIN_URL . 'images/visual-select/column-icon-left.svg' |
| 872 | ) |
| 873 | ), |
| 874 | 'default' => 'top' |
| 875 | ) |
| 876 | ); |
| 877 | |
| 878 | $this->add_control( |
| 879 | 'text_align', |
| 880 | array( |
| 881 | 'label' => __('Text Align','auxin-elements'), |
| 882 | 'type' => Controls_Manager::CHOOSE, |
| 883 | 'options' => array( |
| 884 | 'left' => array( |
| 885 | 'title' => __( 'Left', 'auxin-elements' ), |
| 886 | 'icon' => 'eicon-text-align-left', |
| 887 | ), |
| 888 | 'center' => array( |
| 889 | 'title' => __( 'Center', 'auxin-elements' ), |
| 890 | 'icon' => 'eicon-text-align-center', |
| 891 | ), |
| 892 | 'right' => array( |
| 893 | 'title' => __( 'Right', 'auxin-elements' ), |
| 894 | 'icon' => 'eicon-text-align-right', |
| 895 | ), |
| 896 | ), |
| 897 | 'default' => 'left', |
| 898 | 'toggle' => true, |
| 899 | ) |
| 900 | ); |
| 901 | |
| 902 | $this->add_responsive_control( |
| 903 | 'wrapper_main_padding', |
| 904 | array( |
| 905 | 'label' => __( 'Padding for main wrapper', 'auxin-elements' ), |
| 906 | 'type' => Controls_Manager::DIMENSIONS, |
| 907 | 'size_units' => array( 'px', '%' ), |
| 908 | 'selectors' => array( |
| 909 | '{{WRAPPER}} .aux-widget-staff > div' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 910 | ) |
| 911 | ) |
| 912 | ); |
| 913 | |
| 914 | $this->add_responsive_control( |
| 915 | 'wrapper_content_padding', |
| 916 | array( |
| 917 | 'label' => __( 'Padding for content wrapper', 'auxin-elements' ), |
| 918 | 'type' => Controls_Manager::DIMENSIONS, |
| 919 | 'size_units' => array( 'px', '%' ), |
| 920 | 'selectors' => array( |
| 921 | '{{WRAPPER}} .aux-widget-staff .aux-staff-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 922 | ) |
| 923 | ) |
| 924 | ); |
| 925 | |
| 926 | $this->end_controls_section(); |
| 927 | } |
| 928 | |
| 929 | /** |
| 930 | * Render image box widget output on the frontend. |
| 931 | * |
| 932 | * Written in PHP and used to generate the final HTML. |
| 933 | * |
| 934 | * @since 1.0.0 |
| 935 | * @access protected |
| 936 | */ |
| 937 | protected function render() { |
| 938 | |
| 939 | $settings = $this->get_settings_for_display(); |
| 940 | |
| 941 | $width = !empty( $settings['staff_img_custom_dimension']['width'] ) ? $settings['staff_img_custom_dimension']['width'] : ''; |
| 942 | $height = !empty( $settings['staff_img_custom_dimension']['height'] ) ? $settings['staff_img_custom_dimension']['height'] : ''; |
| 943 | |
| 944 | $args = array( |
| 945 | 'title' => $settings['title'], |
| 946 | 'subtitle' => $settings['subtitle'], |
| 947 | 'staff_link' => $settings['staff_link']['url'], |
| 948 | 'content' => $settings['content'], |
| 949 | 'max_words' => $settings['max_words'], |
| 950 | 'width' => $width, |
| 951 | 'height' => $height, |
| 952 | |
| 953 | 'staff_img' => $settings['staff_img']['id'], |
| 954 | 'staff_img_size' => $settings['staff_img_size'], |
| 955 | 'img_shape' => $settings['img_shape'], |
| 956 | 'preloadable' => $settings['preloadable'], |
| 957 | 'preload_preview' => $settings['preload_preview'], |
| 958 | 'preload_bgcolor' => $settings['preload_bgcolor'], |
| 959 | |
| 960 | 'socials' => $settings['socials'], |
| 961 | |
| 962 | 'icon_size' => $settings['icon_size'], |
| 963 | 'icon_align' => $settings['icon_align'], |
| 964 | |
| 965 | 'wrapper_style' => 'simple', //$settings['wrapper_style'], |
| 966 | 'layout_style' => $settings['layout_style'], |
| 967 | //'wrapper_bg_color' => $settings['wrapper_bg_color'], |
| 968 | 'text_align' => $settings['text_align'], |
| 969 | ); |
| 970 | |
| 971 | if ( auxin_is_true( $settings['socials'] ) ) { |
| 972 | $socials = [ |
| 973 | 'social_twitter' , |
| 974 | 'social_facebook' , |
| 975 | 'social_gp' , |
| 976 | 'social_flickr' , |
| 977 | 'social_delicious', |
| 978 | 'social_pinterest', |
| 979 | 'social_github' , |
| 980 | 'social_instagram', |
| 981 | 'social_dribbble' , |
| 982 | 'social_linkedin' , |
| 983 | ]; |
| 984 | |
| 985 | foreach( $socials as $key => $social ) { |
| 986 | $args[ $social ] = $settings[ $social ]['url']; |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | echo auxin_widget_staff_callback( $args ); |
| 991 | } |
| 992 | |
| 993 | } |
| 994 |