first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,901 @@
<?php
/**
* Class: Jet_Blocks_Breadcrumbs
* Name: Breadcrumbs
* Slug: jet-breadcrumbs
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Blocks_Breadcrumbs extends Jet_Blocks_Base {
public function get_name() {
return 'jet-breadcrumbs';
}
public function get_title() {
return esc_html__( 'Breadcrumbs', 'jet-blocks' );
}
public function get_icon() {
return 'jet-blocks-icon-breadcrumbs';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/how-to-add-breadcrumbs-to-the-header-built-with-elementor-breadcrumbs-path-customization/';
}
public function get_categories() {
return array( 'jet-blocks' );
}
public function is_reload_preview_required() {
return true;
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-blocks/jet-breadcrumbs/css-scheme',
array(
'module' => '.jet-breadcrumbs',
'title' => '.jet-breadcrumbs__title',
'content' => '.jet-breadcrumbs__content',
'browse' => '.jet-breadcrumbs__browse',
'item' => '.jet-breadcrumbs__item',
'sep' => '.jet-breadcrumbs__item-sep',
'link' => '.jet-breadcrumbs__item-link',
'target' => '.jet-breadcrumbs__item-target',
)
);
$this->start_controls_section(
'section_breadcrumbs_settings',
array(
'label' => esc_html__( 'General Settings', 'jet-blocks' ),
)
);
$this->add_control(
'show_on_front',
array(
'label' => esc_html__( 'Show on Front Page', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'prefix_class' => 'jet-breadcrumbs-on-front-',
)
);
$this->add_control(
'show_title',
array(
'label' => esc_html__( 'Show Page Title', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
'render_type' => 'template',
'prefix_class' => 'jet-breadcrumbs-page-title-',
)
);
$this->add_control(
'title_tag',
array(
'label' => esc_html__( 'Title HTML Tag', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
),
'default' => 'h3',
'condition' => array(
'show_title' => 'yes',
),
)
);
$this->add_control(
'show_browse',
array(
'label' => esc_html__( 'Show Prefix', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
)
);
$this->add_control(
'browse_label',
array(
'label' => esc_html__( 'Prefix for the breadcrumb path', 'jet-blocks' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Browse:', 'jet-blocks' ),
'condition' => array(
'show_browse' => 'yes',
),
)
);
$this->add_control(
'separator_type',
array(
'label' => esc_html__( 'Separator Type', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'icon' => esc_html__( 'Icon', 'jet-blocks' ),
'custom' => esc_html__( 'Custom', 'jet-blocks' ),
),
'default' => 'icon',
)
);
$this->__add_advanced_icon_control(
'icon_separator',
array(
'label' => esc_html__( 'Icon Separator', 'jet-blocks' ),
'type' => Controls_Manager::ICON,
'default' => 'fa fa-angle-right',
'fa5_default' => array(
'value' => 'fas fa-angle-right',
'library' => 'fa-solid',
),
'condition' => array(
'separator_type' => 'icon',
),
)
);
$this->add_control(
'custom_separator',
array(
'label' => esc_html__( 'Custom Separator', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => '/',
'condition' => array(
'separator_type' => 'custom',
),
)
);
$this->add_control(
'path_type',
array(
'label' => esc_html__( 'Path type', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'default' => 'full',
'options' => array(
'full' => esc_html__( 'Full', 'jet-blocks' ),
'minified' => esc_html__( 'Minified', 'jet-blocks' ),
),
)
);
$this->add_responsive_control(
'alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-blocks' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-blocks' ),
'icon' => 'fa fa-align-right',
),
'justify' => array(
'title' => esc_html__( 'Justified', 'jet-blocks' ),
'icon' => 'fa fa-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['module'] => 'text-align: {{VALUE}};',
),
'prefix_class' => 'jet-breadcrumbs-align%s-',
)
);
$this->add_control(
'order',
array(
'label' => esc_html__( 'Order', 'jet-blocks' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => '-1',
'options' => array(
'-1' => esc_html__( 'Page Title / Breadcrumbs Items', 'jet-blocks' ),
'1' => esc_html__( 'Breadcrumbs Items / Page Title', 'jet-blocks' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'order: {{VALUE}};',
),
'condition' => array(
'show_title' => 'yes',
),
'separator' => 'before',
)
);
$this->add_control(
'breadcrumbs_settings_desc',
array(
'type' => Controls_Manager::RAW_HTML,
'content_classes' => 'elementor-descriptor',
'separator' => 'before',
'raw' => sprintf(
esc_html__( 'Additional settings are available in the %s', 'jet-blocks' ),
'<a target="_blank" href="' . jet_blocks_settings()->get_settings_page_link() . '">' . esc_html__( 'Settings page', 'jet-blocks' ) . '</a>'
),
)
);
$this->end_controls_section();
/**
* `Page Title` Section
*/
$this->__start_controls_section(
'title_style',
array(
'label' => esc_html__( 'Page Title', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
'condition' => array(
'show_title' => 'yes',
),
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
),
50
);
$this->__add_control(
'title_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'title_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'background-color: {{VALUE}};',
),
),
75
);
$this->__add_responsive_control(
'title_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_responsive_control(
'title_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'title_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
),75
);
$this->__add_responsive_control(
'title_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),75
);
$this->__end_controls_section();
/**
* `Breadcrumbs` Section
*/
$this->__start_controls_section(
'breadcrumbs_style',
array(
'label' => esc_html__( 'Breadcrumbs', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'breadcrumbs_crumbs_heading',
array(
'label' => esc_html__( 'Crumbs Style', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
),
25
);
$this->__start_controls_tabs( 'breadcrumbs_item_style' );
$this->__start_controls_tab(
'breadcrumbs_item_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'breadcrumbs_item_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['item'],
),
50
);
$this->__add_control(
'breadcrumbs_link_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_link_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] => 'background-color: {{VALUE}};',
),
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'breadcrumbs_item_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'breadcrumbs_link_hover_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['link'] . ':hover',
),
50
);
$this->__add_control(
'breadcrumbs_link_hover_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] . ':hover' => 'color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_link_hover_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] . ':hover' => 'background-color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_link_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'breadcrumbs_item_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] . ':hover' => 'border-color: {{VALUE}};',
),
),
75
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'breadcrumbs_item_target',
array(
'label' => esc_html__( 'Current', 'jet-blocks' ),
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'breadcrumbs_target_item_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['target'],
),
50
);
$this->__add_control(
'breadcrumbs_target_item_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['target'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_target_item_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['target'] => 'background-color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_target_item_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'breadcrumbs_item_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['item'] . ' ' . $css_scheme['target'] => 'border-color: {{VALUE}};',
),
),
75
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_responsive_control(
'breadcrumbs_item_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['target'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before',
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'breadcrumbs_item_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['link'] . ', {{WRAPPER}} ' . $css_scheme['target'],
),
75
);
$this->__add_responsive_control(
'breadcrumbs_item_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['link'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} ' . $css_scheme['target'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_control(
'breadcrumbs_sep_heading',
array(
'label' => esc_html__( 'Separators Style', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__add_responsive_control(
'breadcrumbs_sep_gap',
array(
'label' => esc_html__( 'Gap', 'jet-blocks' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}};',
),
),
25
);
$this->__add_responsive_control(
'breadcrumbs_sep_icon_size',
array(
'label' => esc_html__( 'Icon Size', 'jet-blocks' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px', 'em', 'rem' ),
'range' => array(
'px' => array(
'min' => 5,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'font-size: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'separator_type' => 'icon',
),
),
50
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'breadcrumbs_sep_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['sep'],
'condition' => array(
'separator_type' => 'custom',
),
),
50
);
$this->__add_control(
'breadcrumbs_sep_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'breadcrumbs_sep_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'background-color: {{VALUE}};',
),
),
25
);
$this->__add_responsive_control(
'breadcrumbs_sep_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'breadcrumbs_sep_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['sep'],
),
75
);
$this->__add_responsive_control(
'breadcrumbs_sep_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sep'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_control(
'breadcrumbs_browse_heading',
array(
'label' => esc_html__( 'Prefix Style', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
'condition' => array(
'show_browse' => 'yes',
),
),
25
);
$this->__add_responsive_control(
'breadcrumbs_browse_gap',
array(
'label' => esc_html__( 'Gap', 'jet-blocks' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['browse'] => 'margin-right: {{SIZE}}{{UNIT}};',
),
'condition' => array(
'show_browse' => 'yes',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'breadcrumbs_browse_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['browse'],
'condition' => array(
'show_browse' => 'yes',
),
),
50
);
$this->__add_control(
'breadcrumbs_browse_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['browse'] => 'color: {{VALUE}};',
),
'condition' => array(
'show_browse' => 'yes',
),
),
25
);
$this->__add_control(
'breadcrumbs_browse_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['browse'] => 'background-color: {{VALUE}};',
),
'condition' => array(
'show_browse' => 'yes',
),
),
25
);
$this->__add_responsive_control(
'breadcrumbs_browse_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['browse'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'condition' => array(
'show_browse' => 'yes',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'breadcrumbs_browse_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['browse'],
'condition' => array(
'show_browse' => 'yes',
),
),
75
);
$this->__add_responsive_control(
'breadcrumbs_browse_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['browse'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'condition' => array(
'show_browse' => 'yes',
),
),
75
);
$this->__end_controls_section();
}
protected function render() {
$this->__open_wrap();
$settings = $this->get_settings();
$title_format = '<' . $settings['title_tag'] . ' class="jet-breadcrumbs__title">%s</' . $settings['title_tag'] . '>';
$args = array(
'wrapper_format' => '%1$s%2$s',
'page_title_format' => $title_format,
'separator' => $this->__get_separator(),
'show_on_front' => filter_var( $settings['show_on_front'], FILTER_VALIDATE_BOOLEAN ),
'show_title' => filter_var( $settings['show_title'], FILTER_VALIDATE_BOOLEAN ),
'show_browse' => filter_var( $settings['show_browse'], FILTER_VALIDATE_BOOLEAN ),
'path_type' => $settings['path_type'],
'action' => 'jet_breadcrumbs/render',
'strings' => array(
'browse' => $settings['browse_label'],
'error_404' => esc_html__( '404 Not Found', 'jet-blocks' ),
'archives' => esc_html__( 'Archives', 'jet-blocks' ),
'search' => esc_html__( 'Search results for &#8220;%s&#8221;', 'jet-blocks' ),
'paged' => esc_html__( 'Page %s', 'jet-blocks' ),
'archive_minute' => esc_html__( 'Minute %s', 'jet-blocks' ),
'archive_week' => esc_html__( 'Week %s', 'jet-blocks' ),
),
'date_labels' => array(
'archive_minute_hour' => esc_html_x( 'g:i a', 'minute and hour archives time format', 'jet-blocks' ),
'archive_minute' => esc_html_x( 'i', 'minute archives time format', 'jet-blocks' ),
'archive_hour' => esc_html_x( 'g a', 'hour archives time format', 'jet-blocks' ),
'archive_year' => esc_html_x( 'Y', 'yearly archives date format', 'jet-blocks' ),
'archive_month' => esc_html_x( 'F', 'monthly archives date format', 'jet-blocks' ),
'archive_day' => esc_html_x( 'j', 'daily archives date format', 'jet-blocks' ),
'archive_week' => esc_html_x( 'W', 'weekly archives date format', 'jet-blocks' ),
),
'css_namespace' => array(
'module' => 'jet-breadcrumbs',
'content' => 'jet-breadcrumbs__content',
'wrap' => 'jet-breadcrumbs__wrap',
'browse' => 'jet-breadcrumbs__browse',
'item' => 'jet-breadcrumbs__item',
'separator' => 'jet-breadcrumbs__item-sep',
'link' => 'jet-breadcrumbs__item-link',
'target' => 'jet-breadcrumbs__item-target',
),
'post_taxonomy' => apply_filters(
'cx_breadcrumbs/trail_taxonomies',
jet_blocks_tools()->get_breadcrumbs_post_taxonomy_settings()
),
);
$breadcrumbs = new \CX_Breadcrumbs( $args );
$breadcrumbs->get_trail();
$this->__close_wrap();
}
/**
* [__get_separator description]
* @return [type] [description]
*/
public function __get_separator() {
$separator = '';
$settings = $this->get_settings();
$separator_type = $settings['separator_type'];
if ( 'icon' === $separator_type ) {
$separator = $this->__get_icon( 'icon_separator', '<span class="jet-blocks-icon">%s</span>' );
} else {
$separator = sprintf( '<span>%s</span>', $settings['custom_separator'] );
}
return $separator;
}
}

