HEX
Server: LiteSpeed
System: Linux dune179.sitesanctuary.org 5.14.0-427.40.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 16 07:08:17 EDT 2024 x86_64
User: h278792 (1076)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/h278792/public_html/wp-content/plugins/ecademy-toolkit/widgets/our-story-area.php
<?php
/**
 * منطقه داستان ما Widget
 */

namespace Elementor;

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

class eCademy_Our_Story_Area extends Widget_Base {

	public function get_name() {
        return 'eCademy_Our_Story_Area';
    }

	public function get_title() {
        return __( 'منطقه داستان ما', 'ecademy-toolkit' );
    }

	public function get_icon() {
        return 'eicon-table-of-contents';
    }

	public function get_categories() {
        return [ 'ecademy-elements' ];
    }

	protected function register_controls() {

        $this->start_controls_section(
			'Our_Story_Area_section',
			[
				'label' => __( 'کنترل منطقه داستان ما', 'ecademy-toolkit' ),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
        );

            $repeater = new Repeater();
            $repeater->add_control(
                'style', [
                    'label' => __( 'سبک', 'ecademy-toolkit' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        '1'         => __( 'سبک 1', 'ecademy-toolkit' ),
                        '2'         => __( 'سبک', 'ecademy-toolkit' ),
                    ],
                    'default' => '1',
                ]
            );
            $repeater->add_control(
                'number', [
                    'type'    => Controls_Manager::TEXT,
                    'label'   => esc_html__( 'شمارنده', 'ecademy-toolkit' ),
                    'condition' => [
                        'style' => '1',
                    ]
                ]
            );
            $repeater->add_control(
                'title', [
                    'type'    => Controls_Manager::TEXT,
                    'label'   => esc_html__( 'عنوان', 'ecademy-toolkit' ),
                    'default' => esc_html__('داستان های الهام بخش کمتر در مورد موفقیت هستند', 'ecademy-toolkit'),
                    'condition' => [
                        'style' => '1',
                    ]
                ]
            );
            $repeater->add_control(
                'content', [
                    'type'    => Controls_Manager::TEXTAREA,
                    'label'   => esc_html__( 'محتوا', 'ecademy-toolkit' ),
                    'default' => esc_html__('eCademy.Com در سال 2005 شروع به کار کرد. پس از سال ها در صنعت میزبانی وب، متوجه شدیم که تقریبا غیرممکن است که جین یا جو معمولی وب سایت خود را ایجاد کنند. خدمات میزبانی وب سنتی برای مدیریت بسیار پیچیده، وقت گیر و پرهزینه بود.', 'ecademy-toolkit'),
                    'condition' => [
                        'style' => '1',
                    ]
                ]
            );
            $repeater->add_control(
                'image', [
                    'type'    => Controls_Manager::MEDIA,
                    'label'   => esc_html__( 'تصویر', 'ecademy-toolkit' ),
                    'condition' => [
                        'style' => '2',
                    ]
                ]
            );
            $this->add_control(
                'items',
                [
                    'label'   => esc_html__( 'افزودن ایتم لیست', 'ecademy-toolkit' ),
                    'type' => Controls_Manager::REPEATER,
                    'fields' => $repeater->get_controls(),
                ]
            );
        $this->end_controls_section();

        $this->start_controls_section(
			'counter_style',
			[
				'label' => __( 'سبک', 'ecademy-toolkit' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
        );

            $this->add_control(
                'counter_color',
                [
                    'label' => __( 'رنگ شمارنده', 'ecademy-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .our-story-title h3 .number' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_responsive_control(
				'number_size',
				[
					'label' => __( 'سایز فونت شمارنده', 'ecademy-toolkit' ),
					'type' => Controls_Manager::SLIDER,
					'size_units' => [ 'px' ],
					'range' => [
						'px' => [
							'min' => 1,
							'max' => 70,
							'step' => 1,
						],
					],
					'devices' => [ 'desktop', 'tablet', 'mobile' ],
					'selectors' => [
						'{{WRAPPER}} .our-story-title h3 .number' => 'font-size: {{SIZE}}px;',
					],
				]
			);

            $this->add_control(
				'title_color',
				[
					'label' => __( 'عنوان رنگ', 'ecademy-toolkit' ),
					'type' => Controls_Manager::COLOR,
					'selectors' => [
						'{{WRAPPER}} .our-story-title h3' => 'color: {{VALUE}}',
					],
				]
			);

			$this->add_responsive_control(
				'title_size',
				[
					'label' => __( 'اندازه قلم عنوان', 'ecademy-toolkit' ),
					'type' => Controls_Manager::SLIDER,
					'size_units' => [ 'px' ],
					'range' => [
						'px' => [
							'min' => 1,
							'max' => 70,
							'step' => 1,
						],
					],
					'devices' => [ 'desktop', 'tablet', 'mobile' ],
					'selectors' => [
						'{{WRAPPER}} .our-story-title h3' => 'font-size: {{SIZE}}px;',
					],
				]
            );

            $this->add_control(
				'content_color',
				[
					'label' => __( 'رنگ محتوا', 'ecademy-toolkit' ),
					'type' => Controls_Manager::COLOR,
					'selectors' => [
						'{{WRAPPER}} .our-story-content p' => 'color: {{VALUE}}',
					],
				]
			);

			$this->add_responsive_control(
				'content_size',
				[
					'label' => __( 'سایز فونت محتوا', 'ecademy-toolkit' ),
					'type' => Controls_Manager::SLIDER,
					'size_units' => [ 'px' ],
					'range' => [
						'px' => [
							'min' => 1,
							'max' => 70,
							'step' => 1,
						],
					],
					'devices' => [ 'desktop', 'tablet', 'mobile' ],
					'selectors' => [
						'{{WRAPPER}} .our-story-content p' => 'font-size: {{SIZE}}px;',
					],
				]
			);

        $this->end_controls_section();
    }

	protected function render() {
        $settings = $this->get_settings_for_display();

        global $ecademy_opt;
		if( isset( $ecademy_opt['enable_lazyloader'] ) ):
			$is_lazyloader = $ecademy_opt['enable_lazyloader'];
		else:
			$is_lazyloader = true;
		endif;

        ?>
        <div class="our-story-area ptb-100">
            <div class="container">
                <div class="row">
                    <?php foreach( $settings['items'] as $item ): ?>
                        <?php if( $item['style'] == '1' ): ?>
                            <div class="col-lg-4 col-md-12">
                                <div class="our-story-title">
                                    <h3><span class="number"><?php echo esc_html( $item['number'] ); ?></span> <?php echo esc_html( $item['title'] ); ?></h3>
                                </div>
                            </div>
                            <div class="col-lg-8 col-md-12">
                                <div class="our-story-content">
                                    <?php echo wp_kses_post( $item['content'] ); ?>
                                </div>
                            </div>
                        <?php else: ?>
                            <?php if( $item['image']['url'] != '' ): ?>
                                <div class="col-lg-12 col-md-12">
                                    <div class="our-story-image">
                                        <?php if( $is_lazyloader == true ): ?>
                                            <img sm-src="<?php echo esc_url( $item['image']['url'] ); ?>" alt="<?php echo esc_attr__( 'تصویر داستان ما', 'ecademy-toolkit' ); ?>">
                                        <?php else: ?>
                                            <img src="<?php echo esc_url( $item['image']['url'] ); ?>" alt="<?php echo esc_attr__( 'تصویر داستان ما', 'ecademy-toolkit' ); ?>">
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                        <?php endif; ?>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
        <?php
	}

}

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