D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
www
/
lalpathamroha.site
/
wp-content
/
plugins
/
tp-core
/
include
/
elementor
/
Filename :
footer.php
back
Copy
<?php namespace TPCore\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Image_Size; use \Elementor\Repeater; use \Elementor\Utils; use TPCore\Elementor\Controls\Group_Control_TPBGGradient; use TPCore\Elementor\Controls\Group_Control_TPGradient; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * Tp Core * * Elementor widget for hello world. * * @since 1.0.0 */ class Footer_Widget extends Widget_Base { use \TPCore\Widgets\TPCoreElementFunctions; /** * Retrieve the widget name. * * @since 1.0.0 * * @access public * * @return string Widget name. */ public function get_name() { return 'footer-three'; } /** * Retrieve the widget title. * * @since 1.0.0 * * @access public * * @return string Widget title. */ public function get_title() { return __( 'Footer Three', 'tpcore' ); } /** * Retrieve the widget icon. * * @since 1.0.0 * * @access public * * @return string Widget icon. */ public function get_icon() { return 'tp-icon'; } /** * Retrieve the list of categories the widget belongs to. * * Used to determine where to display the widget in the editor. * * Note that currently Elementor supports only one category. * When multiple categories passed, Elementor uses the first one. * * @since 1.0.0 * * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'tpcore' ]; } /** * Retrieve the list of scripts the widget depended on. * * Used to set scripts dependencies required to run the widget. * * @since 1.0.0 * * @access public * * @return array Widget scripts dependencies. */ public function get_script_depends() { return [ 'tpcore' ]; } public function get_tp_contact_form(){ if ( ! class_exists( 'WPCF7' ) ) { return; } $tp_cfa = array(); $tp_cf_args = array( 'posts_per_page' => -1, 'post_type'=> 'wpcf7_contact_form' ); $tp_forms = get_posts( $tp_cf_args ); $tp_cfa = ['0' => esc_html__( 'Select Form', 'tpcore' ) ]; if( $tp_forms ){ foreach ( $tp_forms as $tp_form ){ $tp_cfa[$tp_form->ID] = $tp_form->post_title; } }else{ $tp_cfa[ esc_html__( 'No contact form found', 'tpcore' ) ] = 0; } return $tp_cfa; } /** * Register the widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * * @access protected */ protected function register_controls(){ $this->register_controls_section(); $this->style_tab_content(); } protected function register_controls_section() { $this->start_controls_section( 'tpcore_newsletter', [ 'label' => esc_html__('Newsletter', 'tpcore'), ] ); $this->add_control( 'tp_title', [ 'label' => esc_html__('Title', 'tpcore'), 'type' => Controls_Manager::TEXT, 'description' => tp_get_allowed_html_desc( 'intermediate' ), 'default' => esc_html__('TP Title Here', 'tpcore'), 'placeholder' => esc_html__('Type Heading Text', 'tpcore'), 'label_block' => true, ] ); $this->add_control( 'tp_sub_title', [ 'label' => esc_html__('Sub Title', 'tpcore'), 'type' => Controls_Manager::TEXT, 'description' => tp_get_allowed_html_desc( 'intermediate' ), 'default' => esc_html__('TP Sub Title Here', 'tpcore'), 'placeholder' => esc_html__('Type Heading Text', 'tpcore'), 'label_block' => true, ] ); $this->add_control( 'tpcore_select_contact_form', [ 'label' => esc_html__( 'Select Form', 'tpcore' ), 'type' => Controls_Manager::SELECT, 'default' => '0', 'options' => $this->get_tp_contact_form(), ] ); $this->end_controls_section(); // contact group $this->start_controls_section( 'tp_contact', [ 'label' => esc_html__('Contact List', 'tpcore'), 'description' => esc_html__( 'Control all the style settings from Style tab', 'tpcore' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'tp_contact_icon_type', [ 'label' => esc_html__('Select Icon Type', 'tpcore'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'icon', 'options' => [ 'image' => esc_html__('Image', 'tpcore'), 'icon' => esc_html__('Icon', 'tpcore'), ], ] ); $repeater->add_control( 'tp_contact_image', [ 'label' => esc_html__('Upload Icon Image', 'tpcore'), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'condition' => [ 'tp_contact_icon_type' => 'image' ] ] ); if (tp_is_elementor_version('<', '2.6.0')) { $repeater->add_control( 'tp_contact_icon', [ 'show_label' => false, 'type' => Controls_Manager::ICON, 'label_block' => true, 'default' => 'fa fa-star', 'condition' => [ 'tp_contact_icon_type' => 'icon' ] ] ); } else { $repeater->add_control( 'tp_contact_selected_icon', [ 'show_label' => false, 'type' => Controls_Manager::ICONS, 'fa4compatibility' => 'icon', 'label_block' => true, 'default' => [ 'value' => 'fas fa-star', 'library' => 'solid', ], 'condition' => [ 'tp_contact_icon_type' => 'icon' ] ] ); } $repeater->add_control( 'tp_contact_title', [ 'label' => esc_html__('Title', 'tpcore'), 'description' => tp_get_allowed_html_desc( 'basic' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__('contact Title', 'tpcore'), 'label_block' => true, ] ); $repeater->add_control( 'tp_creative_anima_switcher', [ 'label' => esc_html__( 'Active Animation', 'plugin-name' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'tpcore' ), 'label_off' => esc_html__( 'No', 'tpcore' ), 'return_value' => 'yes', 'default' => 'yes', 'separator' => 'before', ] ); $repeater->add_control( 'tp_anima_delay', [ 'label' => esc_html__('Animation Delay', 'tpcore'), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__('0.2s', 'tpcore'), 'condition' => ['tp_creative_anima_switcher' => 'yes'], ] ); $repeater->add_control( 'want_customize', [ 'label' => esc_html__( 'Want To Customize?', 'tpcore' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', 'tpcore' ), 'label_off' => esc_html__( 'No', 'tpcore' ), 'return_value' => 'yes', 'description' => esc_html__( 'You can customize this skill bar color from here or customize from Style tab', 'tpcore' ), 'style_transfer' => true, ] ); $repeater->add_control( 'color_bg_color', [ 'label' => esc_html__( 'Icon BG Color', 'tpcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .footercontact__icon' => 'background-color: {{VALUE}};', ], 'condition' => ['want_customize' => 'yes'], 'style_transfer' => true, ] ); $repeater->add_control( 'color_hover_bg_color', [ 'label' => esc_html__( 'Icon Hover BG Color', 'tpcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}:hover .footercontact__icon' => 'box-shadow: inset 0 0 0 50px {{VALUE}};', ], 'condition' => ['want_customize' => 'yes'], 'style_transfer' => true, ] ); $repeater->add_control( 'color_color', [ 'label' => esc_html__( 'Icon Color', 'tpcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .footercontact__icon, {{WRAPPER}} {{CURRENT_ITEM}} .footercontact__title a:hover' => 'color: {{VALUE}};', ], 'condition' => ['want_customize' => 'yes'], 'style_transfer' => true, ] ); $repeater->add_control( 'color_hover_color', [ 'label' => esc_html__( 'Icon hover color', 'tpcore' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}:hover .footercontact__icon' => 'color: {{VALUE}};', ], 'condition' => ['want_customize' => 'yes'], 'style_transfer' => true, ] ); $this->add_control( 'tp_contact_list', [ 'label' => esc_html__('contacts - List', 'tpcore'), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'tp_contact_title' => esc_html__('Business Stratagy', 'tpcore'), ], [ 'tp_contact_title' => esc_html__('Website Development', 'tpcore') ], [ 'tp_contact_title' => esc_html__('Marketing & Reporting', 'tpcore') ] ], 'title_field' => '{{{ tp_contact_title }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'tpcore_bottom', [ 'label' => esc_html__('Footer Bottom', 'tpcore'), ] ); $this->add_control( 'tp_copyright', [ 'label' => esc_html__('Copyright Text', 'tpcore'), 'type' => Controls_Manager::TEXTAREA, 'description' => tp_get_allowed_html_desc( 'intermediate' ), 'default' => esc_html__('All right reserved', 'tpcore'), 'placeholder' => esc_html__('Type Copyright Text', 'tpcore'), 'label_block' => true, ] ); $this->add_control( 'tp_bottom_text', [ 'label' => esc_html__('Bottom Link Text', 'tpcore'), 'type' => Controls_Manager::TEXTAREA, 'description' => tp_get_allowed_html_desc( 'intermediate' ), 'default' => esc_html__('Write bottom link', 'tpcore'), 'placeholder' => esc_html__('Type Bottom Link Text', 'tpcore'), 'label_block' => true, ] ); $this->end_controls_section(); } // style_tab_content protected function style_tab_content(){ $this->tp_section_style_controls('footer_three_section', 'Section Style', '.ele-section'); $this->tp_basic_style_controls('footer_three_title', 'Title Style', '.ele-title'); $this->tp_basic_style_controls('footer_three_sub_title', 'Subtitle Style', '.ele-subtitle'); $this->tp_icon_style('footer_three_item_icon', 'Item Icon Style', '.ele-item-icon'); $this->tp_basic_style_controls('footer_three_item_content', 'Item Content Style', '.ele-item-content'); $this->tp_basic_style_controls('footer_copyright', 'Copyright Style', '.ele-footer-copyright'); $this->tp_link_controls_style_2('footer_bottom_link', 'Bottom Link Style', '.ele-bottom-link a'); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); ?> <footer> <div class="footer-area tp-common-area footer-white-content theme-bg pt-105 ele-section" > <div class="tp-footer-top pb-25"> <div class="container"> <div class="row"> <div class="col-lg-7 col-md-6"> <div class="footernewsletter mb-40 wow fadeInUp" data-wow-delay=".2s"> <?php if(!empty($settings['tp_title'])) : ?> <h4 class="footernewsletter__title ele-title"><?php echo tp_kses($settings['tp_title']); ?></h4> <?php endif; ?> <?php if(!empty($settings['tp_sub_title'])) : ?> <p class="ele-subtitle"><?php echo tp_kses($settings['tp_sub_title']); ?></p> <?php endif; ?> </div> </div> <div class="col-lg-5 col-md-6"> <div class="footernewsletter__form p-relative wow fadeInUp" data-wow-delay=".4s"> <?php if( !empty($settings['tpcore_select_contact_form']) ) : ?> <?php echo do_shortcode( '[contact-form-7 id="'.$settings['tpcore_select_contact_form'].'"]' ); ?> <?php else : ?> <?php echo '<div class="alert alert-info"><p class="m-0">' . __('Please Select contact form.', 'tpcore' ). '</p></div>'; ?> <?php endif; ?> </div> </div> </div> <div class="row pb-40 pt-50"> <?php foreach ($settings['tp_contact_list'] as $key => $item) : ?> <div class="col-lg-4 col-md-6"> <?php if(!empty($item['tp_creative_anima_switcher'])) : ?> <div class="footercontact mb-40 wow fadeInUp elementor-repeater-item-<?php echo esc_attr($item['_id']); ?>" data-wow-delay="<?php echo esc_attr($item['tp_anima_delay']);?>"> <?php else : ?> <div class="footercontact mb-40 elementor-repeater-item-<?php echo esc_attr($item['_id']); ?>"> <?php endif; ?> <?php if($item['tp_contact_icon_type'] !== 'image') : ?> <?php if (!empty($item['tp_contact_icon']) || !empty($item['tp_contact_selected_icon']['value'])) : ?> <div class="footercontact__icon ele-item-icon"> <?php tp_render_icon($item, 'tp_contact_icon', 'tp_contact_selected_icon'); ?> </div> <?php endif; ?> <?php else : ?> <div class="footercontact__icon ele-item-icon"> <img src="<?php echo $item['tp_contact_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($item['tp_contact_image']['url']), '_wp_attachment_image_alt', true); ?>"> </div> <?php endif; ?> <div class="footercontact__content"> <?php if(!empty($item['tp_contact_title'])) : ?> <span class="footercontact__title ele-item-content"><?php echo tp_kses($item['tp_contact_title']); ?></span> <?php endif; ?> </div> </div> </div> <?php endforeach; ?> </div> </div> </div> <div class="footer-area-bottom-tp"> <div class="container"> <div class="footer-bottom-border"> <div class="row"> <div class="col-xxl-6 col-xl-7 col-lg-6 col-md-12 col-12"> <?php if(!empty($settings['tp_copyright'])) : ?> <div class="footer-widget__copyright cpy-white-content"> <span class="ele-footer-copyright"><?php echo tp_kses($settings['tp_copyright']); ?></span> </div> <?php endif; ?> </div> <div class="col-xxl-6 col-xl-5 col-lg-6 col-md-12 col-12"> <div class="footer-widget__copyright-info info-direction cpy-white-content-info ele-bottom-link"> <?php if(!empty($settings['tp_bottom_text'])) : ?> <?php echo tp_kses($settings['tp_bottom_text']);?> <?php endif; ?> </div> </div> </div> </div> </div> </div> </div> </footer> <?PHP } } $widgets_manager->register( new Footer_Widget() );