View File

@@ -0,0 +1,787 @@
<?php
/**
* Class: Jet_Blocks_Hamburger_Panel
* Name: Hamburger Panel
* Slug: jet-hamburger-panel
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Blocks_Hamburger_Panel extends Jet_Blocks_Base {
public function get_name() {
return 'jet-hamburger-panel';
}
public function get_title() {
return esc_html__( 'Hamburger Panel', 'jet-blocks' );
}
public function get_icon() {
return 'jet-blocks-icon-hamburger-panel';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetblocks-how-to-display-any-template-within-a-hamburger-panel/';
}
public function get_categories() {
return array( 'jet-blocks' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-blocks/hamburger-panel/css-scheme',
array(
'panel' => '.jet-hamburger-panel',
'instance' => '.jet-hamburger-panel__instance',
'cover' => '.jet-hamburger-panel__cover',
'inner' => '.jet-hamburger-panel__inner',
'content' => '.jet-hamburger-panel__content',
'close' => '.jet-hamburger-panel__close-button',
'toggle' => '.jet-hamburger-panel__toggle',
'icon' => '.jet-hamburger-panel__icon',
'label' => '.jet-hamburger-panel__toggle-label',
)
);
$this->start_controls_section(
'section_content',
array(
'label' => esc_html__( 'Content', 'jet-blocks' ),
)
);
$this->__add_advanced_icon_control(
'panel_toggle_icon',
array(
'label' => esc_html__( 'Icon', 'jet-blocks' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-align-justify',
'fa5_default' => array(
'value' => 'fas fa-align-justify',
'library' => 'fa-solid',
),
)
);
$this->__add_advanced_icon_control(
'panel_toggle_active_icon',
array(
'label' => esc_html__( 'Active Icon', 'jet-blocks' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-close',
'fa5_default' => array(
'value' => 'fas fa-times',
'library' => 'fa-solid',
),
)
);
$this->__add_advanced_icon_control(
'panel_close_icon',
array(
'label' => esc_html__( 'Close Icon', 'jet-blocks' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-close',
'fa5_default' => array(
'value' => 'fas fa-times',
'library' => 'fa-solid',
),
)
);
$this->add_control(
'panel_toggle_label',
array(
'label' => esc_html__( 'Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'More', 'jet-blocks' ),
)
);
$this->add_responsive_control(
'panel_toggle_label_alignment',
array(
'label' => esc_html__( 'Toggle Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-blocks' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'eicon-h-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-blocks' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['panel'] => 'justify-content: {{VALUE}};',
),
)
);
$templates = jet_blocks()->elementor()->templates_manager->get_source( 'local' )->get_items();
if ( empty( $templates ) ) {
$this->add_control(
'no_templates',
array(
'label' => false,
'type' => Controls_Manager::RAW_HTML,
'raw' => $this->empty_templates_message(),
)
);
return;
}
$options = [
'0' => '— ' . esc_html__( 'Select', 'jet-blocks' ) . ' —',
];
$types = [];
foreach ( $templates as $template ) {
$options[ $template['template_id'] ] = $template['title'] . ' (' . $template['type'] . ')';
$types[ $template['template_id'] ] = $template['type'];
}
$this->add_control(
'panel_template_id',
array(
'label' => esc_html__( 'Choose Template', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'default' => '0',
'options' => $options,
'types' => $types,
'label_block' => 'true',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-blocks' ),
)
);
$this->add_control(
'position',
array(
'label' => esc_html__( 'Position', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'default' => 'right',
'options' => array(
'right' => esc_html__( 'Right', 'jet-blocks' ),
'left' => esc_html__( 'Left', 'jet-blocks' ),
),
)
);
$this->add_control(
'animation_effect',
array(
'label' => esc_html__( 'Effect', 'jet-blocks' ),
'type' => Controls_Manager::SELECT,
'default' => 'slide',
'options' => array(
'slide' => esc_html__( 'Slide', 'jet-blocks' ),
'fade' => esc_html__( 'Fade', 'jet-blocks' ),
'zoom' => esc_html__( 'Zoom', 'jet-blocks' ),
),
)
);
$this->add_control(
'z_index',
array(
'label' => esc_html__( 'Z-Index', 'jet-blocks' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 100000,
'step' => 1,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'z-index: {{VALUE}};',
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'section_panel_style',
array(
'label' => esc_html__( 'Panel', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'panel_width',
array(
'label' => esc_html__( 'Panel Width', 'jet-blocks' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px', '%',
),
'range' => array(
'px' => array(
'min' => 250,
'max' => 800,
),
'%' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['instance'] => 'width: {{SIZE}}{{UNIT}};',
),
),
25
);
$this->__add_responsive_control(
'panel_padding',
array(
'label' => __( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'panel_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['inner'],
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'panel_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['inner'],
),
75
);
$this->__add_control(
'panel_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['inner'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'panel_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['inner'],
),
75
);
$this->__add_control(
'cover_style_heading',
array(
'label' => esc_html__( 'Cover', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__add_control(
'cover_bg_color',
array(
'label' => esc_html__( 'Background color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['cover'] => 'background-color: {{VALUE}};',
),
),
25
);
$this->__add_control(
'close_button_style_heading',
array(
'label' => esc_html__( 'Close Button', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__start_controls_tabs( 'close_button_styles' );
$this->__start_controls_tab(
'close_button_control',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_group_control(
\Jet_Blocks_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Close Icon', 'jet-blocks' ),
'name' => 'close_icon_box',
'selector' => '{{WRAPPER}} ' . $css_scheme['close'],
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'close_button_control_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_group_control(
\Jet_Blocks_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Close Icon', 'jet-blocks' ),
'name' => 'close_icon_box_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['close'] . ':hover',
),
25
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__end_controls_section();
$this->__start_controls_section(
'section_panel_toggle_style',
array(
'label' => esc_html__( 'Toggle', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__start_controls_tabs( 'toggle_styles' );
$this->__start_controls_tab(
'toggle_tab_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_background',
'fields_options' => array(
'color' => array(
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
),
),
),
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'toggle_tab_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'toggle_background_hover',
'fields_options' => array(
'color' => array(
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
),
),
),
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . ':hover',
),
25
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_responsive_control(
'toggle_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before',
),
25
);
$this->__add_responsive_control(
'toggle_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'toggle_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
75
);
$this->__add_control(
'toggle_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'toggle_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'],
),
100
);
$this->__add_control(
'toggle_icon_style_heading',
array(
'label' => esc_html__( 'Icon Styles', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__start_controls_tabs( 'toggle_icon_styles' );
$this->__start_controls_tab(
'toggle_icon_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_group_control(
\Jet_Blocks_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Toggle Icon', 'jet-blocks' ),
'name' => 'toggle_icon_box',
'selector' => '{{WRAPPER}} ' . $css_scheme['icon'],
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'toggle_icon_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_group_control(
\Jet_Blocks_Group_Control_Box_Style::get_type(),
array(
'label' => esc_html__( 'Toggle Icon', 'jet-blocks' ),
'name' => 'toggle_icon_box_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . ':hover ' . $css_scheme['icon'],
),
25
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_control(
'toggle_label_style_heading',
array(
'label' => esc_html__( 'Label Styles', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__start_controls_tabs( 'toggle_label_styles' );
$this->__start_controls_tab(
'toggle_label_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_control(
'toggle_control_label_color',
array(
'label' => esc_html__( 'Label Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'toggle_label_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} '. $css_scheme['label'],
),
50
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'toggle_label_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_control(
'toggle_control_label_color_hover',
array(
'label' => esc_html__( 'Label Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['toggle'] . ':hover ' . $css_scheme['label'] => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'toggle_label_typography_hover',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['toggle'] . ':hover ' . $css_scheme['label'],
),
50
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__end_controls_section();
}
protected function render() {
$this->__context = 'render';
$panel_settings = $this->get_settings();
$template_id = isset( $panel_settings['panel_template_id'] ) ? $panel_settings['panel_template_id'] : '0';
$position = isset( $panel_settings['position'] ) ? $panel_settings['position'] : 'right';
$animation_effect = isset( $panel_settings['animation_effect'] ) ? $panel_settings['animation_effect'] : 'slide';
$settings = array(
'position' => $position,
);
$this->add_render_attribute( 'instance', array(
'class' => array(
'jet-hamburger-panel',
//'jet-hamburger-panel-' . $panel_settings['type'] . '-type',
'jet-hamburger-panel-' . $position . '-position',
'jet-hamburger-panel-' . $animation_effect . '-effect',
),
'data-settings' => json_encode( $settings ),
) );
$close_button_html = $this->__get_icon( 'panel_close_icon', '<div class="jet-hamburger-panel__close-button jet-blocks-icon">%s</div>' );
$toggle_control_html = '';
$toggle_icon = $this->__get_icon( 'panel_toggle_icon', '<span class="jet-hamburger-panel__icon icon-normal jet-blocks-icon">%s</span>' );
$toggle_active_icon = $this->__get_icon( 'panel_toggle_active_icon', '<span class="jet-hamburger-panel__icon icon-active jet-blocks-icon">%s</span>' );
if ( ! empty( $toggle_icon ) && ! empty( $toggle_active_icon ) ) {
$toggle_control_html .= sprintf( '<div class="jet-hamburger-panel__toggle-icon">%1$s%2$s</div>', $toggle_icon, $toggle_active_icon );
}
$toggle_label_html = '';
if ( ! empty( $panel_settings['panel_toggle_label'] ) ) {
$toggle_label_html .= sprintf( '<div class="jet-hamburger-panel__toggle-label"><span>%1$s</span></div>', $panel_settings['panel_toggle_label'] );
}
$toggle_html = sprintf( '<div class="jet-hamburger-panel__toggle">%1$s%2$s</div>', $toggle_control_html, $toggle_label_html );
?>
<div <?php echo $this->get_render_attribute_string( 'instance' ); ?>>
<?php echo $toggle_html; ?>
<div class="jet-hamburger-panel__instance">
<div class="jet-hamburger-panel__cover"></div>
<div class="jet-hamburger-panel__inner">
<?php
echo $close_button_html;
if ( '0' !== $template_id ) {
$link = add_query_arg(
array(
'elementor' => '',
),
get_permalink( $template_id )
);
if ( jet_blocks_integration()->in_elementor() ) {
echo sprintf( '<div class="jet-blocks__edit-cover" data-template-edit-link="%s"><i class="fa fa-pencil"></i><span>%s</span></div>', $link, esc_html__( 'Edit Template', 'jet-blocks' ) );
}
}
?>
<div class="jet-hamburger-panel__content"><?php
$content_html = '';
if ( '0' !== $template_id ) {
$content_html .= jet_blocks()->elementor()->frontend->get_builder_content_for_display( $template_id );
} else {
$content_html = $this->no_templates_message();
}
echo $content_html;
?>
</div>
</div>
</div>
</div>
<?php
}
/**
* Empty templates message description
*
* @return string
*/
public function empty_templates_message() {
return '<div id="elementor-widget-template-empty-templates">
<div class="elementor-widget-template-empty-templates-icon"><i class="eicon-nerd"></i></div>
<div class="elementor-widget-template-empty-templates-title">' . esc_html__( 'You Havent Saved Templates Yet.', 'jet-blocks' ) . '</div>
<div class="elementor-widget-template-empty-templates-footer">' . esc_html__( 'What is Library?', 'jet-blocks' ) . ' <a class="elementor-widget-template-empty-templates-footer-url" href="https://go.elementor.com/docs-library/" target="_blank">' . esc_html__( 'Read our tutorial on using Library templates.', 'jet-blocks' ) . '</a></div>
</div>';
}
/**
* No templates message
*
* @return string
*/
public function no_templates_message() {
$message = '<span>' . esc_html__( 'Template is not defined. ', 'jet-blocks' ) . '</span>';
$url = add_query_arg(
array(
'post_type' => 'elementor_library',
'action' => 'elementor_new_post',
'_wpnonce' => wp_create_nonce( 'elementor_action_new_post' ),
'template_type' => 'section',
),
esc_url( admin_url( '/edit.php' ) )
);
$new_link = '<span>' . esc_html__( 'Select an existing template or create a ', 'jet-blocks' ) . '</span><a class="jet-blocks-new-template-link elementor-clickable" href="' . $url . '" target="_blank">' . esc_html__( 'new one', 'jet-blocks' ) . '</a>' ;
return sprintf(
'<div class="jet-blocks-no-template-message">%1$s%2$s</div>',
$message,
jet_blocks_integration()->in_elementor() ? $new_link : ''
);
}
}

