HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/counter.php
<?php

/**
 * Elementor Single Widget
 * @package ftech Tools
 * @since 1.0.0
 */

namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.

class Ftech_Counter extends Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Elementor widget name.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'go-counter';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Elementor widget title.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Counter', 'ftech-plugin' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Elementor widget icon.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'ftech-custom-icon';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Elementor widget belongs to.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'ftech_widgets' ];
	}


	protected function register_controls() {

        $this->start_controls_section(
			'int_widget_opt',
			[
				'label' => esc_html__( 'Counter Style Select', 'ftech-plugin' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			]
		);
        $this->add_control(
			'style',
			[
				'label' => esc_html__( 'Style', 'ftech-plugin' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'default' => '1',
				'options' => [
					'1'  => esc_html__( 'Style 1', 'ftech-plugin' ),
					'2'  => esc_html__( 'Style 2', 'ftech-plugin' ),
				]
			]
		);
        $this->end_controls_section();

        $this->start_controls_section(
			'--service-option',
			[
				'label' => esc_html__( 'Counter Option', 'ftech-plugin' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			]
		);
        
       
        $this->add_control(
			'title', [
				'label' => esc_html__( 'Title', 'ftech-plugin' ),
				'default' => esc_html__( 'List Title', 'ftech-plugin' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $this->add_control(
			'count', [
				'label' => esc_html__( 'Count', 'ftech-plugin' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $this->add_control(
			'prefix', [
				'label' => esc_html__( 'Prefix', 'ftech-plugin' ),
				'type' => Controls_Manager::TEXT,
                'label_block' => true,
			]
		);
        $this->add_control(
			'shape', [
				'label' => esc_html__( 'Shape', 'ftech-plugin' ),
				'type' => Controls_Manager::MEDIA,
                'label_block' => true,
			]
		);
       
		$this->end_controls_section();

		// Sub title style
		
		$this->start_controls_section(
			'slider_number_style',
			[
				'label' => esc_html__( 'Number Style', 'ftech-plugin' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);
        $this->add_control(
			'number_color',
			[
				'label' => esc_html__( 'Counter Number Color', 'ftech-plugin' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .ftc-achieve-counter-3-item .item-number' => '-webkit-text-stroke: 1px {{VALUE}}',
					'{{WRAPPER}} .ftc-achieve-counter-1-item .item-number' => 'color:{{VALUE}}',
				],
			]
		);
		// typography
		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[

				'name' => 'm_nm_typography',
				'selector' => '
				{{WRAPPER}} .ftc-achieve-counter-3-item .item-number,
				{{WRAPPER}} .ftc-achieve-counter-1-item .item-number
				',
			]
		);


		$this->end_controls_section();
		$this->start_controls_section(
			'slider_title_style',
			[
				'label' => esc_html__( 'Title Style', 'ftech-plugin' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			]
		);
        $this->add_control(
			'title_color',
			[
				'label' => esc_html__( 'Counter Title Color', 'ftech-plugin' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
					'{{WRAPPER}} .ftc-achieve-counter-3-item .item-title' => 'color: {{VALUE}}',
					'{{WRAPPER}} .ftc-achieve-counter-1-item .item-title' => 'color: {{VALUE}}'
				],
			]
		);
		// typography
		$this->add_group_control(
			\Elementor\Group_Control_Typography::get_type(),
			[

				'name' => 'title_color_typography',
				'selector' => '
				{{WRAPPER}} .ftc-achieve-counter-3-item .item-title,
				{{WRAPPER}} .ftc-achieve-counter-1-item .item-title
				',
			]
		);

		$this->end_controls_section();

	}


	protected function render() {
		$settings = $this->get_settings_for_display();
        require __DIR__ . '/view/counters/counters-' . $settings['style'] . '.php';
    }


}


Plugin::instance()->widgets_manager->register( new Ftech_Counter() );