| Server IP : 104.26.4.103 / Your IP : 216.73.216.4 Web Server : nginx/1.27.1 System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : arabianexpress ( 1872) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v9321/blueoceanprod/public_html/wp-content/plugins/techkit-core/elementor/widgets/ |
Upload File : |
<?php
/**
* @author RadiusTheme
* @since 1.0
* @version 1.0
*/
namespace radiustheme\Techkit_Core;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Typography;
if ( ! defined( 'ABSPATH' ) ) exit;
class CTA extends Custom_Widget_Base {
public function __construct( $data = [], $args = null ){
$this->rt_name = esc_html__( 'RT Call to Action', 'techkit-core' );
$this->rt_base = 'rt-cta';
parent::__construct( $data, $args );
}
public function rt_fields(){
$fields = array(
array(
'mode' => 'section_start',
'id' => 'sec_general',
'label' => esc_html__( 'General', 'techkit-core' ),
),
array(
'type' => Controls_Manager::SELECT2,
'id' => 'style',
'label' => esc_html__( 'CTA Style', 'techkit-core' ),
'options' => array(
'style1' => esc_html__( 'Style 1' , 'techkit-core' ),
'style2' => esc_html__( 'Style 2', 'techkit-core' ),
),
'default' => 'style1',
),
array(
'type' => Controls_Manager::CHOOSE,
'id' => 'content_align',
'mode' => 'responsive',
'label' => esc_html__( 'Alignment', 'techkit-core' ),
'options' => array(
'left' => array(
'title' => __( 'Left', 'elementor' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => __( 'Center', 'elementor' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => __( 'Right', 'elementor' ),
'icon' => 'eicon-text-align-right',
),
'justify' => array(
'title' => __( 'Justified', 'elementor' ),
'icon' => 'eicon-text-align-justify',
),
),
'default' => '',
'selectors' => array(
'{{WRAPPER}}' => 'text-align: {{VALUE}};',
),
'condition' => array( 'style' => array( 'style1' ) ),
),
array(
'type' => Controls_Manager::TEXTAREA,
'id' => 'title',
'label' => esc_html__( 'Title', 'techkit-core' ),
'default' => esc_html__( 'NEED A CONSULTATION?', 'techkit-core' ),
),
array(
'type' => Controls_Manager::TEXTAREA,
'id' => 'sub_title',
'label' => esc_html__( 'Sub Title', 'techkit-core' ),
'default' => esc_html__( 'We are here to answer your questions 24/7', 'techkit-core' ),
'condition' => array( 'style' => array( 'style1' ) ),
),
array(
'type' => Controls_Manager::TEXTAREA,
'id' => 'content',
'label' => esc_html__( 'Content Text ', 'techkit-core' ),
'default' => esc_html__( 'As well known and we are very busy all days advice you. advice you to call us of before arriving, so we can guarantee your seat.', 'techkit-core' ),
),
array(
'type' => Controls_Manager::TEXT,
'id' => 'buttontext',
'label' => esc_html__( 'Button Text', 'techkit-core' ),
'default' => esc_html__( 'Contact Us', 'techkit-core' ),
'condition' => array( 'style' => array( 'style1','style2' ) ),
),
array(
'type' => Controls_Manager::URL,
'id' => 'buttonurl',
'label' => esc_html__( 'Button URL', 'techkit-core' ),
'placeholder' => 'https://your-link.com',
'condition' => array( 'style' => array( 'style1','style2' ) ),
),
array(
'type' => Controls_Manager::TEXT,
'id' => 'buttontext2',
'label' => esc_html__( 'Button Text', 'techkit-core' ),
'default' => esc_html__( 'Lets Talk', 'techkit-core' ),
'condition' => array( 'style' => array( 'style2' ) ),
),
array(
'type' => Controls_Manager::URL,
'id' => 'buttonurl2',
'label' => esc_html__( 'Button URL', 'techkit-core' ),
'placeholder' => 'https://your-link.com',
'condition' => array( 'style' => array( 'style2' ) ),
),
array(
'type' => Controls_Manager::DIMENSIONS,
'id' => 'button_margin',
'mode' => 'responsive',
'label' => esc_html__( 'Button Space', 'techkit-core' ),
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .cta-default .action-box .rtin-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'condition' => array( 'style' => array( 'style1' ) ),
),
array(
'mode' => 'section_end',
),
// Title style
array(
'mode' => 'section_start',
'id' => 'sec_title_style',
'label' => esc_html__( 'Title Style', 'techkit-core' ),
'tab' => Controls_Manager::TAB_STYLE,
),
array (
'mode' => 'group',
'type' => Group_Control_Typography::get_type(),
'name' => 'title_typo',
'label' => esc_html__( 'Title Typo', 'techkit-core' ),
'selector' => '{{WRAPPER}} .cta-default .action-box .rtin-title',
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'title_color',
'label' => esc_html__( 'Title Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .action-box .rtin-title' => 'color: {{VALUE}}',
),
),
array(
'mode' => 'section_end',
),
// Sub Title style
array(
'mode' => 'section_start',
'id' => 'sec_subtitle_style',
'label' => esc_html__( 'Sub Title Style', 'techkit-core' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => array( 'style' => array( 'style1' ) ),
),
array (
'mode' => 'group',
'type' => Group_Control_Typography::get_type(),
'name' => 'sub_title_typo',
'label' => esc_html__( 'Sub Title Typo', 'techkit-core' ),
'selector' => '{{WRAPPER}} .cta-default .action-box .rtin-subtitle',
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'sub_title_color',
'label' => esc_html__( 'Sub Title Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .action-box .rtin-subtitle' => 'color: {{VALUE}}',
),
),
array(
'mode' => 'section_end',
),
// Content style
array(
'mode' => 'section_start',
'id' => 'sec_text_style',
'label' => esc_html__( 'Text Style', 'techkit-core' ),
'tab' => Controls_Manager::TAB_STYLE,
),
array (
'mode' => 'group',
'type' => Group_Control_Typography::get_type(),
'name' => 'text_typo',
'label' => esc_html__( 'Content Typo', 'techkit-core' ),
'selector' => '{{WRAPPER}} .cta-default .action-box p',
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'content_color',
'label' => esc_html__( 'Content Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .action-box p' => 'color: {{VALUE}}',
'{{WRAPPER}} .cta-style2 .item-phone .phone-content .call-text' => 'color: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::DIMENSIONS,
'id' => 'content_margin',
'mode' => 'responsive',
'label' => esc_html__( 'Content Space', 'techkit-core' ),
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .cta-default .action-box p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
),
array(
'mode' => 'section_end',
),
// Button style 1
array(
'mode' => 'section_start',
'id' => 'sec_button_style',
'label' => esc_html__( 'Button Style 1', 'techkit-core' ),
'tab' => Controls_Manager::TAB_STYLE,
),
array (
'mode' => 'group',
'type' => Group_Control_Typography::get_type(),
'name' => 'button_typo',
'label' => esc_html__( 'Button Typo', 'techkit-core' ),
'selector' => '{{WRAPPER}} .cta-default .btn-common',
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'button_bag_color',
'label' => esc_html__( 'Button Background Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-2' => 'background-color: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'button_bag_hover_color',
'label' => esc_html__( 'Button Background Hover Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-2:hover' => 'background-color: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'button_text_color',
'label' => esc_html__( 'Button Text Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-2' => 'color: {{VALUE}}',
'{{WRAPPER}} .cta-default .button-style-2 path.rt-button-cap' => 'stroke: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'button_text_hover_color',
'label' => esc_html__( 'Button Text Hover Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-2:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .cta-default .button-style-2:hover path.rt-button-cap' => 'stroke: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::DIMENSIONS,
'id' => 'buttons_margin',
'mode' => 'responsive',
'label' => esc_html__( 'Button Margin', 'techkit-core' ),
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .cta-default .rtin-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
),
array(
'type' => Controls_Manager::DIMENSIONS,
'id' => 'buttons_padding',
'mode' => 'responsive',
'label' => esc_html__( 'Button Padding', 'techkit-core' ),
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .cta-default .button-style-2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
),
array(
'mode' => 'section_end',
),
// Button style 2
array(
'mode' => 'section_start',
'id' => 'sec_button2_style',
'label' => esc_html__( 'Button Style 2', 'techkit-core' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => array( 'style' => array( 'style2' ) ),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'border_color',
'label' => esc_html__( 'Button Border Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-3' => 'border-color: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'border_hover_color',
'label' => esc_html__( 'Button Border Hover Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default a.button-style-3:hover' => 'border-color: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'border_text2_color',
'label' => esc_html__( 'Button Text Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-3' => 'color: {{VALUE}}',
'{{WRAPPER}} .cta-default .button-style-3 path.rt-button-cap' => 'stroke: {{VALUE}}',
),
),
array(
'type' => Controls_Manager::COLOR,
'id' => 'button_text2_hover_color',
'label' => esc_html__( 'Button Text Hover Color', 'techkit-core' ),
'default' => '',
'selectors' => array(
'{{WRAPPER}} .cta-default .button-style-3:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .cta-default .button-style-3:hover path.rt-button-cap' => 'stroke: {{VALUE}}',
),
),
array(
'mode' => 'section_end',
),
);
return $fields;
}
protected function render() {
$data = $this->get_settings();
switch ( $data['style'] ) {
case 'style2':
$template = 'cta-2';
break;
default:
$template = 'cta-1';
break;
}
return $this->rt_template( $template, $data );
}
}