View File

@@ -0,0 +1,795 @@
<?php
/**
* Class: Jet_Blocks_Login
* Name: Login
* Slug: jet-login
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Blocks_Login extends Jet_Blocks_Base {
public function get_name() {
return 'jet-login';
}
public function get_title() {
return esc_html__( 'Login Form', 'jet-blocks' );
}
public function get_icon() {
return 'jet-blocks-icon-login';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/how-to-add-a-login-form-to-the-header-built-with-elementor/';
}
public function get_categories() {
return array( 'jet-blocks' );
}
protected function _register_controls() {
$this->start_controls_section(
'section_content',
array(
'label' => esc_html__( 'Content', 'jet-blocks' ),
)
);
$this->add_control(
'label_username',
array(
'label' => esc_html__( 'Username Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Username', 'jet-blocks' ),
)
);
$this->add_control(
'label_password',
array(
'label' => esc_html__( 'Password Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Password', 'jet-blocks' ),
)
);
$this->add_control(
'label_remember',
array(
'label' => esc_html__( 'Remember Me Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Remember Me', 'jet-blocks' ),
)
);
$this->add_control(
'label_log_in',
array(
'label' => esc_html__( 'Log In Button Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Log In', 'jet-blocks' ),
)
);
$this->add_control(
'login_redirect',
array(
'type' => 'select',
'label' => esc_html__( 'Redirect After Login', 'jet-blocks' ),
'default' => 'home',
'options' => array(
'home' => esc_html__( 'Home page', 'jet-blocks' ),
'left' => esc_html__( 'Stay on the current page', 'jet-blocks' ),
'custom' => esc_html__( 'Custom URL', 'jet-blocks' ),
),
)
);
$this->add_control(
'login_redirect_url',
array(
'label' => esc_html__( 'Redirect URL', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => '',
'condition' => array(
'login_redirect' => 'custom',
),
)
);
$this->add_control(
'label_logged_in',
array(
'label' => esc_html__( 'Logged in message', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'You already logged in', 'jet-blocks' ),
)
);
$this->add_control(
'lost_password_link',
array(
'label' => esc_html__( 'Lost Password link', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'default' => '',
)
);
$this->add_control(
'lost_password_link_text',
array(
'label' => esc_html__( 'Lost Password link text', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Lost your password?', 'jet-blocks' ),
'condition' => array(
'lost_password_link' => 'yes',
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'login_fields_style',
array(
'label' => esc_html__( 'Fields', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'input_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login input.input' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'input_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login input.input' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'input_typography',
'selector' => '{{WRAPPER}} .jet-login input.input',
),
50
);
$this->__add_responsive_control(
'input_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login input.input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_responsive_control(
'input_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login input.input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'input_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-login input.input',
),
50
);
$this->__add_responsive_control(
'input_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-login input.input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'input_box_shadow',
'selector' => '{{WRAPPER}} .jet-login input.input',
),
100
);
$this->__end_controls_section();
$this->__start_controls_section(
'login_labels_style',
array(
'label' => esc_html__( 'Labels', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'labels_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login label' => 'background-color: {{VALUE}}',
),
),
50
);
$this->__add_control(
'labels_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login label' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'labels_typography',
'selector' => '{{WRAPPER}} .jet-login label',
),
50
);
$this->__add_responsive_control(
'labels_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_responsive_control(
'labels_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'labels_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-login label',
),
75
);
$this->__add_responsive_control(
'labels_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-login label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'labels_box_shadow',
'selector' => '{{WRAPPER}} .jet-login label',
),
100
);
$this->__end_controls_section();
$this->__start_controls_section(
'login_submit_style',
array(
'label' => esc_html__( 'Submit', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__start_controls_tabs( 'tabs_form_submit_style' );
$this->__start_controls_tab(
'login_form_submit_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_control(
'login_submit_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} input[type="submit"]' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'login_submit_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} input[type="submit"]' => 'color: {{VALUE}}',
),
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'login_form_submit_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_control(
'login_submit_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} input[type="submit"]:hover' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'login_submit_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} input[type="submit"]:hover' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'login_submit_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'login_submit_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} input[type="submit"]:hover' => 'border-color: {{VALUE}};',
),
),
75
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'login_submit_typography',
'selector' => '{{WRAPPER}} input[type="submit"]',
'fields_options' => array(
'typography' => array(
'separator' => 'before',
),
),
),
50
);
$this->__add_responsive_control(
'login_submit_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before',
),
25
);
$this->__add_responsive_control(
'login_submit_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} input[type="submit"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'login_submit_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} input[type="submit"]',
),
75
);
$this->__add_responsive_control(
'login_submit_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} input[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'login_submit_box_shadow',
'selector' => '{{WRAPPER}} input[type="submit"]',
),
100
);
$this->__add_responsive_control(
'login_submit_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-blocks' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-blocks' ),
'icon' => 'fa fa-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} .login-submit' => 'text-align: {{VALUE}};',
),
),
50
);
$this->__end_controls_section();
$this->__start_controls_section(
'lost_password_link_style',
array(
'label' => esc_html__( 'Lost Password Link', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
'condition' => array(
'lost_password_link' => 'yes',
),
)
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'lost_password_link_typography',
'selector' => '{{WRAPPER}} .jet-login-lost-password-link',
),
50
);
$this->__add_control(
'lost_password_link_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-lost-password-link' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'lost_password_link_hover_color',
array(
'label' => esc_html__( 'Hover Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-lost-password-link:hover' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'lost_password_link_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login-lost-password-link' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__end_controls_section();
$this->__start_controls_section(
'login_errors_style',
array(
'label' => esc_html__( 'Errors', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'errors_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-message' => 'background-color: {{VALUE}}',
),
),
50
);
$this->__add_control(
'errors_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-message' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'errors_link_color',
array(
'label' => esc_html__( 'Link Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-message a' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'errors_link_hover_color',
array(
'label' => esc_html__( 'Link Hover Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-login-message a:hover' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'errors_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login-message' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_responsive_control(
'errors_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-login-message' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'errors_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-login-message',
),
75
);
$this->__add_responsive_control(
'errors_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-login-message' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'errors_box_shadow',
'selector' => '{{WRAPPER}} .jet-login-message',
),
100
);
$this->__end_controls_section();
}
protected function render() {
$this->__context = 'render';
$settings = $this->get_settings();
if ( is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
$this->__open_wrap();
echo $settings['label_logged_in'];
$this->__close_wrap();
return;
}
$this->__open_wrap();
$redirect_url = site_url( $_SERVER['REQUEST_URI'] );
switch ( $settings['login_redirect'] ) {
case 'home':
$redirect_url = esc_url( home_url( '/' ) );
break;
case 'custom':
$redirect_url = esc_url( $settings['login_redirect_url'] );
break;
}
add_filter( 'login_form_bottom', array( $this, 'add_login_fields' ) );
$login_form = wp_login_form( array(
'echo' => false,
'redirect' => $redirect_url,
'label_username' => $settings['label_username'],
'label_password' => $settings['label_password'],
'label_remember' => $settings['label_remember'],
'label_log_in' => $settings['label_log_in'],
) );
remove_filter( 'login_form_bottom', array( $this, 'add_login_fields' ) );
$login_form = preg_replace( '/action=[\'\"].*?[\'\"]/', '', $login_form );
echo '<div class="jet-login">';
echo $login_form;
include $this->__get_global_template( 'lost-password-link' );
include $this->__get_global_template( 'messages' );
echo '</div>';
$this->__close_wrap();
}
/**
* Add form fields
*
* @param string $content
* @return string
*/
public function add_login_fields( $content ) {
$content .= '<input type="hidden" name="jet_login" value="1">';
return $content;
}
}

