PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
widgets
<?php /** * Contact Widget */ namespace Elementor; class Tryo_Contact_Card extends Widget_Base { public function get_name() { return 'Contact_Card'; } public function get_title() { return __( 'Contact Card', 'tryo-toolkit' ); } public function get_icon() { return 'eicon-tel-field'; } public function get_categories() { return [ 'tryo-elements' ]; } protected function _register_controls() { $this->start_controls_section( 'Tryo_Contact_Card', [ 'label' => __( 'Contact Card', 'tryo-toolkit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'list_items', [ 'label' => esc_html__('Card Info', 'tryo-toolkit'), 'type' => Controls_Manager::REPEATER, 'separator' => 'before', 'fields' => [ [ 'name' => 'font_type', 'label' => __( 'Font Type', 'tryo-toolkit' ), 'type' => Controls_Manager::SELECT, 'default' => 'flat-icon', 'options' => [ 'flat-icon' => __( 'Flat-Icon', 'tryo-toolkit' ), 'fa-icon' => __( 'Font-Awesome', 'tryo-toolkit' ), ], ], [ 'name' => 'flat-icon', 'label' => __( 'Flat Icons', 'tryo-toolkit' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'flaticon-piggy-bank' => __('piggy-bank', 'tryo-toolkit' ), 'flaticon-data-encryption' => __('data-encryption', 'tryo-toolkit' ), 'flaticon-wallet' => __('wallet', 'tryo-toolkit' ), 'flaticon-shield' => __('shield', 'tryo-toolkit' ), 'flaticon-user' => __('user', 'tryo-toolkit' ), 'flaticon-check-mark' => __('check-mark', 'tryo-toolkit' ), 'flaticon-settings' => __('settings', 'tryo-toolkit' ), 'flaticon-envelope-of-white-paper' => __('envelope-of-white-paper', 'tryo-toolkit' ), 'flaticon-menu' => __('menu', 'tryo-toolkit' ), 'flaticon-info' => __('info', 'tryo-toolkit' ), 'flaticon-cursor' => __('cursor', 'tryo-toolkit' ), 'flaticon-alarm' => __('alarm', 'tryo-toolkit' ), 'flaticon-cancel' => __('cancel', 'tryo-toolkit' ), 'flaticon-apple' => __('apple', 'tryo-toolkit' ), 'flaticon-play-store' => __('play-store', 'tryo-toolkit' ), ], 'condition' => [ 'font_type' => 'flat-icon', ] ], [ 'name' => 'icon', 'label' => __( 'Icons', 'tryo-toolkit' ), 'type' => Controls_Manager::ICON, 'condition' => [ 'font_type' => 'fa-icon', ] ], [ 'name' => 'title', 'label' => esc_html__('Title', 'tryo-toolkit'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Phone / Fax', 'tryo-toolkit'), 'label_block' => true, ], [ 'name' => 'content', 'label' => __( 'Content', 'tryo-toolkit' ), 'type' => Controls_Manager::WYSIWYG, ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'card_style', [ 'label' => __( 'Style', 'tryo-toolkit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'cc_icon_size', [ 'label' => __( 'Card Icon Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 5, 'max' => 25, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .contact-info ul li .icon' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_control( 'title_color', [ 'label' => __( 'Title Color', 'tryo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .contact-info ul li span' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'title_size', [ 'label' => __( 'Title Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .contact-info ul li span' => 'font-size: {{SIZE}}px;', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $this-> add_inline_editing_attributes('title','none'); $lists = $settings['list_items']; ?> <div class="contact-info"> <ul> <?php foreach( $lists as $list ): if( $list['font_type'] == 'flat-icon') { $icon = $list['flat-icon']; }else { $icon = $list['icon']; } ?> <li> <?php if( $icon != '' ): ?> <div class="icon"> <i class="<?php echo esc_attr( $icon ); ?>"></i> </div> <?php endif; ?> <span><?php echo esc_html( $list['title'] ); ?></span> <?php echo $list['content'] ?> </li> <?php endforeach; ?> </ul> </div> <?php } protected function _content_template() {} } Plugin::instance()->widgets_manager->register_widget_type( new Tryo_Contact_Card );
[-] banner-feature.php
[edit]
[-] profile-form.php
[edit]
[-] business-area.php
[edit]
[-] services-two.php
[edit]
[-] banner-two.php
[edit]
[-] signup.php
[edit]
[+]
..
[-] payment-experience-area.php
[edit]
[-] post.php
[edit]
[-] works.php
[edit]
[-] account-create.php
[edit]
[-] comparisons-table.php
[edit]
[-] partner-slider.php
[edit]
[-] app-download.php
[edit]
[-] feature-box.php
[edit]
[-] team.php
[edit]
[-] global-area.php
[edit]
[-] userinfo-details.php
[edit]
[-] banner-three.php
[edit]
[-] pricing.php
[edit]
[-] success-story-area.php
[edit]
[-] contact-card.php
[edit]
[-] contact-cta-box.php
[edit]
[-] services-area.php
[edit]
[-] ready-to-talk.php
[edit]
[-] section.php
[edit]
[-] receive-details.php
[edit]
[-] about-area.php
[edit]
[-] banner-four.php
[edit]
[-] send-details.php
[edit]
[-] support-area.php
[edit]
[-] invoicing.php
[edit]
[-] testimonials.php
[edit]
[-] funfact.php
[edit]
[-] signin.php
[edit]
[-] information-box.php
[edit]
[-] new-payment.php
[edit]
[-] banner-one.php
[edit]
[-] feedback-card.php
[edit]
[-] feature.php
[edit]