PATH:
home
/
centosnipponia
/
public_html
/
nipponiacom
/
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_Mailchimp 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-mailchimp'; } /** * Get widget title. * * Retrieve icon list widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __( 'aThemes: Mailchimp', '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-mailchimp'; } /** * 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' ]; } /** * Get widget keywords. * * Retrieve the list of keywords the widget belongs to. * * @since 1.0.0 * @access public * * @return array Widget keywords. */ public function get_keywords() { return [ 'sydney', 'athemes', 'mailchimp', 'subscribe', 'newsletter' ]; } /** * 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 ( '' == get_theme_mod( 'mailchimp_api_key', '' ) ) { $this->start_controls_section( 'missing_plugin_notice_section', [ 'label' => __( 'Missing API key', 'sydney' ), ] ); $this->add_control( 'missing_plugin_notice', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => sprintf( __( 'Please add your MailChimp API key <a href="%s" target="_blank">here</a> in order to use this widget.', 'sydney' ), admin_url( '/customize.php?autofocus[section]=sydney_mailchimp' ) ), ] ); $this->end_controls_section(); return; } $this->start_controls_section( 'section_mailchimp', [ 'label' => __( 'Mailchimp settings', 'sydney' ), ] ); //mailchimp list control $this->add_control( 'mailchimp_list', [ 'label' => __( 'Mailchimp List', 'sydney' ), 'type' => Controls_Manager::SELECT, 'default' => 'none', 'options' => sydney_get_mailchimp_lists(), ] ); //form layout $this->add_control( 'form_layout', [ 'label' => __( 'Form Layout', 'sydney' ), 'type' => Controls_Manager::SELECT, 'default' => 'layout-inline', 'options' => [ 'layout-inline' => __( 'Inline', 'sydney' ), 'layout-stacked' => __( 'Stacked', 'sydney' ), ], 'separator' => 'before', ] ); $this->add_control( 'email_label_text', [ 'label' => __('Email Label', 'sydney'), 'type' => Controls_Manager::TEXT, 'default' => 'Email', 'dynamic' => [ 'active' => true, ], 'label_block' => false, 'separator' => 'before', ] ); //first name switcher $this->add_control( 'show_fname', [ 'label' => __( 'First Name', 'sydney' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'sydney' ), 'label_off' => __( 'Hide', 'sydney' ), 'return_value' => 'yes', 'default' => 'yes', ] ); //first name label $this->add_control( 'fname_label_text', [ 'label' => __( 'First Name Label', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'First Name', 'sydney' ), 'dynamic' => [ 'active' => true, ], 'label_block' => false, 'condition' => [ 'show_fname' => 'yes', ], ] ); //last name switcher $this->add_control( 'show_lname', [ 'label' => __( 'Last Name', 'sydney' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'sydney' ), 'label_off' => __( 'Hide', 'sydney' ), 'return_value' => 'yes', 'default' => 'yes', ] ); //last name label $this->add_control( 'lname_label_text', [ 'label' => __( 'Last Name Label', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Last Name', 'sydney' ), 'dynamic' => [ 'active' => true, ], 'label_block' => false, 'condition' => [ 'show_lname' => 'yes', ], ] ); //button text $this->add_control( 'mailchimp_button', [ 'label' => __( 'Button text', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Subscribe', 'sydney' ), 'placeholder' => __( 'Type your button text here', 'sydney' ), 'separator' => 'after', ] ); //loading text $this->add_control( 'mailchimp_loading', [ 'label' => __( 'Loading text', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Loading...', 'sydney' ), 'placeholder' => __( 'Type your loading text here', 'sydney' ), ] ); //success message $this->add_control( 'mailchimp_success', [ 'label' => __( 'Success message', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Thank you for subscribing!', 'sydney' ), 'placeholder' => __( 'Type your success message here', 'sydney' ), ] ); //error message $this->add_control( 'mailchimp_error', [ 'label' => __( 'Error message', 'sydney' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Something went wrong. Please try again later.', 'sydney' ), 'placeholder' => __( 'Type your error message here', 'sydney' ), ] ); $this->end_controls_section(); //general styles $this->start_controls_section( 'section_form_general', [ 'label' => __( 'General', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); //form width $this->add_responsive_control( 'form_width', [ 'label' => __( 'Form width', 'sydney' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'size' => 100, 'unit' => '%', ], 'selectors' => [ '{{WRAPPER}} .sydney-mailchimp-form-wrapper' => 'width: {{SIZE}}{{UNIT}};', ], ] ); //form alignment $this->add_responsive_control( 'form_alignment', [ 'label' => __( 'Form alignment', 'sydney' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'sydney' ), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __( 'Center', 'sydney' ), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __( 'Right', 'sydney' ), 'icon' => 'eicon-h-align-right', ], ], 'default' => 'left', 'selectors' => [ '{{WRAPPER}} .sydney-mailchimp-form-wrapper' => 'text-align: {{VALUE}};', ], ] ); $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}} .sydney-mailchimp-form-wrapper input:not([type="submit"])' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'field_text_color', [ 'label' => __( 'Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .sydney-mailchimp-form-wrapper input:not([type="submit"])' => '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}} .sydney-mailchimp-form-wrapper input:not([type="submit"])', ] ); $this->add_responsive_control( 'field_padding', [ 'label' => __( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .sydney-mailchimp-form-wrapper input:not([type="submit"])' => '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}} .sydney-mailchimp-form-wrapper input:not([type="submit"]), {{WRAPPER}} .sydney-mailchimp-form-wrapper 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}} button[type="submit"]', ] ); $this->add_group_control( Group_Control_Text_Shadow::get_type(), [ 'name' => 'text_shadow', 'selector' => '{{WRAPPER}} button[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}} button[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}} button[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}} button[type="submit"]:hover, {{WRAPPER}} button[type="submit"]:focus' => 'color: {{VALUE}};', '{{WRAPPER}} button[type="submit"]:hover svg, {{WRAPPER}} button[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}} button[type="submit"]:hover, {{WRAPPER}} button[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}} button[type="submit"]:hover, {{WRAPPER}} button[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}} button[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}} button[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}} button[type="submit"]', ] ); $this->add_responsive_control( 'text_padding', [ 'label' => esc_html__( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} button[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); //succes/error messages styling $this->start_controls_section( 'section_messages_style', [ 'label' => esc_html__( 'Messages', 'sydney' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'messages_color', [ 'label' => esc_html__( 'Text Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .sydney-mc-response' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'messages_background', [ 'label' => esc_html__( 'Background Color', 'sydney' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .sydney-mc-response' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'messages_typography', 'selector' => '{{WRAPPER}} .sydney-mc-response', ] ); $this->add_responsive_control( 'messages_padding', [ 'label' => esc_html__( 'Padding', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .sydney-mc-response' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'messages_margin', [ 'label' => esc_html__( 'Margin', 'sydney' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .sydney-mc-response' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } /** * 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(); $api_key = get_theme_mod( 'mailchimp_api_key', '' ); if ( empty( $api_key ) ) { echo '<p class="sydney-mailchimp-error">' . __( 'Please enter your MailChimp API key in the Customizer.', 'sydney' ) . '</p>'; return; } $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'class', 'sydney-mailchimp-form-wrapper'); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'class', $settings['form_layout']); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-list-id', $settings['mailchimp_list']); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-success', esc_attr( $settings['mailchimp_success'] ) ); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-loading', esc_attr( $settings['mailchimp_loading'] ) ); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-button-text', esc_attr( $settings['mailchimp_button'] ) ); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-error', esc_attr( $settings['mailchimp_error'] ) ); $this->add_render_attribute('sydney-mailchimp-form-wrapper', 'data-mc-id', esc_attr( $this->get_id() ) ); ?> <div <?php echo $this->get_render_attribute_string( 'sydney-mailchimp-form-wrapper' ); ?>> <form id="sydney-mailchimp-form-<?php echo esc_attr($this->get_id()); ?>" method="POST"> <?php if ( $settings['show_fname'] == 'yes' ) : ?> <input type="text" name="sydney-mailchimp-fname" placeholder="<?php echo esc_attr( $settings['fname_label_text'] ); ?>"> <?php endif; ?> <?php if ( $settings['show_lname'] == 'yes' ) : ?> <input type="text" name="sydney-mailchimp-lname" placeholder="<?php echo esc_attr( $settings['lname_label_text'] ); ?>"> <?php endif; ?> <input type="email" name="sydney-mailchimp-email" placeholder="<?php echo esc_attr( $settings['email_label_text'] ); ?>" required> <button type="submit" class="sydney-mailchimp-subscribe"> <span><?php echo esc_attr( $settings['mailchimp_button'] ); ?></span> </button> <div class="sydney-mc-response"></div> </form> </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_Mailchimp() );
[+]
..
[-] block-advanced-carousel.php
[edit]
[-] 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-mailchimp.php
[edit]
[-] block-ninjaforms.php
[edit]
[-] block-wpforms.php
[edit]
[-] .htaccess.disabled
[edit]