/home/techb158/l2hypotheques.com/wp-content/plugins/pyloncore/elementor/widgets
Edit: /home/techb158/l2hypotheques.com/wp-content/plugins/pyloncore/elementor/widgets/button-widget.php (13626B)
start_controls_section(
'pylon_button_options',
[
'label' => esc_html__( 'Pylon Button', 'pyloncore' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_responsive_control(
'pylon_button_style_select',
[
'label' => esc_html__( 'Select Style', 'pyloncore' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => esc_html__( 'Style One', 'pyloncore' ),
'2' => esc_html__( 'Style Two', 'pyloncore' ),
'3' => esc_html__( 'Style Three', 'pyloncore' ),
],
]
);
$this->add_responsive_control(
'textign',
[
'label' => esc_html__( 'Alignment', 'pyloncore' ),
'type' => \Elementor\Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'pyloncore' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'pyloncore' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'pyloncore' ),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'center',
'toggle' => true,
'selectors' => [
'{{WRAPPER}} .thm-btn,{{WRAPPER}} .btn-box' => 'text-align: {{VALUE}};',
],
]
);
$this->add_control(
'pylon_button_btn_links',
[
'label' => esc_html__( 'Select Link', 'pyloncore' ),
'type' => Controls_Manager::SELECT,
'default' => 'extranal',
'options' => [
'extranal' => esc_html__( 'Extranal', 'pyloncore' ),
'page' => esc_html__( 'Page', 'pyloncore' ),
],
'label_block' => true,
]
);
$this->add_control(
'pylon_button_extral',
[
'label' => esc_html__( 'Extranal Link', 'pyloncore' ),
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__( 'Add Extranal Link', 'pyloncore' ),
'label_block' => true,
'condition' => [
'pylon_button_btn_links' => 'extranal',
],
]
);
$this->add_control(
'pylon_button_page_link',
[
'label' => esc_html__( 'Page Link', 'pyloncore' ),
'type' => Controls_Manager::SELECT,
'options' => pylon_page_list(),
'label_block' => true,
'condition' => [
'pylon_button_btn_links' => 'page',
],
]
);
$this->add_control(
'pylon_button_btn_text',
[
'label' => esc_html__( 'Buttn Text', 'pyloncore' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Apply For Loan', 'pyloncore' ),
'label_block' => true,
]
);
$this->add_control(
'pylon_button_btn_New_tab',
[
'label' => esc_html__( 'Open New Tab ? ', 'pyloncore' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'infotechcore' ),
'label_off' => esc_html__( 'No', 'infotechcore' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->end_controls_section();
$this->start_controls_section(
'pylon_button_style',
[
'label' => esc_html__( 'Button', 'pyloncore' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'pylon_button_typo',
'label' => esc_html__( 'Title Typography', 'pyloncore' ),
'selector' => '{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2',
]
);
$this->add_responsive_control(
'pylon_button_margin',
[
'label' => esc_html__( 'Margin', 'pyloncore' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'pylon_button_padding',
[
'label' => esc_html__( 'Padding', 'pyloncore' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'default' => [
'top' => '16.5',
'right' => '39.5',
'bottom' => '16.5',
'left' => '39.5',
'isLinked' => true,
],
'selectors' => [
'{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
$this->start_controls_tabs(
'pylon_button_tabs'
);
$this->start_controls_tab(
'pylon_button_n_tab',
[
'label' => esc_html__( 'Normal', 'pyloncore' ),
]
);
$this->add_responsive_control(
'pylon_button_n_color',
[
'label' => esc_html__( 'Color', 'pyloncore' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
[
'name' => 'pylon_button_n_bg',
'label' => esc_html__( 'Background', 'pyloncore' ),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2',
]
);
$this->add_group_control(
\Elementor\Group_Control_Border::get_type(),
[
'name' => 'pylon_button_n_border',
'label' => esc_html__( 'Border', 'pyloncore' ),
'selector' => '{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2',
]
);
$this->add_responsive_control(
'pylon_button_n_border_radius',
[
'label' => esc_html__( 'Border Radius', 'pyloncore' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
],
],
'default' => [
'size' => 4,
],
'selectors' => [
'{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2' => 'border-radius: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Box_Shadow::get_type(),
[
'name' => 'pylon_button_n_box_shadow',
'label' => esc_html__( 'Box Shadow', 'pyloncore' ),
'selector' => '{{WRAPPER}} .thm-btn,{{WRAPPER}} .thm-btn2',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'pylon_button_h_tab',
[
'label' => esc_html__( 'Hover', 'pyloncore' ),
]
);
$this->add_responsive_control(
'pylon_button_h_color',
[
'label' => esc_html__( 'Color', 'pyloncore' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .thm-btn:hover, {{WRAPPER}} .elementor-widget-container .btn-box .thm-btn2:before' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Background::get_type(),
[
'name' => 'pylon_button_h_bg',
'label' => esc_html__( 'Background', 'pyloncore' ),
'types' => ['classic', 'gradient'],
'selector' => '{{WRAPPER}} .thm-btn:hover,{{WRAPPER}} .thm-btn2:hover:before',
]
);
$this->add_group_control(
\Elementor\Group_Control_Border::get_type(),
[
'name' => 'pylon_button_h_border',
'label' => esc_html__( 'Border', 'pyloncore' ),
'selector' => '{{WRAPPER}} .thm-btn:hover,{{WRAPPER}} .thm-btn2:before',
]
);
$this->add_responsive_control(
'pylon_button_h_border_radius',
[
'label' => esc_html__( 'Border Radius', 'pyloncore' ),
'type' => Controls_Manager::SLIDER,
'size_units' => ['px'],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
'step' => 1,
],
],
'default' => [
'size' => 4,
],
'selectors' => [
'{{WRAPPER}} .thm-btn:hover,{{WRAPPER}} .thm-btn2:before' => 'border-radius: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Box_Shadow::get_type(),
[
'name' => 'pylon_button_h_box_shadow',
'label' => esc_html__( 'Box Shadow', 'pyloncore' ),
'selector' => '{{WRAPPER}} .thm-btn:hover,{{WRAPPER}} .thm-btn2:before',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
//Render
protected function render() {
$settings = $this->get_settings_for_display();
if ( $settings['pylon_button_btn_links'] == 'page' ) {
$pylon_link = get_page_link( $settings['pylon_button_page_link'] );
} else {
$pylon_link = $settings['pylon_button_extral'];
}
ob_start();
if($settings['pylon_button_style_select'] == '1'){
?>
target="_blank" >
';
}
echo ob_get_clean();
}
}
Plugin::instance()->widgets_manager->register_widget_type( new Pylon_button_Widget );