HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/iskcon/public_html/wp-content/plugins/tow-widgets/widgets/elementor/feature-box.php
<?php

if (!defined("ABSPATH")) {
    exit(); // Exit if accessed directly.
}

class Elementor_feature_box_Widget extends \Elementor\Widget_Base
{
   /**
     * Get widget name.
   */
   public function get_name()
   {
        return "feature";
   }

    /**
     * Get widget title.
     */
    public function get_title()
    {
        return esc_html__("Feature Box", "Elementor_feature_box_Widget");
    }

   /**
     * Get widget Icon.
     */
    public function get_icon()
    {
        return "eicon-icon-box";
    }

    /**
     * Get widget categories.
     */
    public function get_categories()
    {
        return ["tow-theme-element"];
    }

    /**
     * Get widget keywords.
     */
    public function get_keywords()
    {
        return ["feature", "icon-box"];
    }

    /**
     * Register widget controls.
     */
    protected function register_controls()
    {
        $this->start_controls_section(
            "content_section",
            [
                "label" => esc_html__("Content", "Elementor_feature_box_Widget"),
                "tab" => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );
		
        $this->add_control(

            'feature_style',
            [
                'label'     => esc_html__( 'Feature Style', 'Elementor_feature_box_Widget' ),
                'type'      => \Elementor\Controls_Manager::SELECT,
                'options'   => [
                    'style1'   => esc_html__( 'Feature Style 1', 'Elementor_feature_box_Widget' ),
                    'style2'  => esc_html__( 'Feature Style 2', 'Elementor_feature_box_Widget' ),
                    
                ],
            ]
        );

        $this->add_control(
            'icon_as',
            [
                'label'     => esc_html__( 'Icon Type', 'Elementor_feature_box_Widget' ),
                'type'      => \Elementor\Controls_Manager::SELECT,
                'default'   => 'font',
                'options'   => [
                    'font'   => esc_html__( 'Font', 'Elementor_feature_box_Widget' ),
                    'image'  => esc_html__( 'Image', 'Elementor_feature_box_Widget' ),
                    'svg'  => esc_html__( 'Svg', 'Elementor_feature_box_Widget' ),
                ],
            ]
        );

        $this->add_control(
            'icon_image',
            [
                'label'     => __( 'Image', 'Elementor_feature_box_Widget' ),
                'type'      => \Elementor\Controls_Manager::MEDIA,
                'default'   => [
                    'url' => '',
                ],
                'condition' => [
                    'icon_as'  => 'image',
                ],
            ]
        );

         $this->add_control(
            'icon_svg',
            [
                'label'     => __( 'Svg', 'Elementor_feature_box_Widget' ),
                'type'      => \Elementor\Controls_Manager::TEXTAREA,
                'condition' => [
                    'icon_as'  => 'svg',
                ],
            ]
        );

        $this->add_control(
            'icon',
            [
                'label'     => __( 'Icon', 'Elementor_feature_box_Widget' ),
                'type'      => \Elementor\Controls_Manager::ICONS,
                'default'   => [
                    'value'   => 'fa-solid fa-hands-praying',
                    'library' => 'solid',
                ],
                'conditions' => array(
                    'relation' => 'or',
                    'terms'    => array(
                        array(
                           'name'     => 'icon_as',
                            'operator' => '==',
                            'value'   => 'font',
                        ),
                    )
                ),
            ]
        );

 
        $this->add_control("title", [
            "label" => esc_html__("Title", "Elementor_feature_box_Widget"),
            "type" => \Elementor\Controls_Manager::TEXT,
            "lable_block" => "true",
            "placeholder" => esc_html__(
                "Title Here",
                "Elementor_feature_box_Widget"
            ),
        ]);
		
		$this->add_control(
            "title_url",
            [
                "label" => esc_html__(
                    "URL",
                    "Elementor_themeht_button_Widget"
                ),

                "type" => \Elementor\Controls_Manager::TEXT,

                "input_type" => "url",

                "placeholder" => esc_html__(
                    "https://your-link.com",
                    "Elementor_feature_box_Widget"
                ),
            ]
        );

        $this->add_control("description", [
            "label" => esc_html__(
                "Description",
                "Elementor_feature_box_Widget"
            ),
            "type" => \Elementor\Controls_Manager::WYSIWYG,
            "lable_block" => "true",
            "placeholder" => esc_html__(
                "Description Here",
                "Elementor_feature_box_Widget"
            ),
        ]);
        
        
        $this->end_controls_section();
		
		$this->start_controls_section("section_style", [
            "label" => esc_html__("Style", "textdomain"),
            "tab" => \Elementor\Controls_Manager::TAB_STYLE,
        ]);
		
		$this->add_control(
            'icon_color',
            [
                'label' => esc_html__( 'Icon Color', 'Elementor_themeht_heading_Widget' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'text-white',
                'options' => [
                    'text-white' => esc_html__( 'White', 'Elementor_themeht_heading_Widget' ),
					'text-grey-400' => esc_html__( 'Grey', 'Elementor_themeht_heading_Widget' ),
					'text-black' => esc_html__( 'Black', 'Elementor_themeht_heading_Widget' ),
                    'col_blue' => esc_html__( 'Blue', 'Elementor_themeht_heading_Widget' ),
                    'col_oran'  => esc_html__( 'Orange', 'Elementor_themeht_heading_Widget' ),
                ],
            ]
        );
		
		$this->add_control(
            'pre-background-color',
            [
                'label' => esc_html__( 'Predefined Background Color', 'Elementor_themeht_heading_Widget' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'text-white',
                'options' => [
                    'text-white' => esc_html__( 'White', 'Elementor_themeht_heading_Widget' ),
                    'bg_blue' => esc_html__( 'Blue', 'Elementor_themeht_heading_Widget' ),
                    'bg_oran'  => esc_html__( 'Orange', 'Elementor_themeht_heading_Widget' ),
                    'text-black' => esc_html__( 'Black', 'Elementor_themeht_heading_Widget' ),
                ],
            ]
        );
		
		$this->add_control("background-color", [
            "label" => esc_html__("Background Color", "Elementor_custom_title_block_Widget"),
            "type" => \Elementor\Controls_Manager::COLOR,
            "default" => "#ffffff",
            "selectors" => [
                "{{WRAPPER}} .about_h1l" => "background-color: {{VALUE}}",
            ],
        ]);

        $this->add_control("color", [
            "label" => esc_html__("Title Color", "Elementor_custom_title_block_Widget"),
            "type" => \Elementor\Controls_Manager::COLOR,
            "default" => "#000000",
            "selectors" => [
                "{{WRAPPER}} .featured-title" => "color: {{VALUE}}",
            ],
        ]);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                "name" => "title_typography",
                "label" => __("Title Typography", "Elementor_custom_title_block_Widget"),
                "selector" => "{{WRAPPER}} h4",
            ]
        );

        $this->add_control(
            'description_color',
            [
                'label' => esc_html__( 'Description Text Color', 'Elementor_themeht_heading_Widget' ),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'text-white',
                'options' => [
                    'text-white' => esc_html__( 'White', 'Elementor_themeht_heading_Widget' ),
					'text-grey-400' => esc_html__( 'Grey', 'Elementor_themeht_heading_Widget' ),
					'text-black' => esc_html__( 'Black', 'Elementor_themeht_heading_Widget' ),
                    'col_blue' => esc_html__( 'Blue', 'Elementor_themeht_heading_Widget' ),
                    'col_oran'  => esc_html__( 'Orange', 'Elementor_themeht_heading_Widget' ),
                    
                ],
            ]
        );
        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                "name" => "description_typography",
                "label" => __(
                    "Description Typography",
                    "Elementor_custom_title_block_Widget"
                ),
               "selector" => "{{WRAPPER}} p",
            ]
        );

