PATH:
home
/
centosnipponia
/
public_html
/
sweetrich
/
wp-content
/
themes
/
sydney-pro-ii
/
inc
/
elementor
<?php namespace Elementor; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor icon list widget. * * Elementor widget that displays a bullet list with any chosen icons and texts. * * @since 1.0.0 */ class aThemes_Elementor_CF7 extends Widget_Base { /** * Get widget name. * * Retrieve icon list widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'athemes-elementor-cf7'; } /** * Get widget title. * * Retrieve icon list widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __( 'aThemes: Contact Form 7', 'sydney' ); } /** * Get widget icon. * * Retrieve icon list widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-form-horizontal'; } /** * Get widget categories. * * Retrieve the list of categories the icon list widget belongs to. * * Used to determine where to display the widget in the editor. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'sydney-elements' ]; } /** * Register icon list 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() { if( ! class_exists( 'WPCF7_ContactForm' ) ) { $this->start_controls_section( 'missing_plugin_notice_section', [ 'label' => __( 'Missing plugin: Contact Form 7', 'sydney' ), ] ); $this->add_control( 'missing_plugin_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => __('Please install <a href="plugin-install.php?s=contact+form+7&tab=search&type=term" target="_blank">Contact Form 7</a> to use this widget.', 'sydney'), ] ); $this->end_controls_section(); return; } $this->start_controls_section( 'section_forms', [ 'label' => __( 'Contact Form 7', 'sydney' ), ] ); $this->add_control( 'contact_title_heading', [ 'label' => __( 'Title', 'sydney' ), 'type' => Controls_Manager::HEADING, ] ); $this->add_control( 'form_title', [ 'label' => __( 'Form title', 'sydney' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => '', ] ); $this->add_control( 'form_title_tag', [ 'label' => __('Form title tag', 'sydney'), 'type' => Controls_Manager::SELECT, 'default' => 'h2', 'options' => [ 'h1' => __('H1', 'sydney'), 'h2' => __('H2', 'sydney'), 'h3' => __('H3', 'sydney'), 'h4' => __('H4', 'sydney'), 'h5' => __('H5', 'sydney'), 'h6' => __('H6', 'sydney'), 'span' => __('Span', 'sydney'), 'p' => __('P', 'sydney'), 'div' => __('Div', 'sydney'), ], ] ); $this->add_control( 'contact_forms_heading', [ 'label' => __( 'Form', 'sydney' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'contact_forms', [ 'label' => __('Select your form', 'sydney'), 'type' => Controls_Manager::SELECT, 'default' => 0, 'options' => $this->forms(), ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Form alignment', 'sydney' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'sydney' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'sydney' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'sydney' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => '', 'selectors_dictionary' => [ 'left' => '-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start', 'center' => '-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center', 'right' => '-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end', ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form' => '{{VALUE}}', ] ] ); $this->add_responsive_control( 'content_align', [ 'label' => esc_html__( 'Content alignment', 'sydney' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'sydney' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'sydney' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'sydney' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .athemes-ele-form' => 'text-align: {{VALUE}}', ] ] ); $this->add_responsive_control( 'size', [ 'label' => __( 'Form width', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'desktop_default' => [ 'size' => 370, 'unit' => 'px', ], 'tablet_default' => [ 'size' => 370, 'unit' => 'px', ], 'mobile_default' => [ 'size' => 370, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'contact_button_heading', [ 'label' => __( 'Button', 'sydney' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'stretch_button', [ 'label' => __( 'Stretch button?', 'sydney' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'sydney' ), 'label_off' => __( 'No', 'sydney' ), 'return_value' => 'yes', 'default' => 'no', 'selectors_dictionary' => [ 'yes' => 'width:100%', 'no' => 'width:auto', ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form input[type="submit"]' => '{{VALUE}}', ] ] ); $this->add_responsive_control( 'button_size', [ 'label' => __( 'Button max. width', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form input[type="submit"]' => 'max-width: {{SIZE}}{{UNIT}};', ], 'condition' => array( 'stretch_button' => 'yes', ), ] ); $this->add_responsive_control( 'align_button', [ 'label' => esc_html__( 'Alignment', 'sydney' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'sydney' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'sydney' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'sydney' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => '', 'selectors_dictionary' => [ 'left' => '', 'center' => 'margin-left:auto;margin-right:auto;display:table;', 'right' => 'margin-left:auto;margin-right:0;display:table;', ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form input[type="submit"]' => '{{VALUE}}', ] ] ); $this->end_controls_section(); //First part styles $this->start_controls_section( 'section_form_container', [ 'label' => __( 'Container', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'container_background', 'label' => __( 'Background', 'sydney' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .athemes-ele-form-inner', ] ); $this->add_responsive_control( 'container_padding', [ 'label' => __( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'desktop_default' => [ 'top' => 15, 'right' => 15, 'bottom' => 15, 'left' => 15, 'unit' => 'px', ], 'tablet_default' => [ 'top' => 15, 'right' => 15, 'bottom' => 15, 'left' => 15, 'unit' => 'px', ], 'mobile_default' => [ 'top' => 15, 'right' => 15, 'bottom' => 15, 'left' => 15, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'container_border', 'label' => __( 'Border', 'sydney' ), 'selector' => '{{WRAPPER}} .athemes-ele-form-inner', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'container_shadow', 'label' => __( 'Box Shadow', 'sydney' ), 'selector' => '{{WRAPPER}} .athemes-ele-form-inner', ] ); $this->end_controls_section(); //Title styles $this->start_controls_section( 'section_form_title', [ 'label' => __( 'Title', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'form_title_color', [ 'label' => __( 'Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'form_title_typography', 'selector' => '{{WRAPPER}} .athemes-ele-form-title', 'scheme' => Core\Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); //Label styles $this->start_controls_section( 'section_form_labels', [ 'label' => __( 'Labels', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'form_labels_color', [ 'label' => __( 'Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner label' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'form_labels_typography', 'selector' => '{{WRAPPER}} .athemes-ele-form-inner label', 'scheme' => Core\Schemes\Typography::TYPOGRAPHY_3, ] ); $this->end_controls_section(); //Fields styles $this->start_controls_section( 'section_form_fields', [ 'label' => __( 'Fields', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'field_background_color', [ 'label' => __( 'Background color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner input:not([type="submit"]), {{WRAPPER}} .athemes-ele-form-inner textarea, {{WRAPPER}} .athemes-ele-form-inner select' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'field_text_color', [ 'label' => __( 'Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner input:not([type="submit"]), {{WRAPPER}} .athemes-ele-form-inner textarea, {{WRAPPER}} .athemes-ele-form-inner select' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'field_placeholder_color', [ 'label' => __( 'Placeholder color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} input:not([type="submit"])::placeholder, {{WRAPPER}} textarea::placeholder' => 'color: {{VALUE}};' ] ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'field_border', 'label' => __( 'Border', 'sydney' ), 'selector' => '{{WRAPPER}} .athemes-ele-form-inner input:not([type="submit"]), {{WRAPPER}} .athemes-ele-form-inner textarea, {{WRAPPER}} .athemes-ele-form-inner select', ] ); $this->add_responsive_control( 'field_padding', [ 'label' => __( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner input:not([type="submit"]), {{WRAPPER}} .athemes-ele-form-inner textarea, {{WRAPPER}} .athemes-ele-form-inner select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'field_spacing', [ 'label' => __( 'Spacing', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .athemes-ele-form-inner input:not([type="submit"]), {{WRAPPER}} .athemes-ele-form-inner textarea' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', [ 'label' => esc_html__( 'Button', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'typography', 'selector' => '{{WRAPPER}} input[type="submit"]', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} input[type="submit"]', ] ); $this->start_controls_tabs( 'tabs_button_style' ); $this->start_controls_tab( 'tab_button_normal', [ 'label' => esc_html__( 'Normal', 'sydney' ), ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__( 'Text Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} input[type="submit"]' => 'fill: {{VALUE}}; color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'background', 'label' => esc_html__( 'Background', 'sydney' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} input[type="submit"]', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], 'color' => [ ], ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => esc_html__( 'Hover', 'sydney' ), ] ); $this->add_control( 'hover_color', [ 'label' => esc_html__( 'Text Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} input[type="submit"]:hover, {{WRAPPER}} input[type="submit"]:focus' => 'color: {{VALUE}};', '{{WRAPPER}} input[type="submit"]:hover svg, {{WRAPPER}} input[type="submit"]:focus svg' => 'fill: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background_hover', 'label' => esc_html__( 'Background', 'sydney' ), 'types' => [ 'classic', 'gradient' ], 'exclude' => [ 'image' ], 'selector' => '{{WRAPPER}} input[type="submit"]:hover, {{WRAPPER}} input[type="submit"]:focus', 'fields_options' => [ 'background' => [ 'default' => 'classic', ], ], ] ); $this->add_control( 'button_hover_border_color', [ 'label' => esc_html__( 'Border Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'condition' => [ 'border_border!' => '', ], 'selectors' => [ '{{WRAPPER}} input[type="submit"]:hover, {{WRAPPER}} input[type="submit"]:focus' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border', 'selector' => '{{WRAPPER}} input[type="submit"]', 'separator' => 'before', ] ); $this->add_control( 'border_radius', [ 'label' => esc_html__( 'Border Radius', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} input[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => '{{WRAPPER}} input[type="submit"]', ] ); $this->add_responsive_control( 'text_padding', [ 'label' => esc_html__( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } public function forms() { $forms = get_posts(array( 'post_type' => 'wpcf7_contact_form', 'showposts' => -1, )); $options = array(); $options[0] = esc_html__( 'Select a Form', 'sydney' ); if ( ! empty( $forms ) && !is_wp_error( $forms ) ){ foreach ( $forms as $form ) { $options[ $form->ID ] = $form->post_title; } } else { $options[0] = esc_html__( 'Create a form', 'sydney' ); } return $options; } /** * Render icon list 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(); ?> <div class="athemes-ele-form athemes-ele-cf7"> <div class="athemes-ele-form-inner"> <?php if ( $settings['form_title'] ) : ?> <<?php echo esc_attr( $settings['form_title_tag'] ); ?> class="athemes-ele-form-title"> <?php echo esc_html( $settings['form_title'] ); ?> </<?php echo esc_attr( $settings['form_title_tag'] ); ?>> <?php endif; ?> <?php echo do_shortcode( '[contact-form-7 id="' . $settings['contact_forms'] . '" ]' ); ?> </div> </div> <?php } /** * Render icon list widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 1.0.0 * @access protected */ protected function content_template() { } } Plugin::instance()->widgets_manager->register_widget_type( new aThemes_Elementor_CF7() );
[+]
..
[-] block-animated-heading.php
[edit]
[-] block-contact-form7.php
[edit]
[-] block-dual-buttons.php
[edit]
[-] block-dual-heading.php
[edit]
[-] block-food-menu.php
[edit]
[-] block-hotspots.php
[edit]
[-] block-ninjaforms.php
[edit]
[-] block-wpforms.php
[edit]
[-] .htaccess.disabled
[edit]