Adv_Accordion.php
2 years ago
Adv_Tabs.php
2 years ago
Advanced_Data_Table.php
2 years ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
2 years ago
Betterdocs_Category_Grid.php
2 years ago
Betterdocs_Search_Form.php
2 years ago
Business_Reviews.php
2 years ago
Caldera_Forms.php
2 years ago
Career_Page.php
4 years ago
Contact_Form_7.php
2 years ago
Content_Ticker.php
2 years ago
Countdown.php
2 years ago
Creative_Button.php
2 years ago
Crowdfundly_All_Campaign.php
4 years ago
Crowdfundly_Organization.php
4 years ago
Crowdfundly_Single_Campaign.php
4 years ago
Cta_Box.php
2 years ago
Data_Table.php
2 years ago
Dual_Color_Header.php
2 years ago
EmbedPress.php
4 years ago
Event_Calendar.php
2 years ago
Facebook_Feed.php
2 years ago
Fancy_Text.php
2 years ago
Feature_List.php
2 years ago
Filterable_Gallery.php
2 years ago
Flip_Box.php
2 years ago
FluentForm.php
2 years ago
Formstack.php
2 years ago
GravityForms.php
2 years ago
Image_Accordion.php
2 years ago
Info_Box.php
2 years ago
Interactive_Circle.php
2 years ago
Login_Register.php
2 years ago
NFT_Gallery.php
2 years ago
NinjaForms.php
2 years ago
Post_Grid.php
2 years ago
Post_Timeline.php
2 years ago
Pricing_Table.php
2 years ago
Product_Grid.php
2 years ago
Progress_Bar.php
2 years ago
SVG_Draw.php
3 years ago
Simple_Menu.php
2 years ago
Sticky_Video.php
2 years ago
Team_Member.php
2 years ago
Testimonial.php
2 years ago
Tooltip.php
2 years ago
Twitter_Feed.php
2 years ago
TypeForm.php
2 years ago
WeForms.php
2 years ago
Woo_Cart.php
2 years ago
Woo_Checkout.php
2 years ago
Woo_Product_Carousel.php
2 years ago
Woo_Product_Compare.php
4 years ago
Woo_Product_Gallery.php
2 years ago
Woocommerce_Review.php
4 years ago
WpForms.php
2 years ago
index.php
3 years ago
Info_Box.php
1765 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use \Elementor\Group_Control_Border; |
| 12 | use \Elementor\Group_Control_Box_Shadow; |
| 13 | use \Elementor\Group_Control_Image_Size; |
| 14 | use \Elementor\Group_Control_Typography; |
| 15 | use Elementor\Icons_Manager; |
| 16 | use \Elementor\Plugin; |
| 17 | use \Elementor\Utils; |
| 18 | use \Elementor\Widget_Base; |
| 19 | use \Essential_Addons_Elementor\Classes\Helper; |
| 20 | |
| 21 | class Info_Box extends Widget_Base |
| 22 | { |
| 23 | public function get_name() |
| 24 | { |
| 25 | return 'eael-info-box'; |
| 26 | } |
| 27 | |
| 28 | public function get_title() |
| 29 | { |
| 30 | return esc_html__('Info Box', 'essential-addons-for-elementor-lite'); |
| 31 | } |
| 32 | |
| 33 | public function get_icon() |
| 34 | { |
| 35 | return 'eaicon-info-box'; |
| 36 | } |
| 37 | |
| 38 | public function get_categories() |
| 39 | { |
| 40 | return ['essential-addons-elementor']; |
| 41 | } |
| 42 | |
| 43 | public function get_keywords() |
| 44 | { |
| 45 | return [ |
| 46 | 'info', |
| 47 | 'ea infobox', |
| 48 | 'ea info box', |
| 49 | 'box', |
| 50 | 'ea box', |
| 51 | 'info box', |
| 52 | 'card', |
| 53 | 'ea', |
| 54 | 'essential addons', |
| 55 | ]; |
| 56 | } |
| 57 | |
| 58 | public function get_custom_help_url() |
| 59 | { |
| 60 | return 'https://essential-addons.com/elementor/docs/info-box/'; |
| 61 | } |
| 62 | |
| 63 | protected function register_controls() |
| 64 | { |
| 65 | |
| 66 | /** |
| 67 | * Infobox Image Settings |
| 68 | */ |
| 69 | $this->start_controls_section( |
| 70 | 'eael_section_infobox_content_settings', |
| 71 | [ |
| 72 | 'label' => esc_html__('Infobox Image', 'essential-addons-for-elementor-lite'), |
| 73 | ] |
| 74 | ); |
| 75 | |
| 76 | $this->add_control( |
| 77 | 'eael_infobox_img_type', |
| 78 | [ |
| 79 | 'label' => esc_html__('Infobox Type', 'essential-addons-for-elementor-lite'), |
| 80 | 'type' => Controls_Manager::SELECT, |
| 81 | 'default' => 'img-on-top', |
| 82 | 'label_block' => false, |
| 83 | 'options' => [ |
| 84 | 'img-on-top' => esc_html__('Image/Icon On Top', 'essential-addons-for-elementor-lite'), |
| 85 | 'img-on-left' => esc_html__('Image/Icon On Left', 'essential-addons-for-elementor-lite'), |
| 86 | 'img-on-right' => esc_html__('Image/Icon On Right', 'essential-addons-for-elementor-lite'), |
| 87 | ], |
| 88 | ] |
| 89 | ); |
| 90 | |
| 91 | $this->add_responsive_control( |
| 92 | 'eael_infobox_img_or_icon', |
| 93 | [ |
| 94 | 'label' => esc_html__('Image or Icon', 'essential-addons-for-elementor-lite'), |
| 95 | 'type' => Controls_Manager::CHOOSE, |
| 96 | 'label_block' => true, |
| 97 | 'options' => [ |
| 98 | 'none' => [ |
| 99 | 'title' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 100 | 'icon' => 'fa fa-ban', |
| 101 | ], |
| 102 | 'number' => [ |
| 103 | 'title' => esc_html__('Number', 'essential-addons-for-elementor-lite'), |
| 104 | 'icon' => 'eicon-number-field', |
| 105 | ], |
| 106 | 'icon' => [ |
| 107 | 'title' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 108 | 'icon' => 'fa fa-info-circle', |
| 109 | ], |
| 110 | 'img' => [ |
| 111 | 'title' => esc_html__('Image', 'essential-addons-for-elementor-lite'), |
| 112 | 'icon' => 'eicon-image-bold', |
| 113 | ], |
| 114 | ], |
| 115 | 'default' => 'icon', |
| 116 | ] |
| 117 | ); |
| 118 | |
| 119 | $this->add_responsive_control( |
| 120 | 'icon_vertical_position', |
| 121 | [ |
| 122 | 'label' => __('Icon Position', 'essential-addons-for-elementor-lite'), |
| 123 | 'type' => Controls_Manager::CHOOSE, |
| 124 | 'default' => 'top', |
| 125 | 'condition' => [ |
| 126 | 'eael_infobox_img_type!' => 'img-on-top', |
| 127 | ], |
| 128 | 'options' => [ |
| 129 | 'top' => [ |
| 130 | 'title' => __('Top', 'essential-addons-for-elementor-lite'), |
| 131 | 'icon' => 'eicon-v-align-top', |
| 132 | ], |
| 133 | 'middle' => [ |
| 134 | 'title' => __('Middle', 'essential-addons-for-elementor-lite'), |
| 135 | 'icon' => 'eicon-v-align-middle', |
| 136 | ], |
| 137 | 'bottom' => [ |
| 138 | 'title' => __('Bottom', 'essential-addons-for-elementor-lite'), |
| 139 | 'icon' => 'eicon-v-align-bottom', |
| 140 | ], |
| 141 | ], |
| 142 | 'selectors' => [ |
| 143 | '{{WRAPPER}} .eael-infobox .infobox-icon' => 'align-self: {{VALUE}};', |
| 144 | ], |
| 145 | 'selectors_dictionary' => [ |
| 146 | 'top' => 'baseline', |
| 147 | 'middle' => 'center', |
| 148 | 'bottom' => 'flex-end', |
| 149 | ], |
| 150 | ] |
| 151 | ); |
| 152 | |
| 153 | /** |
| 154 | * Condition: 'eael_infobox_img_or_icon' => 'img' |
| 155 | */ |
| 156 | $this->add_control( |
| 157 | 'eael_infobox_image', |
| 158 | [ |
| 159 | 'label' => esc_html__('Infobox Image', 'essential-addons-for-elementor-lite'), |
| 160 | 'type' => Controls_Manager::MEDIA, |
| 161 | 'default' => [ |
| 162 | 'url' => Utils::get_placeholder_image_src(), |
| 163 | ], |
| 164 | 'condition' => [ |
| 165 | 'eael_infobox_img_or_icon' => 'img', |
| 166 | ], |
| 167 | 'ai' => [ |
| 168 | 'active' => false, |
| 169 | ], |
| 170 | ] |
| 171 | ); |
| 172 | |
| 173 | /** |
| 174 | * Condition: 'eael_infobox_img_or_icon' => 'icon' |
| 175 | */ |
| 176 | $this->add_control( |
| 177 | 'eael_infobox_icon_new', |
| 178 | [ |
| 179 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 180 | 'type' => Controls_Manager::ICONS, |
| 181 | 'fa4compatibility' => 'eael_infobox_icon', |
| 182 | 'default' => [ |
| 183 | 'value' => 'fas fa-building', |
| 184 | 'library' => 'fa-solid', |
| 185 | ], |
| 186 | 'condition' => [ |
| 187 | 'eael_infobox_img_or_icon' => 'icon', |
| 188 | ], |
| 189 | ] |
| 190 | ); |
| 191 | |
| 192 | /** |
| 193 | * Condition: 'eael_infobox_img_or_icon' => 'number' |
| 194 | */ |
| 195 | $this->add_control( |
| 196 | 'eael_infobox_number', |
| 197 | [ |
| 198 | 'label' => esc_html__('Number', 'essential-addons-for-elementor-lite'), |
| 199 | 'type' => Controls_Manager::TEXT, |
| 200 | 'dynamic' => [ 'active' => true ], |
| 201 | 'condition' => [ |
| 202 | 'eael_infobox_img_or_icon' => 'number', |
| 203 | ], |
| 204 | 'ai' => [ |
| 205 | 'active' => false, |
| 206 | ], |
| 207 | ] |
| 208 | ); |
| 209 | |
| 210 | $this->end_controls_section(); |
| 211 | |
| 212 | /** |
| 213 | * Infobox Content |
| 214 | */ |
| 215 | $this->start_controls_section( |
| 216 | 'eael_infobox_content', |
| 217 | [ |
| 218 | 'label' => esc_html__('Infobox Content', 'essential-addons-for-elementor-lite'), |
| 219 | ] |
| 220 | ); |
| 221 | $this->add_control( |
| 222 | 'eael_infobox_title', |
| 223 | [ |
| 224 | 'label' => esc_html__('Infobox Title', 'essential-addons-for-elementor-lite'), |
| 225 | 'type' => Controls_Manager::TEXT, |
| 226 | 'label_block' => true, |
| 227 | 'dynamic' => [ |
| 228 | 'active' => true, |
| 229 | ], |
| 230 | 'default' => esc_html__('This is an icon box', 'essential-addons-for-elementor-lite'), |
| 231 | 'ai' => [ |
| 232 | 'active' => false, |
| 233 | ], |
| 234 | ] |
| 235 | ); |
| 236 | $this->add_control( |
| 237 | 'eael_infobox_title_tag', |
| 238 | [ |
| 239 | 'label' => __('Select Title Tag', 'essential-addons-for-elementor-lite'), |
| 240 | 'type' => Controls_Manager::SELECT, |
| 241 | 'default' => 'h4', |
| 242 | 'options' => [ |
| 243 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 244 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 245 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 246 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 247 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 248 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 249 | 'span' => __('Span', 'essential-addons-for-elementor-lite'), |
| 250 | 'p' => __('P', 'essential-addons-for-elementor-lite'), |
| 251 | 'div' => __('Div', 'essential-addons-for-elementor-lite'), |
| 252 | ], |
| 253 | ] |
| 254 | ); |
| 255 | $this->add_control( |
| 256 | 'eael_infobox_text_type', |
| 257 | [ |
| 258 | 'label' => __('Content Type', 'essential-addons-for-elementor-lite'), |
| 259 | 'type' => Controls_Manager::SELECT, |
| 260 | 'options' => [ |
| 261 | 'content' => __('Content', 'essential-addons-for-elementor-lite'), |
| 262 | 'template' => __('Saved Templates', 'essential-addons-for-elementor-lite'), |
| 263 | ], |
| 264 | 'default' => 'content', |
| 265 | ] |
| 266 | ); |
| 267 | |
| 268 | $this->add_control( |
| 269 | 'eael_primary_templates', |
| 270 | [ |
| 271 | 'label' => __('Choose Template', 'essential-addons-for-elementor-lite'), |
| 272 | 'type' => Controls_Manager::SELECT, |
| 273 | 'options' => Helper::get_elementor_templates(), |
| 274 | 'condition' => [ |
| 275 | 'eael_infobox_text_type' => 'template', |
| 276 | ], |
| 277 | ] |
| 278 | ); |
| 279 | $this->add_control( |
| 280 | 'eael_infobox_text', |
| 281 | [ |
| 282 | 'label' => esc_html__('Infobox Content', 'essential-addons-for-elementor-lite'), |
| 283 | 'type' => Controls_Manager::WYSIWYG, |
| 284 | 'label_block' => true, |
| 285 | 'dynamic' => [ |
| 286 | 'active' => true, |
| 287 | ], |
| 288 | 'default' => esc_html__('Write a short description, that will describe the title or something informational and useful.', 'essential-addons-for-elementor-lite'), |
| 289 | 'condition' => [ |
| 290 | 'eael_infobox_text_type' => 'content', |
| 291 | ], |
| 292 | ] |
| 293 | ); |
| 294 | $this->add_control( |
| 295 | 'eael_show_infobox_content', |
| 296 | [ |
| 297 | 'label' => __('Show Content', 'essential-addons-for-elementor-lite'), |
| 298 | 'type' => Controls_Manager::SWITCHER, |
| 299 | 'default' => 'yes', |
| 300 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 301 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 302 | 'return_value' => 'yes', |
| 303 | ] |
| 304 | ); |
| 305 | $this->add_responsive_control( |
| 306 | 'eael_infobox_content_alignment', |
| 307 | [ |
| 308 | 'label' => esc_html__('Content Alignment', 'essential-addons-for-elementor-lite'), |
| 309 | 'type' => Controls_Manager::CHOOSE, |
| 310 | 'label_block' => true, |
| 311 | 'options' => [ |
| 312 | 'left' => [ |
| 313 | 'title' => esc_html__('Left', 'essential-addons-for-elementor-lite'), |
| 314 | 'icon' => 'eicon-text-align-left', |
| 315 | ], |
| 316 | 'center' => [ |
| 317 | 'title' => esc_html__('Center', 'essential-addons-for-elementor-lite'), |
| 318 | 'icon' => 'eicon-text-align-center', |
| 319 | ], |
| 320 | 'right' => [ |
| 321 | 'title' => esc_html__('Right', 'essential-addons-for-elementor-lite'), |
| 322 | 'icon' => 'eicon-text-align-right', |
| 323 | ], |
| 324 | ], |
| 325 | 'default' => 'center', |
| 326 | 'prefix_class' => 'eael-infobox-content-align-', |
| 327 | 'condition' => [ |
| 328 | 'eael_infobox_img_type' => 'img-on-top', |
| 329 | ], |
| 330 | ] |
| 331 | ); |
| 332 | |
| 333 | $this->add_control( |
| 334 | 'content_height', |
| 335 | [ |
| 336 | 'label' => esc_html__('Content Height', 'essential-addons-for-elementor-lite'), |
| 337 | 'type' => Controls_Manager::SLIDER, |
| 338 | 'size_units' => ['px', '%', 'em'], |
| 339 | 'range' => [ |
| 340 | 'px' => ['max' => 300], |
| 341 | '%' => ['max' => 100], |
| 342 | ], |
| 343 | 'selectors' => [ |
| 344 | '{{WRAPPER}} .infobox-content' => 'height: {{SIZE}}{{UNIT}};', |
| 345 | ], |
| 346 | ] |
| 347 | ); |
| 348 | |
| 349 | $this->end_controls_section(); |
| 350 | |
| 351 | /** |
| 352 | * ---------------------------------------------- |
| 353 | * Infobox Button |
| 354 | * ---------------------------------------------- |
| 355 | */ |
| 356 | $this->start_controls_section( |
| 357 | 'eael_infobox_button', |
| 358 | [ |
| 359 | 'label' => esc_html__('Button', 'essential-addons-for-elementor-lite'), |
| 360 | ] |
| 361 | ); |
| 362 | |
| 363 | $this->add_control( |
| 364 | 'eael_show_infobox_button', |
| 365 | [ |
| 366 | 'label' => __('Show Infobox Button', 'essential-addons-for-elementor-lite'), |
| 367 | 'type' => Controls_Manager::SWITCHER, |
| 368 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 369 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 370 | 'condition' => [ |
| 371 | 'eael_show_infobox_clickable!' => 'yes', |
| 372 | ], |
| 373 | ] |
| 374 | ); |
| 375 | |
| 376 | $this->add_control( |
| 377 | 'eael_show_infobox_clickable', |
| 378 | [ |
| 379 | 'label' => __('Infobox Clickable', 'essential-addons-for-elementor-lite'), |
| 380 | 'type' => Controls_Manager::SWITCHER, |
| 381 | 'default' => 'no', |
| 382 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 383 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 384 | 'return_value' => 'yes', |
| 385 | 'condition' => [ |
| 386 | 'eael_show_infobox_button!' => 'yes', |
| 387 | ], |
| 388 | ] |
| 389 | ); |
| 390 | |
| 391 | $this->add_control( |
| 392 | 'eael_show_infobox_clickable_link', |
| 393 | [ |
| 394 | 'label' => esc_html__('Infobox Link', 'essential-addons-for-elementor-lite'), |
| 395 | 'type' => Controls_Manager::URL, |
| 396 | 'dynamic' => ['active' => true], |
| 397 | 'label_block' => true, |
| 398 | 'default' => [ |
| 399 | 'url' => 'http://', |
| 400 | 'is_external' => '', |
| 401 | ], |
| 402 | 'show_external' => true, |
| 403 | 'condition' => [ |
| 404 | 'eael_show_infobox_clickable' => 'yes', |
| 405 | ], |
| 406 | ] |
| 407 | ); |
| 408 | |
| 409 | $this->add_control( |
| 410 | 'infobox_button_text', |
| 411 | [ |
| 412 | 'label' => __('Button Text', 'essential-addons-for-elementor-lite'), |
| 413 | 'type' => Controls_Manager::TEXT, |
| 414 | 'dynamic' => [ |
| 415 | 'active' => true |
| 416 | ], |
| 417 | 'label_block' => true, |
| 418 | 'default' => 'Click Me!', |
| 419 | 'separator' => 'before', |
| 420 | 'placeholder' => __('Enter button text', 'essential-addons-for-elementor-lite'), |
| 421 | 'title' => __('Enter button text here', 'essential-addons-for-elementor-lite'), |
| 422 | 'condition' => [ |
| 423 | 'eael_show_infobox_button' => 'yes', |
| 424 | ], |
| 425 | 'ai' => [ |
| 426 | 'active' => false, |
| 427 | ], |
| 428 | ] |
| 429 | ); |
| 430 | |
| 431 | $this->add_control( |
| 432 | 'infobox_button_link_url', |
| 433 | [ |
| 434 | 'label' => __('Link URL', 'essential-addons-for-elementor-lite'), |
| 435 | 'type' => Controls_Manager::URL, |
| 436 | 'dynamic' => ['active' => true], |
| 437 | 'label_block' => true, |
| 438 | 'placeholder' => __('Enter link URL for the button', 'essential-addons-for-elementor-lite'), |
| 439 | 'show_external' => true, |
| 440 | 'default' => [ |
| 441 | 'url' => '#', |
| 442 | ], |
| 443 | 'title' => __('Enter heading for the button', 'essential-addons-for-elementor-lite'), |
| 444 | 'condition' => [ |
| 445 | 'eael_show_infobox_button' => 'yes', |
| 446 | ], |
| 447 | ] |
| 448 | ); |
| 449 | |
| 450 | $this->add_control( |
| 451 | 'eael_infobox_button_icon_new', |
| 452 | [ |
| 453 | 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'), |
| 454 | 'type' => Controls_Manager::ICONS, |
| 455 | 'fa4compatibility' => 'eael_infobox_button_icon', |
| 456 | 'condition' => [ |
| 457 | 'eael_show_infobox_button' => 'yes', |
| 458 | ], |
| 459 | ] |
| 460 | ); |
| 461 | |
| 462 | $this->add_control( |
| 463 | 'eael_infobox_button_icon_alignment', |
| 464 | [ |
| 465 | 'label' => esc_html__('Icon Position', 'essential-addons-for-elementor-lite'), |
| 466 | 'type' => Controls_Manager::SELECT, |
| 467 | 'default' => 'left', |
| 468 | 'options' => [ |
| 469 | 'left' => esc_html__('Before', 'essential-addons-for-elementor-lite'), |
| 470 | 'right' => esc_html__('After', 'essential-addons-for-elementor-lite'), |
| 471 | ], |
| 472 | 'condition' => [ |
| 473 | 'eael_infobox_button_icon_new!' => '', |
| 474 | 'eael_show_infobox_button' => 'yes', |
| 475 | ], |
| 476 | ] |
| 477 | ); |
| 478 | |
| 479 | $this->add_control( |
| 480 | 'eael_infobox_button_icon_indent', |
| 481 | [ |
| 482 | 'label' => esc_html__('Icon Spacing', 'essential-addons-for-elementor-lite'), |
| 483 | 'type' => Controls_Manager::SLIDER, |
| 484 | 'range' => [ |
| 485 | 'px' => [ |
| 486 | 'max' => 60, |
| 487 | ], |
| 488 | ], |
| 489 | 'condition' => [ |
| 490 | 'eael_infobox_button_icon_new!' => '', |
| 491 | 'eael_show_infobox_button' => 'yes', |
| 492 | ], |
| 493 | 'selectors' => [ |
| 494 | '{{WRAPPER}} .eael_infobox_button_icon_right' => 'margin-left: {{SIZE}}px;', |
| 495 | '{{WRAPPER}} .eael_infobox_button_icon_left' => 'margin-right: {{SIZE}}px;', |
| 496 | ], |
| 497 | ] |
| 498 | ); |
| 499 | $this->end_controls_section(); |
| 500 | |
| 501 | if (!apply_filters('eael/pro_enabled', false)) { |
| 502 | $this->start_controls_section( |
| 503 | 'eael_section_pro', |
| 504 | [ |
| 505 | 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'), |
| 506 | ] |
| 507 | ); |
| 508 | |
| 509 | $this->add_control( |
| 510 | 'eael_control_get_pro', |
| 511 | [ |
| 512 | 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'), |
| 513 | 'type' => Controls_Manager::CHOOSE, |
| 514 | 'options' => [ |
| 515 | '1' => [ |
| 516 | 'title' => '', |
| 517 | 'icon' => 'fa fa-unlock-alt', |
| 518 | ], |
| 519 | ], |
| 520 | 'default' => '1', |
| 521 | 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>', |
| 522 | ] |
| 523 | ); |
| 524 | |
| 525 | $this->end_controls_section(); |
| 526 | } |
| 527 | |
| 528 | /** |
| 529 | * ------------------------------------------- |
| 530 | * Tab Style (Info Box Image) |
| 531 | * ------------------------------------------- |
| 532 | */ |
| 533 | $this->start_controls_section( |
| 534 | 'eael_section_infobox_imgae_style_settings', |
| 535 | [ |
| 536 | 'label' => esc_html__('Image Style', 'essential-addons-for-elementor-lite'), |
| 537 | 'tab' => Controls_Manager::TAB_STYLE, |
| 538 | 'condition' => [ |
| 539 | 'eael_infobox_img_or_icon' => 'img', |
| 540 | ], |
| 541 | ] |
| 542 | ); |
| 543 | |
| 544 | $this->start_controls_tabs('eael_infobox_image_style'); |
| 545 | |
| 546 | $this->start_controls_tab( |
| 547 | 'eael_infobox_image_icon_normal', |
| 548 | [ |
| 549 | 'label' => __('Normal', 'essential-addons-for-elementor-lite'), |
| 550 | ] |
| 551 | ); |
| 552 | |
| 553 | $this->add_control( |
| 554 | 'eael_infobox_image_icon_bg_color', |
| 555 | [ |
| 556 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 557 | 'type' => Controls_Manager::COLOR, |
| 558 | 'default' => '', |
| 559 | 'selectors' => [ |
| 560 | '{{WRAPPER}} .eael-infobox .infobox-icon img' => 'background-color: {{VALUE}};', |
| 561 | ], |
| 562 | ] |
| 563 | ); |
| 564 | |
| 565 | $this->add_responsive_control( |
| 566 | 'eael_infobox_image_icon_padding', |
| 567 | [ |
| 568 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 569 | 'type' => Controls_Manager::DIMENSIONS, |
| 570 | 'size_units' => ['px', 'em', '%'], |
| 571 | 'selectors' => [ |
| 572 | '{{WRAPPER}} .eael-infobox .infobox-icon img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 573 | ], |
| 574 | ] |
| 575 | ); |
| 576 | |
| 577 | $this->add_group_control( |
| 578 | Group_Control_Border::get_type(), |
| 579 | [ |
| 580 | 'name' => 'eael_infobox_image_border', |
| 581 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 582 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon img', |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $this->add_control( |
| 587 | 'eael_infobox_img_shape', |
| 588 | [ |
| 589 | 'label' => esc_html__('Image Shape', 'essential-addons-for-elementor-lite'), |
| 590 | 'type' => Controls_Manager::SELECT, |
| 591 | 'default' => 'square', |
| 592 | 'label_block' => false, |
| 593 | 'options' => [ |
| 594 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 595 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 596 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 597 | ], |
| 598 | 'prefix_class' => 'eael-infobox-shape-', |
| 599 | 'condition' => [ |
| 600 | 'eael_infobox_img_or_icon' => 'img', |
| 601 | ], |
| 602 | ] |
| 603 | ); |
| 604 | |
| 605 | $this->end_controls_tab(); |
| 606 | |
| 607 | $this->start_controls_tab( |
| 608 | 'eael_infobox_image_icon_hover', |
| 609 | [ |
| 610 | 'label' => __('Hover', 'essential-addons-for-elementor-lite'), |
| 611 | ] |
| 612 | ); |
| 613 | |
| 614 | $this->add_group_control( |
| 615 | Group_Control_Box_Shadow::get_type(), |
| 616 | [ |
| 617 | 'name' => 'eael_infobox_image_icon_hover_shadow', |
| 618 | 'selectors' => [ |
| 619 | '{{WRAPPER}} .eael-infobox .infobox-icon:hover img' => 'background-color: {{VALUE}};', |
| 620 | ], |
| 621 | ] |
| 622 | ); |
| 623 | |
| 624 | $this->add_control( |
| 625 | 'eael_infobox_image_icon_hover_animation', |
| 626 | [ |
| 627 | 'label' => esc_html__('Animation', 'essential-addons-for-elementor-lite'), |
| 628 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 629 | ] |
| 630 | ); |
| 631 | |
| 632 | $this->add_group_control( |
| 633 | Group_Control_Border::get_type(), |
| 634 | [ |
| 635 | 'name' => 'eael_infobox_hover_image_border', |
| 636 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 637 | 'selector' => '{{WRAPPER}} .eael-infobox:hover .infobox-icon img', |
| 638 | ] |
| 639 | ); |
| 640 | |
| 641 | $this->add_control( |
| 642 | 'eael_infobox_hover_img_shape', |
| 643 | [ |
| 644 | 'label' => esc_html__('Image Shape', 'essential-addons-for-elementor-lite'), |
| 645 | 'type' => Controls_Manager::SELECT, |
| 646 | 'default' => 'square', |
| 647 | 'label_block' => false, |
| 648 | 'options' => [ |
| 649 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 650 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 651 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 652 | ], |
| 653 | 'prefix_class' => 'eael-infobox-hover-img-shape-', |
| 654 | 'condition' => [ |
| 655 | 'eael_infobox_img_or_icon' => 'img', |
| 656 | ], |
| 657 | ] |
| 658 | ); |
| 659 | |
| 660 | $this->end_controls_tab(); |
| 661 | |
| 662 | $this->end_controls_tabs(); |
| 663 | |
| 664 | $this->add_control( |
| 665 | 'eael_infobox_image_resizer', |
| 666 | [ |
| 667 | 'label' => esc_html__('Image Resizer', 'essential-addons-for-elementor-lite'), |
| 668 | 'type' => Controls_Manager::SLIDER, |
| 669 | 'default' => [ |
| 670 | 'size' => 100, |
| 671 | ], |
| 672 | 'range' => [ |
| 673 | 'px' => [ |
| 674 | 'max' => 500, |
| 675 | ], |
| 676 | ], |
| 677 | 'selectors' => [ |
| 678 | '{{WRAPPER}} .eael-infobox .infobox-icon img' => 'width: {{SIZE}}px;', |
| 679 | '{{WRAPPER}} .eael-infobox.icon-on-left .infobox-icon' => 'width: {{SIZE}}px;', |
| 680 | '{{WRAPPER}} .eael-infobox.icon-on-right .infobox-icon' => 'width: {{SIZE}}px;', |
| 681 | ], |
| 682 | ] |
| 683 | ); |
| 684 | |
| 685 | $this->add_group_control( |
| 686 | Group_Control_Image_Size::get_type(), |
| 687 | [ |
| 688 | 'name' => 'thumbnail', |
| 689 | 'default' => 'full', |
| 690 | 'condition' => [ |
| 691 | 'eael_infobox_image[url]!' => '', |
| 692 | 'eael_infobox_img_or_icon' => 'img', |
| 693 | ], |
| 694 | |
| 695 | ] |
| 696 | ); |
| 697 | |
| 698 | $this->add_responsive_control( |
| 699 | 'eael_infobox_img_margin', |
| 700 | [ |
| 701 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 702 | 'type' => Controls_Manager::DIMENSIONS, |
| 703 | 'size_units' => ['px', 'em', '%'], |
| 704 | 'selectors' => [ |
| 705 | '{{WRAPPER}} .eael-infobox .infobox-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 706 | ], |
| 707 | ] |
| 708 | ); |
| 709 | |
| 710 | $this->end_controls_section(); |
| 711 | |
| 712 | /** |
| 713 | * ------------------------------------------- |
| 714 | * Tab Style (Info Box Number Icon Style) |
| 715 | * ------------------------------------------- |
| 716 | */ |
| 717 | $this->start_controls_section( |
| 718 | 'eael_section_infobox_number_icon_style_settings', |
| 719 | [ |
| 720 | 'label' => esc_html__('Number Icon Style', 'essential-addons-for-elementor-lite'), |
| 721 | 'tab' => Controls_Manager::TAB_STYLE, |
| 722 | 'condition' => [ |
| 723 | 'eael_infobox_img_or_icon' => 'number', |
| 724 | ], |
| 725 | ] |
| 726 | ); |
| 727 | |
| 728 | $this->add_group_control( |
| 729 | Group_Control_Typography::get_type(), |
| 730 | [ |
| 731 | 'name' => 'eael_infobox_number_icon_typography', |
| 732 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-number', |
| 733 | ] |
| 734 | ); |
| 735 | |
| 736 | $this->add_responsive_control( |
| 737 | 'eael_infobox_number_icon_bg_size', |
| 738 | [ |
| 739 | 'label' => __('Icon Background Size', 'essential-addons-for-elementor-lite'), |
| 740 | 'type' => Controls_Manager::SLIDER, |
| 741 | 'default' => [ |
| 742 | 'size' => 90, |
| 743 | ], |
| 744 | 'range' => [ |
| 745 | 'px' => [ |
| 746 | 'min' => 0, |
| 747 | 'max' => 300, |
| 748 | 'step' => 1, |
| 749 | ], |
| 750 | ], |
| 751 | 'selectors' => [ |
| 752 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-wrap' => 'width: {{SIZE}}px; height: {{SIZE}}px;', |
| 753 | ], |
| 754 | 'condition' => [ |
| 755 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 756 | ], |
| 757 | ] |
| 758 | ); |
| 759 | |
| 760 | $this->add_responsive_control( |
| 761 | 'eael_infobox_number_icon_margin', |
| 762 | [ |
| 763 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 764 | 'type' => Controls_Manager::DIMENSIONS, |
| 765 | 'size_units' => ['px', 'em', '%'], |
| 766 | 'selectors' => [ |
| 767 | '{{WRAPPER}} .eael-infobox .infobox-icon-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 768 | ], |
| 769 | ] |
| 770 | ); |
| 771 | |
| 772 | $this->start_controls_tabs('eael_infobox_numbericon_style_controls'); |
| 773 | |
| 774 | $this->start_controls_tab( |
| 775 | 'eael_infobox_number_icon_normal', |
| 776 | [ |
| 777 | 'label' => esc_html__('Normal', 'essential-addons-for-elementor-lite'), |
| 778 | ] |
| 779 | ); |
| 780 | |
| 781 | $this->add_control( |
| 782 | 'eael_infobox_number_icon_color', |
| 783 | [ |
| 784 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 785 | 'type' => Controls_Manager::COLOR, |
| 786 | 'default' => '#4d4d4d', |
| 787 | 'selectors' => [ |
| 788 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-number' => 'color: {{VALUE}};', |
| 789 | '{{WRAPPER}} .eael-infobox.icon-beside-title .infobox-content .title figure .infobox-icon-number' => 'color: {{VALUE}};', |
| 790 | ], |
| 791 | ] |
| 792 | ); |
| 793 | |
| 794 | $this->add_control( |
| 795 | 'eael_infobox_number_icon_bg_color', |
| 796 | [ |
| 797 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 798 | 'type' => Controls_Manager::COLOR, |
| 799 | 'default' => '', |
| 800 | 'selectors' => [ |
| 801 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-wrap' => 'background: {{VALUE}};', |
| 802 | ], |
| 803 | 'condition' => [ |
| 804 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 805 | ], |
| 806 | ] |
| 807 | ); |
| 808 | |
| 809 | $this->add_control( |
| 810 | 'eael_infobox_number_icon_bg_shape', |
| 811 | [ |
| 812 | 'label' => esc_html__('Background Shape', 'essential-addons-for-elementor-lite'), |
| 813 | 'type' => Controls_Manager::SELECT, |
| 814 | 'default' => 'none', |
| 815 | 'label_block' => false, |
| 816 | 'options' => [ |
| 817 | 'none' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 818 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 819 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 820 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 821 | ], |
| 822 | 'prefix_class' => 'eael-infobox-icon-bg-shape-', |
| 823 | ] |
| 824 | ); |
| 825 | |
| 826 | $this->add_group_control( |
| 827 | Group_Control_Border::get_type(), |
| 828 | [ |
| 829 | 'name' => 'eael_infobox_number_icon_border', |
| 830 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 831 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon-wrap', |
| 832 | ] |
| 833 | ); |
| 834 | |
| 835 | $this->add_group_control( |
| 836 | Group_Control_Box_Shadow::get_type(), |
| 837 | [ |
| 838 | 'name' => 'eael_infobox_number_icon_shadow', |
| 839 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon-wrap', |
| 840 | ] |
| 841 | ); |
| 842 | |
| 843 | $this->end_controls_tab(); |
| 844 | |
| 845 | $this->start_controls_tab( |
| 846 | 'eael_infobox_number_icon_hover', |
| 847 | [ |
| 848 | 'label' => esc_html__('Hover', 'essential-addons-for-elementor-lite'), |
| 849 | ] |
| 850 | ); |
| 851 | |
| 852 | $this->add_control( |
| 853 | 'eael_infobox_number_icon_hover_animation', |
| 854 | [ |
| 855 | 'label' => esc_html__('Animation', 'essential-addons-for-elementor-lite'), |
| 856 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 857 | ] |
| 858 | ); |
| 859 | |
| 860 | $this->add_control( |
| 861 | 'eael_infobox_number_icon_hover_color', |
| 862 | [ |
| 863 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 864 | 'type' => Controls_Manager::COLOR, |
| 865 | 'default' => '#4d4d4d', |
| 866 | 'selectors' => [ |
| 867 | '{{WRAPPER}} .eael-infobox:hover .infobox-icon .infobox-icon-number' => 'color: {{VALUE}};', |
| 868 | '{{WRAPPER}} .eael-infobox.icon-beside-title:hover .infobox-content .title figure .infobox-icon-number' => 'color: {{VALUE}};', |
| 869 | ], |
| 870 | ] |
| 871 | ); |
| 872 | |
| 873 | $this->add_control( |
| 874 | 'eael_infobox_number_icon_hover_bg_color', |
| 875 | [ |
| 876 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 877 | 'type' => Controls_Manager::COLOR, |
| 878 | 'default' => '', |
| 879 | 'selectors' => [ |
| 880 | '{{WRAPPER}} .eael-infobox:hover .infobox-icon .infobox-icon-wrap' => 'background: {{VALUE}};', |
| 881 | ], |
| 882 | 'condition' => [ |
| 883 | 'eael_infobox_img_type!' => ['img-on-left', 'img-on-right'], |
| 884 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 885 | ], |
| 886 | ] |
| 887 | ); |
| 888 | |
| 889 | $this->add_control( |
| 890 | 'eael_infobox_number_icon_hover_bg_shape', |
| 891 | [ |
| 892 | 'label' => esc_html__('Background Shape', 'essential-addons-for-elementor-lite'), |
| 893 | 'type' => Controls_Manager::SELECT, |
| 894 | 'default' => 'none', |
| 895 | 'label_block' => false, |
| 896 | 'options' => [ |
| 897 | 'none' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 898 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 899 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 900 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 901 | ], |
| 902 | 'prefix_class' => 'eael-infobox-icon-hover-bg-shape-', |
| 903 | ] |
| 904 | ); |
| 905 | |
| 906 | $this->add_group_control( |
| 907 | Group_Control_Border::get_type(), |
| 908 | [ |
| 909 | 'name' => 'eael_infobox_hover_number_icon_border', |
| 910 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 911 | 'selector' => '{{WRAPPER}} .eael-infobox:hover .infobox-icon-wrap', |
| 912 | ] |
| 913 | ); |
| 914 | |
| 915 | $this->add_group_control( |
| 916 | Group_Control_Box_Shadow::get_type(), |
| 917 | [ |
| 918 | 'name' => 'eael_infobox_number_icon_hover_shadow', |
| 919 | 'selector' => '{{WRAPPER}} .eael-infobox:hover .infobox-icon-wrap', |
| 920 | ] |
| 921 | ); |
| 922 | |
| 923 | $this->end_controls_tab(); |
| 924 | |
| 925 | $this->end_controls_tabs(); |
| 926 | |
| 927 | $this->end_controls_section(); |
| 928 | |
| 929 | /** |
| 930 | * ------------------------------------------- |
| 931 | * Tab Style (Info Box Icon Style) |
| 932 | * ------------------------------------------- |
| 933 | */ |
| 934 | $this->start_controls_section( |
| 935 | 'eael_section_infobox_icon_style_settings', |
| 936 | [ |
| 937 | 'label' => esc_html__('Icon Style', 'essential-addons-for-elementor-lite'), |
| 938 | 'tab' => Controls_Manager::TAB_STYLE, |
| 939 | 'condition' => [ |
| 940 | 'eael_infobox_img_or_icon' => 'icon', |
| 941 | ], |
| 942 | ] |
| 943 | ); |
| 944 | |
| 945 | $this->add_responsive_control( |
| 946 | 'eael_infobox_icon_size', |
| 947 | [ |
| 948 | 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'), |
| 949 | 'type' => Controls_Manager::SLIDER, |
| 950 | 'default' => [ |
| 951 | 'size' => 40, |
| 952 | ], |
| 953 | 'range' => [ |
| 954 | 'px' => [ |
| 955 | 'min' => 20, |
| 956 | 'max' => 100, |
| 957 | 'step' => 1, |
| 958 | ], |
| 959 | ], |
| 960 | 'selectors' => [ |
| 961 | '{{WRAPPER}} .eael-infobox .infobox-icon i' => 'font-size: {{SIZE}}px;', |
| 962 | '{{WRAPPER}} .eael-infobox .infobox-icon svg' => 'height: {{SIZE}}px; width: {{SIZE}}px;', |
| 963 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-wrap img' => 'height: {{SIZE}}px; width: {{SIZE}}px;', |
| 964 | ], |
| 965 | ] |
| 966 | ); |
| 967 | |
| 968 | $this->add_responsive_control( |
| 969 | 'eael_infobox_icon_bg_size', |
| 970 | [ |
| 971 | 'label' => __('Icon Background Size', 'essential-addons-for-elementor-lite'), |
| 972 | 'type' => Controls_Manager::SLIDER, |
| 973 | 'default' => [ |
| 974 | 'size' => 90, |
| 975 | ], |
| 976 | 'range' => [ |
| 977 | 'px' => [ |
| 978 | 'min' => 0, |
| 979 | 'max' => 300, |
| 980 | 'step' => 1, |
| 981 | ], |
| 982 | ], |
| 983 | 'selectors' => [ |
| 984 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-wrap' => 'width: {{SIZE}}px; height: {{SIZE}}px;', |
| 985 | ], |
| 986 | 'condition' => [ |
| 987 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 988 | ], |
| 989 | ] |
| 990 | ); |
| 991 | |
| 992 | $this->add_responsive_control( |
| 993 | 'eael_infobox_icon_margin', |
| 994 | [ |
| 995 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 996 | 'type' => Controls_Manager::DIMENSIONS, |
| 997 | 'size_units' => ['px', 'em', '%'], |
| 998 | 'selectors' => [ |
| 999 | '{{WRAPPER}} .eael-infobox .infobox-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1000 | ], |
| 1001 | ] |
| 1002 | ); |
| 1003 | |
| 1004 | $this->start_controls_tabs('eael_infobox_icon_style_controls'); |
| 1005 | |
| 1006 | $this->start_controls_tab( |
| 1007 | 'eael_infobox_icon_normal', |
| 1008 | [ |
| 1009 | 'label' => esc_html__('Normal', 'essential-addons-for-elementor-lite'), |
| 1010 | ] |
| 1011 | ); |
| 1012 | |
| 1013 | $this->add_control( |
| 1014 | 'eael_infobox_icon_color', |
| 1015 | [ |
| 1016 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 1017 | 'type' => Controls_Manager::COLOR, |
| 1018 | 'default' => '#4d4d4d', |
| 1019 | 'selectors' => [ |
| 1020 | '{{WRAPPER}} .eael-infobox .infobox-icon i' => 'color: {{VALUE}};', |
| 1021 | '{{WRAPPER}} .eael-infobox .infobox-icon svg' => 'fill: {{VALUE}};', |
| 1022 | '{{WRAPPER}} .eael-infobox.icon-beside-title .infobox-content .title figure i' => 'color: {{VALUE}};', |
| 1023 | ], |
| 1024 | ] |
| 1025 | ); |
| 1026 | |
| 1027 | $this->add_control( |
| 1028 | 'eael_infobox_icon_bg_shape', |
| 1029 | [ |
| 1030 | 'label' => esc_html__('Background Shape', 'essential-addons-for-elementor-lite'), |
| 1031 | 'type' => Controls_Manager::SELECT, |
| 1032 | 'default' => 'none', |
| 1033 | 'label_block' => false, |
| 1034 | 'options' => [ |
| 1035 | 'none' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 1036 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 1037 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 1038 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 1039 | ], |
| 1040 | 'prefix_class' => 'eael-infobox-icon-bg-shape-', |
| 1041 | ] |
| 1042 | ); |
| 1043 | |
| 1044 | $this->add_control( |
| 1045 | 'eael_infobox_icon_bg_color', |
| 1046 | [ |
| 1047 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1048 | 'type' => Controls_Manager::COLOR, |
| 1049 | 'default' => '', |
| 1050 | 'selectors' => [ |
| 1051 | '{{WRAPPER}} .eael-infobox .infobox-icon .infobox-icon-wrap' => 'background: {{VALUE}};', |
| 1052 | ], |
| 1053 | 'condition' => [ |
| 1054 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 1055 | ], |
| 1056 | ] |
| 1057 | ); |
| 1058 | |
| 1059 | $this->add_group_control( |
| 1060 | Group_Control_Border::get_type(), |
| 1061 | [ |
| 1062 | 'name' => 'eael_infobox_icon_border', |
| 1063 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 1064 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon-wrap', |
| 1065 | ] |
| 1066 | ); |
| 1067 | |
| 1068 | $this->add_group_control( |
| 1069 | Group_Control_Box_Shadow::get_type(), |
| 1070 | [ |
| 1071 | 'name' => 'eael_infobox_icon_shadow', |
| 1072 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-icon-wrap', |
| 1073 | ] |
| 1074 | ); |
| 1075 | |
| 1076 | $this->end_controls_tab(); |
| 1077 | |
| 1078 | $this->start_controls_tab( |
| 1079 | 'eael_infobox_icon_hover', |
| 1080 | [ |
| 1081 | 'label' => esc_html__('Hover', 'essential-addons-for-elementor-lite'), |
| 1082 | ] |
| 1083 | ); |
| 1084 | |
| 1085 | $this->add_control( |
| 1086 | 'eael_infobox_icon_hover_animation', |
| 1087 | [ |
| 1088 | 'label' => esc_html__('Animation', 'essential-addons-for-elementor-lite'), |
| 1089 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 1090 | ] |
| 1091 | ); |
| 1092 | |
| 1093 | $this->add_control( |
| 1094 | 'eael_infobox_icon_hover_color', |
| 1095 | [ |
| 1096 | 'label' => esc_html__('Icon Color', 'essential-addons-for-elementor-lite'), |
| 1097 | 'type' => Controls_Manager::COLOR, |
| 1098 | 'default' => '#4d4d4d', |
| 1099 | 'selectors' => [ |
| 1100 | '{{WRAPPER}} .eael-infobox:hover .infobox-icon i' => 'color: {{VALUE}};', |
| 1101 | '{{WRAPPER}} .eael-infobox:hover .infobox-icon svg' => 'fill: {{VALUE}};', |
| 1102 | '{{WRAPPER}} .eael-infobox.icon-beside-title:hover .infobox-content .title figure i' => 'color: {{VALUE}};', |
| 1103 | ], |
| 1104 | ] |
| 1105 | ); |
| 1106 | |
| 1107 | $this->add_control( |
| 1108 | 'eael_infobox_icon_hover_bg_color', |
| 1109 | [ |
| 1110 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1111 | 'type' => Controls_Manager::COLOR, |
| 1112 | 'default' => '', |
| 1113 | 'selectors' => [ |
| 1114 | '{{WRAPPER}} .eael-infobox:hover .infobox-icon .infobox-icon-wrap' => 'background: {{VALUE}};', |
| 1115 | ], |
| 1116 | 'condition' => [ |
| 1117 | 'eael_infobox_img_type!' => ['img-on-left', 'img-on-right'], |
| 1118 | 'eael_infobox_icon_bg_shape!' => 'none', |
| 1119 | ], |
| 1120 | ] |
| 1121 | ); |
| 1122 | |
| 1123 | $this->add_control( |
| 1124 | 'eael_infobox_icon_hover_bg_shape', |
| 1125 | [ |
| 1126 | 'label' => esc_html__('Background Shape', 'essential-addons-for-elementor-lite'), |
| 1127 | 'type' => Controls_Manager::SELECT, |
| 1128 | 'default' => 'none', |
| 1129 | 'label_block' => false, |
| 1130 | 'options' => [ |
| 1131 | 'none' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 1132 | 'circle' => esc_html__('Circle', 'essential-addons-for-elementor-lite'), |
| 1133 | 'radius' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), |
| 1134 | 'square' => esc_html__('Square', 'essential-addons-for-elementor-lite'), |
| 1135 | ], |
| 1136 | 'prefix_class' => 'eael-infobox-icon-hover-bg-shape-', |
| 1137 | ] |
| 1138 | ); |
| 1139 | |
| 1140 | $this->add_group_control( |
| 1141 | Group_Control_Border::get_type(), |
| 1142 | [ |
| 1143 | 'name' => 'eael_infobox_hover_icon_border', |
| 1144 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 1145 | 'selector' => '{{WRAPPER}} .eael-infobox:hover .infobox-icon-wrap', |
| 1146 | ] |
| 1147 | ); |
| 1148 | |
| 1149 | $this->add_group_control( |
| 1150 | Group_Control_Box_Shadow::get_type(), |
| 1151 | [ |
| 1152 | 'name' => 'eael_infobox_icon_hover_shadow', |
| 1153 | 'selector' => '{{WRAPPER}} .eael-infobox:hover .infobox-icon-wrap', |
| 1154 | ] |
| 1155 | ); |
| 1156 | |
| 1157 | $this->end_controls_tab(); |
| 1158 | |
| 1159 | $this->end_controls_tabs(); |
| 1160 | |
| 1161 | $this->end_controls_section(); |
| 1162 | |
| 1163 | /** |
| 1164 | * ------------------------------------------- |
| 1165 | * Tab Style ( Info Box Button Style ) |
| 1166 | * ------------------------------------------- |
| 1167 | */ |
| 1168 | $this->start_controls_section( |
| 1169 | 'eael_section_infobox_button_settings', |
| 1170 | [ |
| 1171 | 'label' => esc_html__('Button Styles', 'essential-addons-for-elementor-lite'), |
| 1172 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1173 | 'condition' => [ |
| 1174 | 'eael_show_infobox_button' => 'yes', |
| 1175 | ], |
| 1176 | ] |
| 1177 | ); |
| 1178 | |
| 1179 | $this->add_group_control( |
| 1180 | Group_Control_Typography::get_type(), |
| 1181 | [ |
| 1182 | 'name' => 'eael_infobox_button_typography', |
| 1183 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-button .eael-infobox-button .infobox-button-text', |
| 1184 | ] |
| 1185 | ); |
| 1186 | |
| 1187 | $this->add_responsive_control( |
| 1188 | 'eael_infobox_button_icon_size', |
| 1189 | [ |
| 1190 | 'label' => __('Icon Size', 'essential-addons-for-elementor-lite'), |
| 1191 | 'type' => Controls_Manager::SLIDER, |
| 1192 | 'default' => [ |
| 1193 | 'size' => 16, |
| 1194 | 'unit' => 'px', |
| 1195 | ], |
| 1196 | 'size_units' => ['px'], |
| 1197 | 'range' => [ |
| 1198 | 'px' => [ |
| 1199 | 'min' => 0, |
| 1200 | 'max' => 100, |
| 1201 | 'step' => 1, |
| 1202 | ], |
| 1203 | ], |
| 1204 | 'selectors' => [ |
| 1205 | '{{WRAPPER}} .eael-infobox .infobox-button .eael-infobox-button i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1206 | '{{WRAPPER}} .eael-infobox .infobox-button .eael-infobox-button img' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', |
| 1207 | '{{WRAPPER}} .eael-infobox .infobox-button .eael-infobox-button svg' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', |
| 1208 | ], |
| 1209 | ] |
| 1210 | ); |
| 1211 | |
| 1212 | $this->add_responsive_control( |
| 1213 | 'eael_creative_button_padding', |
| 1214 | [ |
| 1215 | 'label' => esc_html__('Button Padding', 'essential-addons-for-elementor-lite'), |
| 1216 | 'type' => Controls_Manager::DIMENSIONS, |
| 1217 | 'size_units' => ['px', 'em'], |
| 1218 | 'selectors' => [ |
| 1219 | '{{WRAPPER}} .eael-infobox .infobox-button a.eael-infobox-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1220 | ], |
| 1221 | ] |
| 1222 | ); |
| 1223 | |
| 1224 | $this->add_control( |
| 1225 | 'eael_infobox_button_border_radius', |
| 1226 | [ |
| 1227 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 1228 | 'type' => Controls_Manager::SLIDER, |
| 1229 | 'range' => [ |
| 1230 | 'px' => [ |
| 1231 | 'max' => 100, |
| 1232 | ], |
| 1233 | ], |
| 1234 | 'selectors' => [ |
| 1235 | '{{WRAPPER}} .eael-infobox .infobox-button a.eael-infobox-button' => 'border-radius: {{SIZE}}px;', |
| 1236 | ], |
| 1237 | ] |
| 1238 | ); |
| 1239 | |
| 1240 | $this->start_controls_tabs('infobox_button_styles_controls_tabs'); |
| 1241 | |
| 1242 | $this->start_controls_tab('infobox_button_normal', [ |
| 1243 | 'label' => esc_html__('Normal', 'essential-addons-for-elementor-lite'), |
| 1244 | ]); |
| 1245 | |
| 1246 | $this->add_control( |
| 1247 | 'eael_infobox_button_text_color', |
| 1248 | [ |
| 1249 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1250 | 'type' => Controls_Manager::COLOR, |
| 1251 | 'default' => '#ffffff', |
| 1252 | 'selectors' => [ |
| 1253 | '{{WRAPPER}} .eael-infobox .eael-infobox-button' => 'color: {{VALUE}};', |
| 1254 | '{{WRAPPER}} .eael-infobox .eael-infobox-button svg' => 'fill: {{VALUE}};', |
| 1255 | ], |
| 1256 | ] |
| 1257 | ); |
| 1258 | |
| 1259 | $this->add_control( |
| 1260 | 'eael_infobox_button_background_color', |
| 1261 | [ |
| 1262 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1263 | 'type' => Controls_Manager::COLOR, |
| 1264 | 'default' => '#333333', |
| 1265 | 'selectors' => [ |
| 1266 | '{{WRAPPER}} .eael-infobox .eael-infobox-button' => 'background: {{VALUE}};', |
| 1267 | ], |
| 1268 | ] |
| 1269 | ); |
| 1270 | |
| 1271 | $this->add_group_control( |
| 1272 | Group_Control_Border::get_type(), |
| 1273 | [ |
| 1274 | 'name' => 'eael_infobox_button_border', |
| 1275 | 'selector' => '{{WRAPPER}} .eael-infobox .eael-infobox-button', |
| 1276 | ] |
| 1277 | ); |
| 1278 | |
| 1279 | $this->add_group_control( |
| 1280 | Group_Control_Box_Shadow::get_type(), |
| 1281 | [ |
| 1282 | 'name' => 'button_box_shadow', |
| 1283 | 'selector' => '{{WRAPPER}} .eael-infobox .eael-infobox-button', |
| 1284 | ] |
| 1285 | ); |
| 1286 | |
| 1287 | $this->end_controls_tab(); |
| 1288 | |
| 1289 | $this->start_controls_tab('infobox_button_hover', [ |
| 1290 | 'label' => esc_html__('Hover', 'essential-addons-for-elementor-lite'), |
| 1291 | ]); |
| 1292 | |
| 1293 | $this->add_control( |
| 1294 | 'eael_infobox_button_hover_text_color', |
| 1295 | [ |
| 1296 | 'label' => esc_html__('Text Color', 'essential-addons-for-elementor-lite'), |
| 1297 | 'type' => Controls_Manager::COLOR, |
| 1298 | 'default' => '#ffffff', |
| 1299 | 'selectors' => [ |
| 1300 | '{{WRAPPER}} .eael-infobox .eael-infobox-button:hover' => 'color: {{VALUE}};', |
| 1301 | '{{WRAPPER}} .eael-infobox .eael-infobox-button:hover svg' => 'fill: {{VALUE}};', |
| 1302 | ], |
| 1303 | ] |
| 1304 | ); |
| 1305 | |
| 1306 | $this->add_control( |
| 1307 | 'eael_infobox_button_hover_background_color', |
| 1308 | [ |
| 1309 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 1310 | 'type' => Controls_Manager::COLOR, |
| 1311 | 'default' => '#333333', |
| 1312 | 'selectors' => [ |
| 1313 | '{{WRAPPER}} .eael-infobox .eael-infobox-button:hover' => 'background: {{VALUE}};', |
| 1314 | ], |
| 1315 | ] |
| 1316 | ); |
| 1317 | |
| 1318 | $this->add_group_control( |
| 1319 | Group_Control_Border::get_type(), |
| 1320 | [ |
| 1321 | 'name' => 'eael_infobox_button_hover_border', |
| 1322 | 'selector' => '{{WRAPPER}} .eael-infobox .eael-infobox-button:hover', |
| 1323 | ] |
| 1324 | ); |
| 1325 | |
| 1326 | $this->add_group_control( |
| 1327 | Group_Control_Box_Shadow::get_type(), |
| 1328 | [ |
| 1329 | 'name' => 'button_hover_box_shadow', |
| 1330 | 'selector' => '{{WRAPPER}} .eael-infobox .eael-infobox-button:hover', |
| 1331 | ] |
| 1332 | ); |
| 1333 | |
| 1334 | $this->end_controls_tab(); |
| 1335 | |
| 1336 | $this->end_controls_tabs(); |
| 1337 | |
| 1338 | $this->end_controls_section(); |
| 1339 | |
| 1340 | /** |
| 1341 | * ------------------------------------------- |
| 1342 | * Tab Style (Info Box Title Style) |
| 1343 | * ------------------------------------------- |
| 1344 | */ |
| 1345 | $this->start_controls_section( |
| 1346 | 'eael_section_infobox_title_style_settings', |
| 1347 | [ |
| 1348 | 'label' => esc_html__('Color & Typography', 'essential-addons-for-elementor-lite'), |
| 1349 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1350 | ] |
| 1351 | ); |
| 1352 | |
| 1353 | $this->start_controls_tabs('infobox_content_hover_style_tab'); |
| 1354 | |
| 1355 | $this->start_controls_tab('infobox_content_normal_style', [ |
| 1356 | 'label' => esc_html__('Normal', 'essential-addons-for-elementor-lite'), |
| 1357 | ]); |
| 1358 | |
| 1359 | $this->add_control( |
| 1360 | 'eael_infobox_title_heading', |
| 1361 | [ |
| 1362 | 'label' => esc_html__('Title Style', 'essential-addons-for-elementor-lite'), |
| 1363 | 'type' => Controls_Manager::HEADING, |
| 1364 | ] |
| 1365 | ); |
| 1366 | |
| 1367 | $this->add_control( |
| 1368 | 'eael_infobox_title_color', |
| 1369 | [ |
| 1370 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1371 | 'type' => Controls_Manager::COLOR, |
| 1372 | 'default' => '#4d4d4d', |
| 1373 | 'selectors' => [ |
| 1374 | '{{WRAPPER}} .eael-infobox .infobox-content .title' => 'color: {{VALUE}};', |
| 1375 | ], |
| 1376 | ] |
| 1377 | ); |
| 1378 | |
| 1379 | $this->add_group_control( |
| 1380 | Group_Control_Typography::get_type(), |
| 1381 | [ |
| 1382 | 'name' => 'eael_infobox_title_typography', |
| 1383 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-content .title', |
| 1384 | ] |
| 1385 | ); |
| 1386 | |
| 1387 | $this->add_responsive_control( |
| 1388 | 'eael_infobox_title_margin', |
| 1389 | [ |
| 1390 | 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), |
| 1391 | 'type' => Controls_Manager::DIMENSIONS, |
| 1392 | 'size_units' => ['px', 'em', '%'], |
| 1393 | 'selectors' => [ |
| 1394 | '{{WRAPPER}} .eael-infobox .infobox-content .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1395 | ], |
| 1396 | ] |
| 1397 | ); |
| 1398 | $this->add_control( |
| 1399 | 'eael_infobox_content_heading', |
| 1400 | [ |
| 1401 | 'label' => esc_html__('Content Style', 'essential-addons-for-elementor-lite'), |
| 1402 | 'type' => Controls_Manager::HEADING, |
| 1403 | 'separator' => 'before', |
| 1404 | ] |
| 1405 | ); |
| 1406 | |
| 1407 | $this->add_responsive_control( |
| 1408 | 'eael_infobox_content_margin', |
| 1409 | [ |
| 1410 | 'label' => esc_html__('Content Only Margin', 'essential-addons-for-elementor-lite'), |
| 1411 | 'type' => Controls_Manager::DIMENSIONS, |
| 1412 | 'size_units' => ['px', 'em', '%'], |
| 1413 | 'selectors' => [ |
| 1414 | '{{WRAPPER}} .eael-infobox .infobox-content p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1415 | ], |
| 1416 | ] |
| 1417 | ); |
| 1418 | |
| 1419 | $this->add_control( |
| 1420 | 'eael_infobox_content_background', |
| 1421 | [ |
| 1422 | 'label' => esc_html__('Content Only Background', 'essential-addons-for-elementor-lite'), |
| 1423 | 'type' => Controls_Manager::COLOR, |
| 1424 | 'default' => '', |
| 1425 | 'selectors' => [ |
| 1426 | '{{WRAPPER}} .eael-infobox .infobox-content' => 'background: {{VALUE}};', |
| 1427 | ], |
| 1428 | ] |
| 1429 | ); |
| 1430 | |
| 1431 | $this->add_responsive_control( |
| 1432 | 'eael_infobox_content_only_padding', |
| 1433 | [ |
| 1434 | 'label' => esc_html__('Content Only Padding', 'essential-addons-for-elementor-lite'), |
| 1435 | 'type' => Controls_Manager::DIMENSIONS, |
| 1436 | 'size_units' => ['px', 'em', '%'], |
| 1437 | 'selectors' => [ |
| 1438 | '{{WRAPPER}} .eael-infobox .infobox-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1439 | ], |
| 1440 | ] |
| 1441 | ); |
| 1442 | |
| 1443 | $this->add_control( |
| 1444 | 'eael_infobox_content_color', |
| 1445 | [ |
| 1446 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 1447 | 'type' => Controls_Manager::COLOR, |
| 1448 | 'default' => '#4d4d4d', |
| 1449 | 'selectors' => [ |
| 1450 | '{{WRAPPER}} .eael-infobox .infobox-content p' => 'color: {{VALUE}};', |
| 1451 | ], |
| 1452 | ] |
| 1453 | ); |
| 1454 | |
| 1455 | $this->add_group_control( |
| 1456 | Group_Control_Typography::get_type(), |
| 1457 | [ |
| 1458 | 'name' => 'eael_infobox_content_typography_hover', |
| 1459 | 'selector' => '{{WRAPPER}} .eael-infobox .infobox-content p', |
| 1460 | ] |
| 1461 | ); |
| 1462 | |
| 1463 | $this->end_controls_tab(); |
| 1464 | |
| 1465 | $this->start_controls_tab('infobox_content_hover_style', [ |
| 1466 | 'label' => esc_html__('Hover', 'essential-addons-for-elementor-lite'), |
| 1467 | ]); |
| 1468 | |
| 1469 | $this->add_control( |
| 1470 | 'eael_infobox_title_hover_color', |
| 1471 | [ |
| 1472 | 'label' => esc_html__('Title Color', 'essential-addons-for-elementor-lite'), |
| 1473 | 'type' => Controls_Manager::COLOR, |
| 1474 | 'default' => '', |
| 1475 | 'selectors' => [ |
| 1476 | '{{WRAPPER}} .eael-infobox:hover .infobox-content .title' => 'color: {{VALUE}};', |
| 1477 | ], |
| 1478 | ] |
| 1479 | ); |
| 1480 | |
| 1481 | $this->add_control( |
| 1482 | 'eael_infobox_content_hover_color', |
| 1483 | [ |
| 1484 | 'label' => esc_html__('Content Color', 'essential-addons-for-elementor-lite'), |
| 1485 | 'type' => Controls_Manager::COLOR, |
| 1486 | 'default' => '', |
| 1487 | 'selectors' => [ |
| 1488 | '{{WRAPPER}} .eael-infobox:hover .infobox-content p' => 'color: {{VALUE}};', |
| 1489 | ], |
| 1490 | ] |
| 1491 | ); |
| 1492 | |
| 1493 | $this->add_control( |
| 1494 | 'eael_infobox_content_transition', |
| 1495 | [ |
| 1496 | 'label' => esc_html__('Transition', 'essential-addons-for-elementor-lite'), |
| 1497 | 'description' => esc_html__('Transition will applied to ms (ex: 300ms).', 'essential-addons-for-elementor-lite'), |
| 1498 | 'type' => Controls_Manager::NUMBER, |
| 1499 | 'separator' => 'before', |
| 1500 | 'min' => 100, |
| 1501 | 'max' => 1000, |
| 1502 | 'default' => 100, |
| 1503 | 'selectors' => [ |
| 1504 | '{{WRAPPER}} .eael-infobox:hover .infobox-content h4' => 'transition: {{SIZE}}ms;', |
| 1505 | '{{WRAPPER}} .eael-infobox:hover .infobox-content p' => 'transition: {{SIZE}}ms;', |
| 1506 | ], |
| 1507 | ] |
| 1508 | ); |
| 1509 | |
| 1510 | $this->end_controls_tab(); |
| 1511 | |
| 1512 | $this->end_controls_tabs(); |
| 1513 | |
| 1514 | $this->end_controls_section(); |
| 1515 | } |
| 1516 | |
| 1517 | /** |
| 1518 | * This function is responsible for rendering divs and contents |
| 1519 | * for infobox before partial. |
| 1520 | */ |
| 1521 | protected function eael_infobox_before() |
| 1522 | { |
| 1523 | $settings = $this->get_settings_for_display(); |
| 1524 | |
| 1525 | $this->add_render_attribute('eael_infobox_inner', 'class', 'eael-infobox'); |
| 1526 | |
| 1527 | if ('img-on-left' == $settings['eael_infobox_img_type']) { |
| 1528 | $this->add_render_attribute('eael_infobox_inner', 'class', 'icon-on-left'); |
| 1529 | } |
| 1530 | |
| 1531 | if ('img-on-right' == $settings['eael_infobox_img_type']) { |
| 1532 | $this->add_render_attribute('eael_infobox_inner', 'class', 'icon-on-right'); |
| 1533 | } |
| 1534 | |
| 1535 | if ( ! empty( $settings['eael_show_infobox_clickable_link']['url'] ) ) { |
| 1536 | $this->add_link_attributes( 'infobox_clickable_link', $settings['eael_show_infobox_clickable_link'] ); |
| 1537 | } |
| 1538 | |
| 1539 | ob_start(); |
| 1540 | |
| 1541 | if ( 'yes' == $settings['eael_show_infobox_clickable'] ) { ?> |
| 1542 | <a <?php echo $this->get_render_attribute_string( 'infobox_clickable_link' ); ?>> |
| 1543 | <?php } ?> |
| 1544 | <div <?php echo $this->get_render_attribute_string( 'eael_infobox_inner' ); ?>> |
| 1545 | <?php |
| 1546 | echo ob_get_clean(); |
| 1547 | } |
| 1548 | |
| 1549 | /** |
| 1550 | * This function is rendering closing divs and tags |
| 1551 | * of before partial for infobox. |
| 1552 | */ |
| 1553 | protected function eael_infobox_after() { |
| 1554 | $settings = $this->get_settings_for_display(); |
| 1555 | ob_start(); ?> |
| 1556 | </div> |
| 1557 | |
| 1558 | <?php |
| 1559 | if ( 'yes' == $settings['eael_show_infobox_clickable'] ) { ?> |
| 1560 | </a> |
| 1561 | <?php } |
| 1562 | |
| 1563 | echo ob_get_clean(); |
| 1564 | } |
| 1565 | |
| 1566 | /** |
| 1567 | * This function is rendering appropriate icon for infobox. |
| 1568 | */ |
| 1569 | protected function render_infobox_icon() |
| 1570 | { |
| 1571 | $settings = $this->get_settings_for_display(); |
| 1572 | |
| 1573 | if ('none' == $settings['eael_infobox_img_or_icon']) { |
| 1574 | return; |
| 1575 | } |
| 1576 | |
| 1577 | $infobox_image = $this->get_settings('eael_infobox_image'); |
| 1578 | $infobox_image_url = Group_Control_Image_Size::get_attachment_image_src($infobox_image['id'], 'thumbnail', $settings); |
| 1579 | if (empty($infobox_image_url)){ |
| 1580 | $infobox_image_url = $infobox_image['url']; |
| 1581 | } |
| 1582 | |
| 1583 | $infobox_icon_migrated = isset($settings['__fa4_migrated']['eael_infobox_icon_new']); |
| 1584 | $infobox_icon_is_new = empty($settings['eael_infobox_icon']); |
| 1585 | |
| 1586 | $this->add_render_attribute( |
| 1587 | 'infobox_icon', |
| 1588 | [ |
| 1589 | 'class' => ['infobox-icon'], |
| 1590 | ] |
| 1591 | ); |
| 1592 | |
| 1593 | if ($settings['eael_infobox_icon_hover_animation']) { |
| 1594 | $this->add_render_attribute('infobox_icon', 'class', 'elementor-animation-' . $settings['eael_infobox_icon_hover_animation']); |
| 1595 | } |
| 1596 | |
| 1597 | if ($settings['eael_infobox_image_icon_hover_animation']) { |
| 1598 | $this->add_render_attribute('infobox_icon', 'class', 'elementor-animation-' . $settings['eael_infobox_image_icon_hover_animation']); |
| 1599 | } |
| 1600 | |
| 1601 | if ($settings['eael_infobox_number_icon_hover_animation']) { |
| 1602 | $this->add_render_attribute('infobox_icon', 'class', 'elementor-animation-' . $settings['eael_infobox_number_icon_hover_animation']); |
| 1603 | } |
| 1604 | |
| 1605 | if ('icon' == $settings['eael_infobox_img_or_icon']) { |
| 1606 | $this->add_render_attribute('infobox_icon', 'class', 'eael-icon-only'); |
| 1607 | } |
| 1608 | |
| 1609 | if ($infobox_icon_is_new || $infobox_icon_migrated) { |
| 1610 | $icon = $this->get_settings('eael_infobox_icon_new')['value']; |
| 1611 | if (isset($icon['url'])) { |
| 1612 | ob_start(); |
| 1613 | Icons_Manager::render_icon( $settings['eael_infobox_icon_new'], [ 'aria-hidden' => 'true' ] ); |
| 1614 | $icon_tag = ob_get_clean(); |
| 1615 | } else { |
| 1616 | $this->add_render_attribute('icon_or_image', 'class', $icon); |
| 1617 | $icon_tag = '<i ' . $this->get_render_attribute_string('icon_or_image') . '></i>'; |
| 1618 | } |
| 1619 | } else { |
| 1620 | $icon_tag = '<i class="' . esc_attr($settings['eael_infobox_icon']) . '"></i>'; |
| 1621 | } |
| 1622 | |
| 1623 | ob_start(); |
| 1624 | ?> |
| 1625 | <div <?php echo $this->get_render_attribute_string('infobox_icon'); ?>> |
| 1626 | |
| 1627 | <?php if ('img' == $settings['eael_infobox_img_or_icon']): ?> |
| 1628 | <img src="<?php echo esc_url($infobox_image_url); ?>" alt="<?php echo esc_attr(get_post_meta($infobox_image['id'], '_wp_attachment_image_alt', true)); ?>"> |
| 1629 | <?php endif;?> |
| 1630 | |
| 1631 | <?php if ('icon' == $settings['eael_infobox_img_or_icon']): ?> |
| 1632 | <div class="infobox-icon-wrap"> |
| 1633 | <?php Icons_Manager::render_icon( $settings['eael_infobox_icon_new'], [ 'aria-hidden' => 'true' ] ); ?> |
| 1634 | </div> |
| 1635 | <?php endif;?> |
| 1636 | |
| 1637 | <?php if ('number' == $settings['eael_infobox_img_or_icon']): ?> |
| 1638 | <div class="infobox-icon-wrap"> |
| 1639 | <span class="infobox-icon-number"><?php echo esc_attr($settings['eael_infobox_number']); ?></span> |
| 1640 | </div> |
| 1641 | <?php endif;?> |
| 1642 | |
| 1643 | </div> |
| 1644 | <?php |
| 1645 | echo ob_get_clean(); |
| 1646 | } |
| 1647 | |
| 1648 | protected function render_infobox_content() |
| 1649 | { |
| 1650 | $settings = $this->get_settings_for_display(); |
| 1651 | |
| 1652 | $this->add_render_attribute('infobox_content', 'class', 'infobox-content'); |
| 1653 | if ('icon' == $settings['eael_infobox_img_or_icon']) { |
| 1654 | $this->add_render_attribute('infobox_content', 'class', 'eael-icon-only'); |
| 1655 | } |
| 1656 | |
| 1657 | ob_start(); |
| 1658 | ?> |
| 1659 | <div <?php echo $this->get_render_attribute_string('infobox_content'); ?>> |
| 1660 | <?php if ( !empty( $settings['eael_infobox_title'] ) ): ?> |
| 1661 | <<?php echo Helper::eael_validate_html_tag( $settings['eael_infobox_title_tag'] ); ?> class="title"><?php echo Helper::eael_wp_kses($settings['eael_infobox_title']); ?></<?php echo Helper::eael_validate_html_tag( $settings['eael_infobox_title_tag'] ); ?>> |
| 1662 | <?php |
| 1663 | endif; |
| 1664 | if ('yes' == $settings['eael_show_infobox_content']): ?> |
| 1665 | <?php if ('content' === $settings['eael_infobox_text_type']): ?> |
| 1666 | <?php if (!empty($settings['eael_infobox_text'])): ?> |
| 1667 | <p><?php echo $settings['eael_infobox_text']; ?></p> |
| 1668 | <?php endif;?> |
| 1669 | <?php $this->render_infobox_button();?> |
| 1670 | <?php elseif ('template' === $settings['eael_infobox_text_type']): |
| 1671 | if ( ! empty( $settings['eael_primary_templates'] ) ) { |
| 1672 | // WPML Compatibility |
| 1673 | if ( ! is_array( $settings['eael_primary_templates'] ) ) { |
| 1674 | $settings['eael_primary_templates'] = apply_filters( 'wpml_object_id', $settings['eael_primary_templates'], 'wp_template', true ); |
| 1675 | } |
| 1676 | echo Plugin::$instance->frontend->get_builder_content( $settings['eael_primary_templates'], true ); |
| 1677 | } |
| 1678 | endif;?> |
| 1679 | <?php endif;?> |
| 1680 | </div> |
| 1681 | <?php |
| 1682 | |
| 1683 | echo ob_get_clean(); |
| 1684 | } |
| 1685 | |
| 1686 | /** |
| 1687 | * This function rendering infobox button |
| 1688 | */ |
| 1689 | protected function render_infobox_button() |
| 1690 | { |
| 1691 | $settings = $this->get_settings_for_display(); |
| 1692 | if ('yes' == $settings['eael_show_infobox_clickable'] || 'yes' != $settings['eael_show_infobox_button']) { |
| 1693 | return; |
| 1694 | } |
| 1695 | |
| 1696 | $button_icon_migrated = isset($settings['__fa4_migrated']['eael_infobox_button_icon_new']); |
| 1697 | $button_icon_is_new = empty($settings['eael_infobox_button_icon']); |
| 1698 | |
| 1699 | $this->add_render_attribute('infobox_button', 'class', 'eael-infobox-button'); |
| 1700 | |
| 1701 | if ( ! empty( $settings['infobox_button_link_url']['url'] ) ) { |
| 1702 | $this->add_link_attributes( 'infobox_button', $settings['infobox_button_link_url'] ); |
| 1703 | } |
| 1704 | |
| 1705 | ob_start(); |
| 1706 | ?> |
| 1707 | <div class="infobox-button"> |
| 1708 | <a <?php echo $this->get_render_attribute_string('infobox_button'); ?>> |
| 1709 | <?php if ('left' == $settings['eael_infobox_button_icon_alignment']): ?> |
| 1710 | <?php if ($button_icon_is_new || $button_icon_migrated) {?> |
| 1711 | <?php if (isset($settings['eael_infobox_button_icon_new']['value']['url'])) {?> |
| 1712 | <img class="eael_infobox_button_icon_left" src="<?php echo esc_attr($settings['eael_infobox_button_icon_new']['value']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($settings['eael_infobox_button_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" /> |
| 1713 | <?php } else { |
| 1714 | Icons_Manager::render_icon( $settings['eael_infobox_button_icon_new'], [ 'aria-hidden' => 'true', 'class' => 'eael_infobox_button_icon_left' ] ); |
| 1715 | }?> |
| 1716 | <?php } else { |
| 1717 | Icons_Manager::render_icon( $settings['eael_infobox_button_icon'], [ 'aria-hidden' => 'true' ] ); |
| 1718 | }?> |
| 1719 | <?php endif;?> |
| 1720 | <span class="infobox-button-text"><?php echo esc_attr($settings['infobox_button_text']); ?></span> |
| 1721 | <?php if ('right' == $settings['eael_infobox_button_icon_alignment']): ?> |
| 1722 | <?php if ($button_icon_is_new || $button_icon_migrated) {?> |
| 1723 | <?php if (isset($settings['eael_infobox_button_icon_new']['value']['url'])) {?> |
| 1724 | <img class="eael_infobox_button_icon_right" src="<?php echo esc_attr($settings['eael_infobox_button_icon_new']['value']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($settings['eael_infobox_button_icon_new']['value']['id'], '_wp_attachment_image_alt', true)); ?>" /> |
| 1725 | <?php } else { |
| 1726 | Icons_Manager::render_icon( $settings['eael_infobox_button_icon_new'], [ 'aria-hidden' => 'true', 'class' => 'eael_infobox_button_icon_right' ] ); |
| 1727 | }?> |
| 1728 | <?php } else { |
| 1729 | |
| 1730 | if ('left' == $settings['eael_infobox_button_icon_alignment']) { |
| 1731 | $this->add_render_attribute('button_icon', 'class', 'eael_infobox_button_icon_left'); |
| 1732 | } |
| 1733 | |
| 1734 | if ('right' == $settings['eael_infobox_button_icon_alignment']) { |
| 1735 | $this->add_render_attribute('button_icon', 'class', 'eael_infobox_button_icon_right'); |
| 1736 | } |
| 1737 | |
| 1738 | $this->add_render_attribute( |
| 1739 | 'button_icon', |
| 1740 | [ |
| 1741 | 'class' => [ |
| 1742 | 'eael_infobox_button_icon_right', |
| 1743 | $settings['eael_infobox_button_icon'], |
| 1744 | ], |
| 1745 | ] |
| 1746 | ); |
| 1747 | ?> |
| 1748 | <i <?php echo $this->get_render_attribute_string('button_icon'); ?>></i> |
| 1749 | <?php }?> |
| 1750 | <?php endif;?> |
| 1751 | </a> |
| 1752 | </div> |
| 1753 | <?php |
| 1754 | echo ob_get_clean(); |
| 1755 | } |
| 1756 | |
| 1757 | protected function render() |
| 1758 | { |
| 1759 | $this->eael_infobox_before(); |
| 1760 | $this->render_infobox_icon(); |
| 1761 | $this->render_infobox_content(); |
| 1762 | $this->eael_infobox_after(); |
| 1763 | } |
| 1764 | } |
| 1765 |