Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
home
/
drleilu
/
www
/
wp-content
/
themes
/
luxia
/
inc
/
includes
/
integrations
/
elementor
/
widgets
/
✏️
Editing: header.php
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Elementor_Header_box extends Widget_Base { public function get_name() { return 'Elementor-Header-widget'; } public function get_title() { return __( 'Zc > Header' ,'luxia' ); } public function get_icon() { return 'eicon-slider-device'; } protected function _register_controls() { $traits = new \luxia_Elementor_Traits($this); $this->start_controls_section( 'section_tab', [ 'label' =>esc_html__( 'Header', 'luxia' ), ] ); $this->add_control( 'style', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Choose Style', 'luxia' ), 'default' => 'style1', 'label_block' => true, 'options' => [ 'style1' =>esc_html__( 'Header Style 1', 'luxia' ), 'style2' =>esc_html__( 'Header Style Video', 'luxia' ), 'style3' =>esc_html__( 'Header Normal', 'luxia' ), ], ] ); $this->add_control( 'icon', [ 'label' =>esc_html__( 'Icon', 'luxia' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'style' =>['style5'], ], ] ); $this->add_control( 'header_background_color', [ 'label' => __( 'Background Color Overlay', 'luxia' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'style' =>['style2','style3'], ], 'selectors' => [ '{{WRAPPER}} .slider-bg2::before,.slider-bg3::before' => 'background-color: {{VALUE}};', '{{WRAPPER}} .slider-bg2 .slider-content.second-slider-content::before,.slider-bg2 .slider-content.second-slider-content::after' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'header_backgrund_images', [ 'label' =>esc_html__( 'Header Background Images', 'luxia' ), 'type' => Controls_Manager::MEDIA, 'condition' => [ 'style' =>['style1','style3','style5'], ], ] ); $this->add_control( 'background_text', [ 'label' =>esc_html__( 'Header Background Text', 'luxia' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'style' =>['style2'], ], ] ); $this->add_control( 'header_image', [ 'label' =>esc_html__( 'Header Image', 'luxia' ), 'type' => Controls_Manager::MEDIA, 'condition' => [ 'style' =>['style1','style3'], ], ] ); $this->add_control( 'header_images', [ 'label' =>esc_html__( 'Header Images', 'luxia' ), 'type' => Controls_Manager::MEDIA, 'condition' => [ 'style' =>['style2'], ], ] ); $this->add_control( 'header_video', [ 'label' =>esc_html__( 'Choose File Video', 'luxia' ), 'type' => Controls_Manager::MEDIA, 'condition' => [ 'style' =>['style2'], ], ] ); $this->add_control( 'title_text', [ 'label' =>esc_html__( 'Heading ', 'luxia' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' =>esc_html__( 'Featured Products', 'luxia' ), 'default' =>esc_html__( 'Featured', 'luxia' ), ] ); $this->add_control( 'sub_title', [ 'label' =>esc_html__( 'Heading Sub Title', 'luxia' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' =>esc_html__( 'luxia Text', 'luxia' ), 'default' =>esc_html__( 'luxia', 'luxia' ), 'condition' => [ 'style' =>['style1','style2','style3'], ], ] ); $this->add_control( 'desc_title', [ 'label' =>esc_html__( 'Description', 'luxia' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' =>esc_html__( 'luxia Text', 'luxia' ), 'default' =>esc_html__( 'luxia', 'luxia' ), 'condition' => [ 'style' => ['style1','style2','style3'] ], ] ); $this->add_control( 'slider_button', [ 'label' =>esc_html__( 'Slider Button Text', 'luxia' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'placeholder' =>esc_html__( 'luxia Text', 'luxia' ), 'default' =>esc_html__( 'Read More', 'luxia' ), 'condition' => [ 'style' => ['style2'] ], ] ); $this->add_control( 'button_text', [ 'label' =>esc_html__( 'Button Text', 'luxia' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'style' =>[ 'style1'], ], ] ); $this->add_control( 'button_link', [ 'label' =>esc_html__( 'Button URL', 'luxia' ), 'type' => Controls_Manager::URL, 'condition' => [ 'style' => ['style1'], ], ] ); $this->add_control( 'button_text1', [ 'label' =>esc_html__( 'Button Text 1', 'luxia' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'style' =>['style1'], ], ] ); $this->add_control( 'button_link1', [ 'label' =>esc_html__( 'Button URL 1', 'luxia' ), 'type' => Controls_Manager::URL, 'condition' => [ 'style' => ['style1'], ], ] ); $this->add_control( 'shortcode', [ 'label' => __( 'Enter your shortcode', 'luxia' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => '[gallery id="123" size="medium"]', 'default' => '', 'condition' => [ 'style' => ['style3'] ], ] ); $this->add_responsive_control( 'title_align', [ 'label' =>esc_html__( 'Alignment', 'luxia' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' =>esc_html__( 'Left', 'luxia' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' =>esc_html__( 'Center', 'luxia' ), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' =>esc_html__( 'Right', 'luxia' ), 'icon' => 'fa fa-align-right', ], 'justify' => [ 'title' =>esc_html__( 'Justified', 'luxia' ), 'icon' => 'fa fa-align-justify', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .inner-item' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); } protected function render( $instance = [] ) { $settings = $this->get_settings(); $style = $settings[ 'style' ]; $title_text = $settings[ 'title_text' ]; $sub_title = $settings[ 'sub_title' ]; $desc_title = $settings[ 'desc_title' ]; $slider_button = $settings[ 'slider_button' ]; $header_backgrund_images = $settings[ 'header_backgrund_images' ]; $background_text = $settings[ 'background_text' ]; $header_image = $settings[ 'header_image' ]; $header_images = $settings[ 'header_images' ]; $icon = $settings[ 'icon' ]; $button_text = $settings[ 'button_text' ]; $button_text1 = $settings[ 'button_text1' ]; $button_link = $settings[ 'button_link' ]; $button_link1 = $settings[ 'button_link1' ]; $shortcode = $settings[ 'shortcode' ]; $header_video = $settings[ 'header_video' ]; switch ( $style ) { case 'style1': require get_template_directory() . '/inc/sections/header/style1.php'; break; case 'style2': require get_template_directory() . '/inc/sections/header/style2.php'; break; case 'style3': require get_template_directory() . '/inc/sections/header/style3.php'; break; } } protected function content_template() {} public function render_plain_content() {} } Plugin::instance()->widgets_manager->register_widget_type( new Elementor_Header_box() );
💾 Save
❌ Cancel