216 lines
5.9 KiB
PHP
216 lines
5.9 KiB
PHP
<?php namespace THINKAIPLUGIN\Element;
|
|
|
|
use Elementor\Controls_Manager;
|
|
use Elementor\Controls_Stack;
|
|
use Elementor\Group_Control_Typography;
|
|
use Elementor\Group_Control_Border;
|
|
use Elementor\Repeater;
|
|
use Elementor\Widget_Base;
|
|
use Elementor\Utils;
|
|
use Elementor\Group_Control_Text_Shadow;
|
|
use \Elementor\Group_Control_Box_Shadow;
|
|
use \Elementor\Group_Control_Background;
|
|
use \Elementor\Group_Control_Image_Size;
|
|
use \Elementor\Group_Control_Text_Stroke;
|
|
use Elementor\Plugin;
|
|
|
|
/**
|
|
* Elementor button widget.
|
|
* Elementor widget that displays a button with the ability to control every
|
|
* aspect of the button design.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
class Coming_Soon extends Widget_Base {
|
|
|
|
/**
|
|
* Get widget name.
|
|
* Retrieve button widget name.
|
|
*
|
|
* @since 1.0.0
|
|
* @access public
|
|
* @return string Widget name.
|
|
*/
|
|
public function get_name() {
|
|
return 'thinkai_coming_soon';
|
|
}
|
|
|
|
/**
|
|
* Get widget title.
|
|
* Retrieve button widget title.
|
|
*
|
|
* @since 1.0.0
|
|
* @access public
|
|
* @return string Widget title.
|
|
*/
|
|
public function get_title() {
|
|
return esc_html__( 'Thinkai Coming Soon', 'thinkai' );
|
|
}
|
|
|
|
/**
|
|
* Get widget icon.
|
|
* Retrieve button widget icon.
|
|
*
|
|
* @since 1.0.0
|
|
* @access public
|
|
* @return string Widget icon.
|
|
*/
|
|
public function get_icon() {
|
|
return 'eicon-gallery-grid';
|
|
}
|
|
|
|
/**
|
|
* Get widget categories.
|
|
* Retrieve the list of categories the button widget belongs to.
|
|
* Used to determine where to display the widget in the editor.
|
|
*
|
|
* @since 2.0.0
|
|
* @access public
|
|
* @return array Widget categories.
|
|
*/
|
|
public function get_categories() {
|
|
return [ 'thinkai' ];
|
|
}
|
|
|
|
public function get_script_depends() {
|
|
wp_register_script( 'counter-script', YT_URL . 'assets/js/cm-counter.js', [ 'elementor-frontend' ], '1.0.0', true );
|
|
return [ 'counter-script' ];
|
|
}
|
|
|
|
/**
|
|
* Register button widget controls.
|
|
* Adds different input fields to allow the user to change and customize the widget settings.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
*/
|
|
protected function register_controls() {
|
|
$this->start_controls_section(
|
|
'coming_soon',
|
|
[
|
|
'label' => esc_html__( 'Thinkai Coming Soon', 'thinkai' ),
|
|
]
|
|
);
|
|
|
|
//BG img
|
|
$this->add_control(
|
|
'bg_image',
|
|
[
|
|
'label' => __( 'BG Image', 'thinkai' ),
|
|
'type' => Controls_Manager::MEDIA,
|
|
'default' => ['url' => Utils::get_placeholder_image_src(),],
|
|
]
|
|
);
|
|
|
|
//Title
|
|
$this->add_control(
|
|
'title',
|
|
[
|
|
'label' => __( 'Title', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( 'We are Coming Soon...', 'thinkai' ),
|
|
]
|
|
);
|
|
|
|
//Counter Value
|
|
$this->add_control(
|
|
'counter_value',
|
|
[
|
|
'label' => __( 'Coming Soon Counter Value', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( '2025/12/31', 'thinkai' ),
|
|
]
|
|
);
|
|
//text
|
|
$this->add_control(
|
|
'text',
|
|
[
|
|
'label' => __( 'Description', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXTAREA,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( 'Enter You Description', 'thinkai' ),
|
|
]
|
|
);
|
|
//MailChimp Form Url
|
|
$this->add_control(
|
|
'mailchimp_form_url_v2',
|
|
[
|
|
'label' => __( 'Maichimp Form Url', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( '[mc4wp_form id=44]', 'thinkai' ),
|
|
]
|
|
);
|
|
$this->end_controls_section();
|
|
|
|
}
|
|
|
|
/**
|
|
* Render button widget output on the frontend.
|
|
* Written in PHP and used to generate the final HTML.
|
|
*
|
|
* @since 1.0.0
|
|
* @access protected
|
|
*/
|
|
protected function render() {
|
|
$settings = $this->get_settings_for_display();
|
|
$allowed_tags = wp_kses_allowed_html('post');
|
|
?>
|
|
|
|
<!--Start Coming Soon page Style1-->
|
|
<section class="coming-soon-page-style1 full-height">
|
|
<?php if($settings['bg_image']){ ?><div class="coming-soon-page-style1__bg" style="background-image: url('<?php echo esc_url(wp_get_attachment_url($settings['bg_image']['id'])); ?>');"></div><?php } ?>
|
|
<div class="coming-soon-page-style1__content">
|
|
<div class="inner">
|
|
<?php if($settings['title']){ ?><div class="big-title"><?php echo wp_kses($settings['title'], true); ?></div><?php } ?>
|
|
|
|
<?php if($settings['counter_value']){ ?>
|
|
<div class="timer-box clearfix">
|
|
<div class="countdown-timer">
|
|
<div class="default-coundown">
|
|
<div class="box">
|
|
<div class="countdown time-countdown-two" data-countdown-time="<?php echo wp_kses($settings['counter_value'], true); ?>"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['text']){ ?>
|
|
<div class="text">
|
|
<p>
|
|
<?php echo wp_kses($settings['text'], true); ?>
|
|
</p>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['mailchimp_form_url_v2']){ ?>
|
|
<div class="subscribe-box-style1">
|
|
<div class="subscribe-form" >
|
|
<?php echo do_shortcode($settings['mailchimp_form_url_v2']); ?>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!--End Coming Soon page Style1-->
|
|
|
|
<?php
|
|
}
|
|
}
|