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/dreamspos-uk/wp-content/plugins/dreamslanding-widgets/widgets/class-dl-enterprise.php
<?php
namespace Dreamslandingelementor\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
use Elementor\Utils;

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

class DTS_enterprise extends Widget_Base {

    public function get_name() {
        return 'dl-enterprise';
    }

    public function get_title() {
        return __( 'DL Enterprise', 'dreamslanding_elementor' );
    }

    public function get_icon() {
        return 'eicon-tabs';
    }

    public function get_categories() {
        return [ 'general' ];
    }

    protected function register_controls() {
        $this->start_controls_section(
            'content_section',
            [
                'label' => __( 'Content', 'dreamslanding_elementor' ),
            ]
        );

        $this->add_control(
            'section_title',
            [
                'label' => __( 'Section Title', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'Why SmartHR Beats Enterprise Giants and Regional Players', 'dreamslanding_elementor' ),
            ]
        );

        $this->add_control(
            'section_subtitle',
            [
                'label' => __( 'Section Subtitle', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'A Modular Platform Covering Every Aspect of Healthcare Delivery', 'dreamslanding_elementor' ),
            ]
        );

        $tab_rep = new Repeater();
        $tab_rep->add_control(
            'label',
            [
                'label' => __( 'Tab Label', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'Built for You, Not the Other Way Around', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'button_icon_class',
            [
                'label' => __( 'Button Icon Class', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => 'ti ti-arrow-up-right',
            ]
        );
        $tab_rep->add_control(
            'image',
            [
                'label' => __( 'Left Image', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::MEDIA,
                'default' => [ 'url' => Utils::get_placeholder_image_src() ],
            ]
        );
        $tab_rep->add_control(
            'problem_title',
            [
                'label' => __( 'Problem Title', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'The Problem with Others:', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'problem_desc',
            [
                'label' => __( 'Problem Description', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXTAREA,
                'default' => __( 'Rigid systems force you into their workflows. Need something unique? Tough luck or pay $50K+ for "custom development."', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'diff_title',
            [
                'label' => __( 'Difference Title', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'The SmartHR Difference:', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'diff_desc',
            [
                'label' => __( 'Difference Description', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXTAREA,
                'default' => __( 'Configure workflows yourself (no-code). Need something special? We build it for you—included in Enterprise plans. Custom features live in 2-4 weeks.', 'dreamslanding_elementor' ),
            ]
        );

        $ex_rep = new Repeater();
        $ex_rep->add_control(
            'item',
            [
                'label' => __( 'Example Item', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'Construction certified payroll + union reporting', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'examples_title',
            [
                'label' => __( 'Examples Title', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( "Examples We've Built:", 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'examples',
            [
                'label' => __( 'Examples', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::REPEATER,
                'fields' => $ex_rep->get_controls(),
                'default' => [
                    [ 'item' => 'Construction certified payroll + union reporting' ],
                    [ 'item' => 'Healthcare credential tracking + on-call scheduling' ],
                    [ 'item' => 'Hospitality tip tracking + seasonal workforce management' ],
                    [ 'item' => 'Professional services client billing + utilization reports' ],
                ],
                'title_field' => '{{{ item }}}',
            ]
        );

        $tab_rep->add_control(
            'cta_last_text',
            [
                'label' => __( 'Last Text', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'Start with one platform. Add more as you grow. Each works independently but becomes powerful together.', 'dreamslanding_elementor' ),
            ]
        );

        $tab_rep->add_control(
            'cta_text',
            [
                'label' => __( 'CTA Text', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::TEXT,
                'default' => __( 'Tell Us What You Need', 'dreamslanding_elementor' ),
            ]
        );
        $tab_rep->add_control(
            'cta_url',
            [
                'label' => __( 'CTA URL', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::URL,
                'default' => [ 'url' => 'javascript:void(0)' ],
            ]
        );

        $this->add_control(
            'tabs',
            [
                'label' => __( 'Tabs', 'dreamslanding_elementor' ),
                'type' => Controls_Manager::REPEATER,
                'fields' => $tab_rep->get_controls(),
                'default' => [
                    [ 'label' => 'Built for You, Not the Other Way Around' ],
                    [ 'label' => 'Five Platforms That Actually Talk to Each Other' ],
                    [ 'label' => 'White-Label Ready for Partners' ],
                ],
                'title_field' => '{{{ label }}}',
            ]
        );

        $this->end_controls_section();
    }

    private function make_id( $text, $index ) {
        $slug = sanitize_title( $text );
        if ( empty( $slug ) ) { $slug = 'tab-' . $index; }
        return $slug . '-' . $this->get_id();
    }

    protected function render() {
        $settings = $this->get_settings_for_display();
        $title = ! empty( $settings['section_title'] ) ? $settings['section_title'] : '';
        $subtitle = ! empty( $settings['section_subtitle'] ) ? $settings['section_subtitle'] : '';
        $tabs = ! empty( $settings['tabs'] ) && is_array( $settings['tabs'] ) ? $settings['tabs'] : [];
        ?>
        <section class="feature-one">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <div class="section-header aos" data-aos="fade-up">
                            <?php if ( $title ) : ?><h2><?php echo \esc_html( $title ); ?></h2><?php endif; ?>
                            <?php if ( $subtitle ) : ?><p><?php echo \esc_html( $subtitle ); ?></p><?php endif; ?>
                        </div>
                    </div>
                </div>
                <?php if ( ! empty( $tabs ) ) : ?>
                <div class="row">
                    <div class="col-md-12 text-center">
                        <ul class="nav nav-tabs tabd1-menu" role="tablist">
                            <?php foreach ( $tabs as $i => $tab ) : 
                                $label = isset( $tab['label'] ) ? $tab['label'] : '';
                                $icon = isset( $tab['button_icon_class'] ) ? $tab['button_icon_class'] : 'ti ti-arrow-up-right';
                                $target = '#' . $this->make_id( $label, $i );
                                $active = $i === 0 ? 'active' : '';
                            ?>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link <?php echo \esc_attr( $active ); ?>" data-bs-toggle="tab" data-bs-target="<?php echo \esc_attr( $target ); ?>" type="button" role="tab" aria-selected="<?php echo $i===0?'true':'false'; ?>">
                                    <?php echo \esc_html( $label ); ?><i class="<?php echo \esc_attr( $icon ); ?>"></i>
                                </button>
                            </li>
                            <?php endforeach; ?>
                        </ul>
                    </div>
                    <div class="tab-content">
                        <?php foreach ( $tabs as $i => $tab ) : 
                            $label = isset( $tab['label'] ) ? $tab['label'] : '';
                            $tab_id = $this->make_id( $label, $i );
                            $active = $i === 0 ? 'show active' : '';
                            $img = isset( $tab['image']['url'] ) ? $tab['image']['url'] : '';
                            $problem_title = isset( $tab['problem_title'] ) ? $tab['problem_title'] : '';
                            $problem_desc = isset( $tab['problem_desc'] ) ? $tab['problem_desc'] : '';
                            $diff_title = isset( $tab['diff_title'] ) ? $tab['diff_title'] : '';
                            $diff_desc = isset( $tab['diff_desc'] ) ? $tab['diff_desc'] : '';
                            $examples_title = isset( $tab['examples_title'] ) ? $tab['examples_title'] : '';
                            $examples = isset( $tab['examples'] ) && is_array( $tab['examples'] ) ? $tab['examples'] : [];
                            $cta_text = isset( $tab['cta_text'] ) ? $tab['cta_text'] : '';
                            $cta_last_text = isset( $tab['cta_last_text'] ) ? $tab['cta_last_text'] : '';
                            $cta_url = isset( $tab['cta_url']['url'] ) ? $tab['cta_url']['url'] : '';
                        ?>
                        <div class="tab-pane fade <?php echo \esc_attr( $active ); ?>" id="<?php echo \esc_attr( $tab_id ); ?>" role="tabpanel">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="sec-img-shape">
                                        <?php if ( $img ) : ?><img src="<?php echo \esc_url( $img ); ?>" alt="" /><?php endif; ?>
                                        <div class="sec-img-shape-ico">
                                            <a href="<?php echo \esc_url( $cta_url ? $cta_url : 'javascript:void(0)' ); ?>">
                                            <i class="ti ti-arrow-up-right"></i>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="fc-card-1">
                                        <?php if ( $problem_title ) : ?><h3><?php echo \esc_html( $problem_title ); ?></h3><?php endif; ?>
                                        <?php if ( $problem_desc ) : ?><p><?php echo \esc_html( $problem_desc ); ?></p><?php endif; ?>
                                        <?php if ( $diff_title ) : ?><h3><?php echo \esc_html( $diff_title ); ?></h3><?php endif; ?>
                                        <?php if ( $diff_desc ) : ?><p><?php echo \esc_html( $diff_desc ); ?></p><?php endif; ?>
                                        <?php if ( $examples_title ) : ?><h3><?php echo \esc_html( $examples_title ); ?></h3><?php endif; ?>
                                        <?php if ( ! empty( $examples ) ) : ?>
                                        <ul>
                                            <?php foreach ( $examples as $ex ) : $txt = isset( $ex['item'] ) ? $ex['item'] : ''; ?>
                                                <li><i class="ti ti-arrow-up-right"></i><?php echo \esc_html( $txt ); ?></li>
                                            <?php endforeach; ?>
                                        </ul>
                                        <?php endif; ?>
                                        <?php if($cta_last_text) : ?>
                                        <p><?php echo \esc_html( $cta_last_text ); ?></p>
                                        <?php endif; ?>
                                        <?php if ( $cta_text ) : ?>
                                        <div class="act-btn">
                                            <a href="<?php echo \esc_url( $cta_url ? $cta_url : 'javascript:void(0)' ); ?>" class="btn btn-dark"><?php echo \esc_html( $cta_text ); ?> <i class="ti ti-arrow-right"></i></a>
                                        </div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
                <?php endif; ?>
            </div>
        </section>
        <?php
    }

    protected function content_template() {
        ?>
        <section class="feature-one">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        <div class="section-header aos" data-aos="fade-up">
                            <h2>{{{ settings.section_title || 'Why SmartHR Beats Enterprise Giants and Regional Players' }}}</h2>
                            <p>{{{ settings.section_subtitle || 'A Modular Platform Covering Every Aspect of Healthcare Delivery' }}}</p>
                        </div>
                    </div>
                </div>
                <# if ( settings.tabs && settings.tabs.length ) { #>
                <div class="row">
                    <div class="col-md-12 text-center">
                        <ul class="nav nav-tabs tabd1-menu" role="tablist">
                            <# _.each( settings.tabs, function(tab, i){ var active = (i===0)?'active':''; #>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link {{ active }}" data-bs-toggle="tab" data-bs-target="#tab-{{ i }}-{{ view.getID() }}" type="button" role="tab" aria-selected="{{ i===0 ? 'true' : 'false' }}">
                                    {{{ tab.label || '' }}}<i class="{{ tab.button_icon_class || 'ti ti-arrow-up-right' }}"></i>
                                </button>
                            </li>
                            <# }); #>
                        </ul>
                    </div>
                    <div class="tab-content">
                        <# _.each( settings.tabs, function(tab, i){ var active = (i===0)?'show active':''; #>
                        <div class="tab-pane fade {{ active }}" id="tab-{{ i }}-{{ view.getID() }}" role="tabpanel">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="sec-img-shape">
                                        <# var img = (tab.image && tab.image.url) ? tab.image.url : ''; #>
                                        <# if ( img ) { #><img src="{{ img }}" alt="" /><# } #>
                                        <div class="sec-img-shape-ico"><i class="ti ti-arrow-up-right"></i></div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="fc-card-1">
                                        <h3>{{{ tab.problem_title || '' }}}</h3>
                                        <p>{{{ tab.problem_desc || '' }}}</p>
                                        <h3>{{{ tab.diff_title || '' }}}</h3>
                                        <p>{{{ tab.diff_desc || '' }}}</p>
                                        <h3>{{{ tab.examples_title || '' }}}</h3>
                                        <ul>
                                            <# if ( tab.examples ) { _.each( tab.examples, function(ex){ #>
                                            <li><i class="ti ti-arrow-up-right"></i>{{{ ex.item || '' }}}</li>
                                            <# }); } #>
                                        </ul>
                                        <div class="act-btn">
                                            <a href="{{ (tab.cta_url && tab.cta_url.url) ? tab.cta_url.url : 'javascript:void(0)' }}" class="btn btn-dark">{{{ tab.cta_text || 'Tell Us What You Need' }}} <i class="ti ti-arrow-right"></i></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <# }); #>
                    </div>
                </div>
                <# } #>
            </div>
        </section>
        <?php
    }
}