        $this->end_controls_section();

    }

    /**
     * Render widget output on the frontend.
     */

    protected function render()
    {

        // get our input from the widget settings.
        $settings = $this->get_settings_for_display(); 
		
		if ( $settings[ 'feature_style' ] === 'style1' ) {
		
		//print get_template_directory_uri() . '/assets/css/bootstrap-icons.min.css';
		?>

          <div class="about_h1l text-center p-5 border_1 <?php echo esc_attr($settings["pre-background-color"]); ?>">
		    <span class="d-inline-block rounded-circle border_1 px-4 py-2 <?php echo esc_attr($settings["icon_color"]); ?> font_50 hvr-grow">
		  <?php

            if ( $settings[ 'icon_as' ] === 'image' ) {
                if ( $settings[ 'icon_image' ] ) {
                    $image_data = wp_get_attachment_image_src( $settings[ 'icon_image' ]['id'], 'full' );
                    $image_url  = ( isset( $image_data[0] ) && $image_data[0] ) ? $image_data[0] : '';
                    if ( $image_url ) { 
                        ?>
                            <img src="<?php echo esc_url( $image_url ); ?>" alt="<?php esc_attr_e( 'Icon', 'Elementor_feature_box_Widget' ) ?>">
                        <?php
                    }
                }                

            } else if ( $settings[ 'icon_as' ] === 'font' ) {
                if ( isset($settings['icon'] ) && $settings['icon'] ) {
                    
					 \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); 
                }
            } else if ( $settings[ 'icon_as' ] === 'svg' ) {
                if ( $settings[ 'icon_svg' ] ) {
                    
					 echo $settings["icon_svg"]; 
                }
            }
			?>
		   </span>
		   <h4 class="mt-4 mb-4"><a href="<?php echo $settings["title_url"]; ?>" class="featured-title"><?php echo $settings["title"]; ?></a></h4>
		   <p class="mb-0 <?php echo esc_attr($settings["description_color"]); ?>"><?php echo $settings["description"]; ?></p>
		  </div>
		  
		<?php 
		
		}
		else{
		?>
		    <div class="about_h1l row <?php echo esc_attr($settings["pre-background-color"]); ?>">
			   <div class="col-md-2">
				 <div class="about_h2rilil text-center">
				   <span class="d-inline-block <?php echo esc_attr($settings["icon_color"]); ?> fs-1">
				   <?php
				    if ( $settings[ 'icon_as' ] === 'image' ) {
						if ( $settings[ 'icon_image' ] ) {
							$image_data = wp_get_attachment_image_src( $settings[ 'icon_image' ]['id'], 'full' );
							$image_url  = ( isset( $image_data[0] ) && $image_data[0] ) ? $image_data[0] : '';
							if ( $image_url ) { 
								?>
									<img src="<?php echo esc_url( $image_url ); ?>" alt="<?php esc_attr_e( 'Icon', 'Elementor_feature_box_Widget' ) ?>">
								<?php
							}
						}                
		
					} else if ( $settings[ 'icon_as' ] === 'font' ) {
						if ( isset($settings['icon'] ) && $settings['icon'] ) {
							
							 \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); 
						}
					} else if ( $settings[ 'icon_as' ] === 'svg' ) {
						if ( $settings[ 'icon_svg' ] ) {
							
							 echo $settings["icon_svg"]; 
						}
					}
					?>
				   </span>
				 </div>
			   </div>
			   <div class="col-md-10">
				 <div class="about_h2rilir">
				   <h4><a href="<?php echo $settings["title_url"]; ?>" class="featured-title"><?php echo $settings["title"]; ?></a></h4>
				   <p class="border-0"<?php echo esc_attr($settings["description_color"]); ?>"><?php echo $settings["description"]; ?></p>
				 </div>
			   </div>
			 </div>
		 
		<?php 
		}
    }

}