View File

@@ -0,0 +1,472 @@
<?php
/**
* Class: Jet_Blocks_Logo
* Name: Logo
* Slug: jet-logo
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Blocks_Logo extends Jet_Blocks_Base {
public function get_name() {
return 'jet-logo';
}
public function get_title() {
return esc_html__( 'Site Logo', 'jet-blocks' );
}
public function get_icon() {
return 'jet-blocks-icon-logo';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/how-to-display-a-website-logo-in-the-header-built-with-elementor/';
}
public function get_categories() {
return array( 'jet-blocks' );
}
protected function _register_controls() {
$this->start_controls_section(
'section_content',
array(
'label' => esc_html__( 'Content', 'jet-blocks' ),
)
);
$this->add_control(
'logo_type',
array(
'type' => 'select',
'label' => esc_html__( 'Logo Type', 'jet-blocks' ),
'default' => 'text',
'options' => array(
'text' => esc_html__( 'Text', 'jet-blocks' ),
'image' => esc_html__( 'Image', 'jet-blocks' ),
'both' => esc_html__( 'Both Text and Image', 'jet-blocks' ),
),
)
);
$this->add_control(
'logo_image',
array(
'label' => esc_html__( 'Logo Image', 'jet-blocks' ),
'type' => Controls_Manager::MEDIA,
'condition' => array(
'logo_type!' => 'text',
),
)
);
$this->add_control(
'logo_image_2x',
array(
'label' => esc_html__( 'Retina Logo Image', 'jet-blocks' ),
'type' => Controls_Manager::MEDIA,
'condition' => array(
'logo_type!' => 'text',
),
)
);
$this->add_control(
'logo_text_from',
array(
'type' => 'select',
'label' => esc_html__( 'Logo Text From', 'jet-blocks' ),
'default' => 'site_name',
'options' => array(
'site_name' => esc_html__( 'Site Name', 'jet-blocks' ),
'custom' => esc_html__( 'Custom', 'jet-blocks' ),
),
'condition' => array(
'logo_type!' => 'image',
),
)
);
$this->add_control(
'logo_text',
array(
'label' => esc_html__( 'Custom Logo Text', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'condition' => array(
'logo_text_from' => 'custom',
'logo_type!' => 'image',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-blocks' ),
)
);
$this->add_control(
'linked_logo',
array(
'label' => esc_html__( 'Linked Logo', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-blocks' ),
'label_off' => esc_html__( 'No', 'jet-blocks' ),
'return_value' => 'true',
'default' => 'true',
)
);
$this->add_control(
'remove_link_on_front',
array(
'label' => esc_html__( 'Remove Link on Front Page', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-blocks' ),
'label_off' => esc_html__( 'No', 'jet-blocks' ),
'return_value' => 'true',
'default' => '',
)
);
$this->add_control(
'logo_display',
array(
'type' => 'select',
'label' => esc_html__( 'Display Logo Image and Text', 'jet-blocks' ),
'label_block' => true,
'default' => 'block',
'options' => array(
'inline' => esc_html__( 'Inline', 'jet-blocks' ),
'block' => esc_html__( 'Text Below Image', 'jet-blocks' ),
),
'condition' => array(
'logo_type' => 'both',
),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'logo_style',
array(
'label' => esc_html__( 'Logo', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_responsive_control(
'logo_alignment',
array(
'label' => esc_html__( 'Logo Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-blocks' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'eicon-h-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-blocks' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'selectors' => array(
'{{WRAPPER}} .jet-logo' => 'justify-content: {{VALUE}}',
),
),
25
);
$this->__add_control(
'vertical_logo_alignment',
array(
'label' => esc_html__( 'Image and Text Vertical Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'label_block' => true,
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Top', 'jet-blocks' ),
'icon' => 'eicon-v-align-top',
),
'center' => array(
'title' => esc_html__( 'Middle', 'jet-blocks' ),
'icon' => 'eicon-v-align-middle',
),
'flex-end' => array(
'title' => esc_html__( 'Bottom', 'jet-blocks' ),
'icon' => 'eicon-v-align-bottom',
),
'baseline' => array(
'title' => esc_html__( 'Baseline', 'jet-blocks' ),
'icon' => 'eicon-v-align-bottom',
),
),
'selectors' => array(
'{{WRAPPER}} .jet-logo__link' => 'align-items: {{VALUE}}',
),
'condition' => array(
'logo_type' => 'both',
'logo_display' => 'inline',
),
),
25
);
$this->__end_controls_section();
$this->__start_controls_section(
'text_logo_style',
array(
'label' => esc_html__( 'Text', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'text_logo_color',
array(
'label' => esc_html__( 'Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_4,
),
'selectors' => array(
'{{WRAPPER}} .jet-logo__text' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'text_logo_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .jet-logo__text',
),
50
);
$this->__add_control(
'text_logo_gap',
array(
'label' => esc_html__( 'Gap', 'jet-blocks' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'size' => 5,
),
'range' => array(
'px' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-logo-display-block .jet-logo__img' => 'margin-bottom: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .jet-logo-display-inline .jet-logo__img' => 'margin-right: {{SIZE}}{{UNIT}}',
),
'condition' => array(
'logo_type' => 'both',
),
),
25
);
$this->__add_responsive_control(
'text_logo_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-blocks' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-blocks' ),
'icon' => 'fa fa-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} .jet-logo__text' => 'text-align: {{VALUE}}',
),
'condition' => array(
'logo_type' => 'both',
'logo_display' => 'block',
),
),
50
);
$this->__end_controls_section();
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
}
/**
* Check if logo is linked
* @return [type] [description]
*/
public function __is_linked() {
$settings = $this->get_settings();
if ( empty( $settings['linked_logo'] ) ) {
return false;
}
if ( 'true' === $settings['remove_link_on_front'] && is_front_page() ) {
return false;
}
return true;
}
/**
* Returns logo text
*
* @return string Text logo HTML markup.
*/
public function __get_logo_text() {
$settings = $this->get_settings();
$type = isset( $settings['logo_type'] ) ? esc_attr( $settings['logo_type'] ) : 'text';
$text_from = isset( $settings['logo_text_from'] ) ? esc_attr( $settings['logo_text_from'] ) : 'site_name';
$custom_text = isset( $settings['logo_text'] ) ? esc_attr( $settings['logo_text'] ) : '';
if ( 'image' === $type ) {
return;
}
if ( 'site_name' === $text_from ) {
$text = get_bloginfo( 'name' );
} else {
$text = $custom_text;
}
$format = apply_filters(
'jet-blocks/widgets/logo/text-foramt',
'<div class="jet-logo__text">%s</div>'
);
return sprintf( $format, $text );
}
/**
* Returns logo classes string
*
* @return string
*/
public function __get_logo_classes() {
$settings = $this->get_settings();
$classes = array(
'jet-logo',
'jet-logo-type-' . $settings['logo_type'],
'jet-logo-display-' . $settings['logo_display'],
);
return implode( ' ', $classes );
}
/**
* Returns logo image
*
* @return string Image logo HTML markup.
*/
public function __get_logo_image() {
$settings = $this->get_settings();
$type = isset( $settings['logo_type'] ) ? esc_attr( $settings['logo_type'] ) : 'text';
$image = isset( $settings['logo_image'] ) ? $settings['logo_image'] : false;
$image_2x = isset( $settings['logo_image_2x'] ) ? $settings['logo_image_2x'] : false;
if ( 'text' === $type || ! $image ) {
return;
}
$image_src = $this->__get_logo_image_src( $image );
$image_2x_src = $this->__get_logo_image_src( $image_2x );
if ( empty( $image_src ) && empty( $image_2x_src ) ) {
return;
}
$format = apply_filters(
'jet-blocks/widgets/logo/image-format',
'<img src="%1$s" class="jet-logo__img" alt="%2$s"%3$s>'
);
$image_data = ! empty( $image['id'] ) ? wp_get_attachment_image_src( $image['id'], 'full' ) : array();
$width = isset( $image_data[1] ) ? $image_data[1] : false;
$height = isset( $image_data[2] ) ? $image_data[2] : false;
$attrs = sprintf(
'%1$s%2$s%3$s',
$width ? ' width="' . $width . '"' : '',
$height ? ' height="' . $height . '"' : '',
( ! empty( $image_2x_src ) ? ' srcset="' . esc_url( $image_2x_src ) . ' 2x"' : '' )
);
return sprintf( $format, esc_url( $image_src ), get_bloginfo( 'name' ), $attrs );
}
public function __get_logo_image_src( $args = array() ) {
if ( ! empty( $args['id'] ) ) {
$img_data = wp_get_attachment_image_src( $args['id'], 'full' );
return ! empty( $img_data[0] ) ? $img_data[0] : false;
}
if ( ! empty( $args['url'] ) ) {
return $args['url'];
}
return false;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,772 @@
<?php
/**
* Class: Jet_Blocks_Register
* Name: Register
* Slug: jet-register
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Blocks_Register extends Jet_Blocks_Base {
public function get_name() {
return 'jet-register';
}
public function get_title() {
return esc_html__( 'Registration Form', 'jet-blocks' );
}
public function get_icon() {
return 'jet-blocks-icon-register';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/how-to-add-a-registration-form-to-the-website-captcha-integration/';
}
public function get_categories() {
return array( 'jet-blocks' );
}
protected function _register_controls() {
$this->start_controls_section(
'section_content',
array(
'label' => esc_html__( 'Content', 'jet-blocks' ),
)
);
$this->add_control(
'label_username',
array(
'label' => esc_html__( 'Username Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Username', 'jet-blocks' ),
)
);
$this->add_control(
'placeholder_username',
array(
'label' => esc_html__( 'Username Placeholder', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Username', 'jet-blocks' ),
)
);
$this->add_control(
'label_email',
array(
'label' => esc_html__( 'Email Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Email', 'jet-blocks' ),
)
);
$this->add_control(
'placeholder_email',
array(
'label' => esc_html__( 'Email Placeholder', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Email', 'jet-blocks' ),
)
);
$this->add_control(
'label_pass',
array(
'label' => esc_html__( 'Password Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Password', 'jet-blocks' ),
)
);
$this->add_control(
'placeholder_pass',
array(
'label' => esc_html__( 'Password Placeholder', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Password', 'jet-blocks' ),
)
);
$this->add_control(
'confirm_password',
array(
'label' => esc_html__( 'Show Confirm Password Field', 'jet-blocks' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-blocks' ),
'label_off' => esc_html__( 'No', 'jet-blocks' ),
'return_value' => 'yes',
'default' => 'yes',
)
);
$this->add_control(
'label_pass_confirm',
array(
'label' => esc_html__( 'Confirm Password Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Please Confirm Password', 'jet-blocks' ),
'condition' => array(
'confirm_password' => 'yes'
)
)
);
$this->add_control(
'placeholder_pass_confirm',
array(
'label' => esc_html__( 'Confirm Password Placeholder', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Confirm Password', 'jet-blocks' ),
'condition' => array(
'confirm_password' => 'yes'
)
)
);
$this->add_control(
'label_submit',
array(
'label' => esc_html__( 'Register Button Label', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Register', 'jet-blocks' ),
)
);
$this->add_control(
'register_redirect',
array(
'type' => 'select',
'label' => esc_html__( 'Redirect After Register', 'jet-blocks' ),
'default' => 'home',
'options' => array(
'home' => esc_html__( 'Home page', 'jet-blocks' ),
'left' => esc_html__( 'Stay on the current page', 'jet-blocks' ),
'custom' => esc_html__( 'Custom URL', 'jet-blocks' ),
),
)
);
$this->add_control(
'register_redirect_url',
array(
'label' => esc_html__( 'Redirect URL', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => '',
'condition' => array(
'register_redirect' => 'custom',
),
)
);
$this->add_control(
'label_registered',
array(
'label' => esc_html__( 'User Registered Message', 'jet-blocks' ),
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'You already registered', 'jet-blocks' ),
)
);
$this->end_controls_section();
$this->__start_controls_section(
'register_fields_style',
array(
'label' => esc_html__( 'Fields', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'input_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__input' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'input_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__input' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'input_typography',
'selector' => '{{WRAPPER}} .jet-register__input',
),
50
);
$this->__add_control(
'placeholder_style',
array(
'label' => esc_html__( 'Placeholder', 'jet-blocks' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
),
25
);
$this->__add_control(
'input_placeholder_color',
array(
'label' => esc_html__( 'Placeholder Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__input::-webkit-input-placeholder' => 'color: {{VALUE}};',
'{{WRAPPER}} .jet-register__input::-moz-placeholder' => 'color: {{VALUE}}',
'{{WRAPPER}} .jet-register__input:-ms-input-placeholder' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'input_placeholder_typography',
'selector' => '{{WRAPPER}} .jet-register__input::-webkit-input-placeholder',
),
50
);
$this->__add_responsive_control(
'input_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'separator' => 'before',
'selectors' => array(
'{{WRAPPER}} .jet-register__input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_responsive_control(
'input_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__input' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'input_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-register__input',
),
50
);
$this->__add_responsive_control(
'input_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'input_box_shadow',
'selector' => '{{WRAPPER}} .jet-register__input',
),
100
);
$this->__end_controls_section();
$this->__start_controls_section(
'register_labels_style',
array(
'label' => esc_html__( 'Labels', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'labels_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__label' => 'background-color: {{VALUE}}',
),
),
50
);
$this->__add_control(
'labels_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__label' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'labels_typography',
'selector' => '{{WRAPPER}} .jet-register__label',
),
50
);
$this->__add_responsive_control(
'labels_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_responsive_control(
'labels_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'labels_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-register__label',
),
75
);
$this->__add_responsive_control(
'labels_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'labels_box_shadow',
'selector' => '{{WRAPPER}} .jet-register__label',
),
100
);
$this->__end_controls_section();
$this->__start_controls_section(
'register_submit_style',
array(
'label' => esc_html__( 'Submit', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__start_controls_tabs( 'tabs_form_submit_style' );
$this->__start_controls_tab(
'register_form_submit_normal',
array(
'label' => esc_html__( 'Normal', 'jet-blocks' ),
)
);
$this->__add_control(
'register_submit_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__submit' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'register_submit_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__submit' => 'color: {{VALUE}}',
),
),
25
);
$this->__end_controls_tab();
$this->__start_controls_tab(
'register_form_submit_hover',
array(
'label' => esc_html__( 'Hover', 'jet-blocks' ),
)
);
$this->__add_control(
'register_submit_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__submit:hover' => 'background-color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'register_submit_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register__submit:hover' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_control(
'register_submit_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'register_submit_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-register__submit:hover' => 'border-color: {{VALUE}};',
),
),
75
);
$this->__end_controls_tab();
$this->__end_controls_tabs();
$this->__add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'register_submit_typography',
'selector' => '{{WRAPPER}} .jet-register__submit',
'fields_options' => array(
'typography' => array(
'separator' => 'before',
),
),
),
50
);
$this->__add_responsive_control(
'register_submit_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before',
),
25
);
$this->__add_responsive_control(
'register_submit_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__submit' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'register_submit_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-register__submit',
),
75
);
$this->__add_responsive_control(
'register_submit_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-register__submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'register_submit_box_shadow',
'selector' => '{{WRAPPER}} .jet-register__submit',
),
100
);
$this->__add_responsive_control(
'register_submit_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-blocks' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-blocks' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-blocks' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-blocks' ),
'icon' => 'fa fa-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} .jet-register-submit' => 'text-align: {{VALUE}};',
),
),
50
);
$this->__end_controls_section();
$this->__start_controls_section(
'login_errors_style',
array(
'label' => esc_html__( 'Errors', 'jet-blocks' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->__add_control(
'errors_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register-message' => 'background-color: {{VALUE}}',
),
),
50
);
$this->__add_control(
'errors_color',
array(
'label' => esc_html__( 'Text Color', 'jet-blocks' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-register-message' => 'color: {{VALUE}}',
),
),
25
);
$this->__add_responsive_control(
'errors_padding',
array(
'label' => esc_html__( 'Padding', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register-message' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
50
);
$this->__add_responsive_control(
'errors_margin',
array(
'label' => esc_html__( 'Margin', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-register-message' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
25
);
$this->__add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'errors_border',
'label' => esc_html__( 'Border', 'jet-blocks' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-register-message',
),
75
);
$this->__add_responsive_control(
'errors_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-blocks' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-register-message' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
),
75
);
$this->__add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'errors_box_shadow',
'selector' => '{{WRAPPER}} .jet-register-message',
),
100
);
$this->__end_controls_section();
}
protected function render() {
$this->__context = 'render';
$settings = $this->get_settings();
if ( is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
$this->__open_wrap();
echo $settings['label_registered'];
$this->__close_wrap();
return;
}
$registration_enabled = get_option( 'users_can_register' );
if ( ! $registration_enabled && ! jet_blocks_integration()->in_elementor() ) {
$this->__open_wrap();
esc_html_e( 'Registration disabled', 'jet-blocks' );
$this->__close_wrap();
return;
}
$this->__open_wrap();
$redirect_url = site_url( $_SERVER['REQUEST_URI'] );
switch ( $settings['register_redirect'] ) {
case 'home':
$redirect_url = esc_url( home_url( '/' ) );
break;
case 'custom':
$redirect_url = $settings['register_redirect_url'];
break;
}
if ( ! $registration_enabled ) {
esc_html_e( 'Registration currently disabled and this form will not be visible for guest users. Please, enable registration in Settings/General or remove this widget from the page.', 'jet-blocks' );
}
include $this->__get_global_template( 'index' );
$this->__close_wrap();
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff