HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/dreamssalon-wp/wp-content/plugins/dreamsalon-widgets/widgets/class-home2-about-two.php
<?php
namespace dreamsalonelementor\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;

if ( ! defined( 'ABSPATH' ) ) { exit; }

class DSHome2AboutTwo extends Widget_Base {
    public function get_name() { return 'dreamsalon-home-about-us-two'; }
    public function get_title() { return __( 'DS Home About Us 2', 'dreamsalon_elementor' ); }
    public function get_icon() { return 'eicon-info-box'; }
    public function get_categories() { return [ 'dreamsalonelemetortheme' ]; }

    protected function _register_controls() {
        $this->start_controls_section('section_header', [ 'label' => __( 'Section Header', 'dreamsalon_elementor' ) ]);

        $this->add_control('badge_text', [
            'label' => __( 'Badge Text', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'About Us',
        ]);

        $this->add_control('title_text', [
            'label' => __( 'Title', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'Discover top wellness consultants, read real reviews',
        ]);

         $this->add_control('stitle_text', [
            'label' => __( 'Title 2', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'Discover top wellness consultants, read real reviews',
        ]);

        $this->add_control('description_text', [
            'label' => __( 'Description', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXTAREA,
            'default' => 'Wellness coaching is more than just improving health — it’s about creating balance, building confidence, and unlocking.',
        ]);

        $this->add_control('button_text', [
            'label' => __( 'Button Text', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'View All Services',
        ]);

        $this->add_control('button_link', [
            'label' => __( 'Button Link', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::URL,
            'default' => [ 'url' => '#' ],
        ]);

        $this->end_controls_section();

        // Feature items
        $this->start_controls_section('section_features', [ 'label' => __( 'Feature Items', 'dreamsalon_elementor' ) ]);

        $repeater = new Repeater();
        $repeater->add_control('icon_class', [
            'label' => __( 'Icon Class', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'ti ti-bell-ringing',
        ]);
        $repeater->add_control('icon_bg_class', [
            'label' => __( 'Icon Background Class', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'bg-orange',
            'description' => __( 'Extra class applied to .about-icon (e.g. bg-orange, bg-success).', 'dreamsalon_elementor' ),
        ]);
        $repeater->add_control('item_title', [
            'label' => __( 'Title', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXT,
            'default' => 'Personal Guidance',
        ]);
        $repeater->add_control('item_text', [
            'label' => __( 'Text', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::TEXTAREA,
            'default' => 'Users can explore, compare, and choose consultants on individual.',
        ]);

        $this->add_control('features', [
            'label' => __( 'Features', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::REPEATER,
            'fields' => $repeater->get_controls(),
            'default' => [
                [
                    'icon_class'    => 'ti ti-bell-ringing',
                    'icon_bg_class' => 'bg-orange',
                    'item_title'    => 'Personal Guidance',
                    'item_text'     => 'Users can explore, compare, and choose consultants on individual.',
                ],
                [
                    'icon_class'    => 'ti ti-analyze',
                    'icon_bg_class' => 'bg-success',
                    'item_title'    => 'Holistic Approach',
                    'item_text'     => 'Our platform focuses not only on physical health but also on mental.',
                ],
            ],
            'title_field' => '{{{ item_title }}}',
        ]);

        $this->end_controls_section();

        // Images
        $this->start_controls_section('section_images', [ 'label' => __( 'Images', 'dreamsalon_elementor' ) ]);

        $this->add_control('image_one', [
            'label' => __( 'Image 1', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::MEDIA,
            'default' => [ 'url' => get_template_directory_uri() . '/assets/img/about/about-01.jpg' ],
        ]);
        $this->add_control('image_two', [
            'label' => __( 'Image 2', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::MEDIA,
            'default' => [ 'url' => get_template_directory_uri() . '/assets/img/about/about-02.jpg' ],
        ]);
        $this->add_control('image_three', [
            'label' => __( 'Image 3', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::MEDIA,
            'default' => [ 'url' => get_template_directory_uri() . '/assets/img/about/about-03.jpg' ],
        ]);
        $this->add_control('image_bg', [
            'label' => __( 'Background Image', 'dreamsalon_elementor' ),
            'type' => Controls_Manager::MEDIA,
            'default' => [ 'url' => get_template_directory_uri() . '/assets/img/bg/about-bg.png' ],
        ]);

        $this->end_controls_section();

        // Basic style for main title
        $this->start_controls_section(
            'section_style',
            [
                'label' => __( 'Style', 'dreamsalon_elementor' ),
                'tab'   => Controls_Manager::TAB_STYLE,
            ]
        );

        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'name' => 'title_typography',
                'label' => __( 'Title Typography', 'dreamsalon_elementor' ),
                'selector' => '{{WRAPPER}} .about-section-six .section-header h2',
            ]
        );

        $this->end_controls_section();
    }

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

        $badge  = isset( $s['badge_text'] ) ? $s['badge_text'] : '';
        $title  = isset( $s['title_text'] ) ? $s['title_text'] : '';
        $stitle  = isset( $s['stitle_text'] ) ? $s['stitle_text'] : '';
        $desc   = isset( $s['description_text'] ) ? $s['description_text'] : '';

        $btn_text = isset( $s['button_text'] ) ? $s['button_text'] : '';
        $btn_link = ! empty( $s['button_link']['url'] ) ? $s['button_link']['url'] : '';

        $features = ! empty( $s['features'] ) && is_array( $s['features'] ) ? $s['features'] : [];

        $img1 = ! empty( $s['image_one']['url'] ) ? $s['image_one']['url'] : '';
        $img2 = ! empty( $s['image_two']['url'] ) ? $s['image_two']['url'] : '';
        $img3 = ! empty( $s['image_three']['url'] ) ? $s['image_three']['url'] : '';
        $img_bg = ! empty( $s['image_bg']['url'] ) ? $s['image_bg']['url'] : '';
        ?>
        <section class="about-section-six section"  <?php if ( $img_bg ) : ?> style="background:url(<?php echo esc_url( $img_bg ); ?>);background-position: right;
    background-repeat: no-repeat;"
 <?php endif; ?>>
            <div class="container">

                <div class="row row-gap-4 align-items-center">

                    <div class="col-lg-6">
                        <div class="about-content-six wow fadeInUp" data-wow-delay="0.2s">
                            <div class="section-header">
                                <?php if ( $badge ) : ?>
                                <span class="section-badge mb-3"><?php echo esc_html( $badge ); ?></span>
                                <?php endif; ?>
                                <?php if ( $title ) : ?>
                                <h2 class="<?php if ( $stitle ) : ?> mb-0 <?php else: ?> mb-3 <?php endif; ?>"><?php echo wp_kses_post( $title ); ?></h2>
                                <?php endif; ?>

                                 <?php if ( $stitle ) : ?>
                                <h2 class="mb-3 border_bottom"> <span class="subtitle"><?php echo wp_kses_post( $stitle ); ?><span class="borderback"></span> </span>
                            </h2>
                                <?php endif; ?>

                                <?php if ( $desc ) : ?>
                                <p class="mb-0"><?php echo wp_kses_post( $desc ); ?></p>
                                <?php endif; ?>
                            </div>
                            <div class="row row-gap-4">
                                <?php if ( ! empty( $features ) ) : ?>
                                    <?php foreach ( $features as $f ) :
                                        $f_icon    = isset( $f['icon_class'] ) ? $f['icon_class'] : '';
                                        $f_bg      = isset( $f['icon_bg_class'] ) ? $f['icon_bg_class'] : '';
                                        $f_title   = isset( $f['item_title'] ) ? $f['item_title'] : '';
                                        $f_text    = isset( $f['item_text'] ) ? $f['item_text'] : '';
                                    ?>
                                    <div class="col-xl-6 col-sm-6">
                                        <div class="about-item-six border">
                                            <span class="about-icon <?php echo esc_attr( $f_bg ); ?>">
                                                <?php if ( $f_icon ) : ?><i class="<?php echo esc_attr( $f_icon ); ?>"></i><?php endif; ?>
                                            </span>
                                            <?php if ( $f_title ) : ?><h3 class="mb-2"><?php echo esc_html( $f_title ); ?></h3><?php endif; ?>
                                            <?php if ( $f_text ) : ?><p class="mb-0"><?php echo esc_html( $f_text ); ?></p><?php endif; ?>
                                        </div>
                                    </div>
                                    <?php endforeach; ?>
                                <?php endif; ?>
                            </div>
                            <?php if ( $btn_text && $btn_link ) : ?>
                            <a href="<?php echo esc_url( $btn_link ); ?>" class="btn btn-dark d-inline-flex align-items-center view-more rounded-pill"><?php echo esc_html( $btn_text ); ?><i class="ti ti-chevron-right ms-1"></i></a>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="col-lg-6 col-sm-8 mx-auto">
                        <div class="about-img-six">
                            <?php if ( $img1 ) : ?>
                            <img src="<?php echo esc_url( $img1 ); ?>" class="img-fluid about-01 wow fadeInUp" data-wow-delay="0.2s" alt="about">
                            <?php endif; ?>
                            <?php if ( $img2 ) : ?>
                            <img src="<?php echo esc_url( $img2 ); ?>" class="img-fluid about-02 wow fadeInUp" data-wow-duration="1.1s" data-wow-delay="0.2s" alt="about">
                            <?php endif; ?>
                            <?php if ( $img3 ) : ?>
                            <img src="<?php echo esc_url( $img3 ); ?>" class="img-fluid about-03 wow fadeInUp" data-wow-duration="1.3s" data-wow-delay="0.2s" alt="about">
                            <?php endif; ?>
                           
                        </div>
                    </div>

                </div>

            </div>
        </section>
        <?php
    }
}