); $this->__add_control( 'login_link_margin', array( 'label' => esc_html__( 'Margin', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['login_link'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 25 ); $this->__add_control( 'login_prefix_style', array( 'label' => esc_html__( 'Prefix', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ), 25 ); $this->__add_control( 'login_prefix_color', array( 'label' => __( 'Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['login_prefix'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'login_prefix_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['login_prefix'], ), 50 ); $this->__end_controls_section(); $this->__start_controls_section( 'section_logout_link_style', array( 'label' => esc_html__( 'Logout Link Styles', 'jet-blocks' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->__add_control( 'logout_link_style', array( 'label' => esc_html__( 'Link', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'logout_link_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['logout_link'], ), 50 ); $this->__start_controls_tabs( 'tabs_logout_link_style' ); $this->__start_controls_tab( 'tab_logout_link_normal', array( 'label' => esc_html__( 'Normal', 'jet-blocks' ), ) ); $this->__add_control( 'logout_link_text_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'scheme' => array( 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_4, ), 'default' => '', 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'logout_link_background_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] => 'background-color: {{VALUE}};', ), ), 25 ); $this->__end_controls_tab(); $this->__start_controls_tab( 'tab_logout_link_hover', array( 'label' => esc_html__( 'Hover', 'jet-blocks' ), ) ); $this->__add_control( 'logout_link_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] . ':hover' => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'logout_link_background_hover_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] . ':hover' => 'background-color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'logout_link_hover_border_color', array( 'label' => esc_html__( 'Border Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'condition' => array( 'logout_link_border_border!' => '', ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] . ':hover' => 'border-color: {{VALUE}};', ), ), 75 ); $this->__end_controls_tab(); $this->__end_controls_tabs(); $this->__add_group_control( Group_Control_Border::get_type(), array( 'name' => 'logout_link_border', 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} ' . $css_scheme['logout_link'], 'separator' => 'before', ), 75 ); $this->__add_control( 'logout_link_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 75 ); $this->__add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'logout_link_box_shadow', 'selector' => '{{WRAPPER}} ' . $css_scheme['logout_link'], ), 100 ); $this->__add_control( 'logout_link_padding', array( 'label' => esc_html__( 'Padding', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'separator' => 'before', ), 25 ); $this->__add_control( 'logout_link_margin', array( 'label' => esc_html__( 'Margin', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_link'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 25 ); $this->__add_control( 'logout_prefix_style', array( 'label' => esc_html__( 'Prefix', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ), 25 ); $this->__add_control( 'logout_prefix_color', array( 'label' => __( 'Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['logout_prefix'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'logout_prefix_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['logout_prefix'], ), 50 ); $this->__end_controls_section(); $this->__start_controls_section( 'section_register_link_style', array( 'label' => esc_html__( 'Register Link Styles', 'jet-blocks' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->__add_control( 'register_link_style', array( 'label' => esc_html__( 'Link', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'register_link_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['register_link'], ), 50 ); $this->__start_controls_tabs( 'tabs_register_link_style' ); $this->__start_controls_tab( 'tab_register_link_normal', array( 'label' => esc_html__( 'Normal', 'jet-blocks' ), ) ); $this->__add_control( 'register_link_text_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'scheme' => array( 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_4, ), 'default' => '', 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'register_link_background_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] => 'background-color: {{VALUE}};', ), ), 25 ); $this->__end_controls_tab(); $this->__start_controls_tab( 'tab_register_link_hover', array( 'label' => esc_html__( 'Hover', 'jet-blocks' ), ) ); $this->__add_control( 'register_link_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] . ':hover' => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'register_link_background_hover_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] . ':hover' => 'background-color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'register_link_hover_border_color', array( 'label' => esc_html__( 'Border Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'condition' => array( 'register_link_border_border!' => '', ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] . ':hover' => 'border-color: {{VALUE}};', ), ), 75 ); $this->__end_controls_tab(); $this->__end_controls_tabs(); $this->__add_group_control( Group_Control_Border::get_type(), array( 'name' => 'register_link_border', 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} ' . $css_scheme['register_link'], 'separator' => 'before', ), 75 ); $this->__add_control( 'register_link_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 75 ); $this->__add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'register_link_box_shadow', 'selector' => '{{WRAPPER}} ' . $css_scheme['register_link'], ), 100 ); $this->__add_control( 'register_link_padding', array( 'label' => esc_html__( 'Padding', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'separator' => 'before', ), 25 ); $this->__add_control( 'register_link_margin', array( 'label' => esc_html__( 'Margin', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_link'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 25 ); $this->__add_control( 'register_prefix_style', array( 'label' => esc_html__( 'Prefix', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ), 25 ); $this->__add_control( 'register_prefix_color', array( 'label' => __( 'Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['register_prefix'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'register_prefix_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['register_prefix'], ), 50 ); $this->__end_controls_section(); $this->__start_controls_section( 'section_registered_link_style', array( 'label' => esc_html__( 'Registered Link Styles', 'jet-blocks' ), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ) ); $this->__add_control( 'registered_link_style', array( 'label' => esc_html__( 'Link', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'registered_link_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['registered_link'], ), 50 ); $this->__start_controls_tabs( 'tabs_registered_link_style' ); $this->__start_controls_tab( 'tab_registered_link_normal', array( 'label' => esc_html__( 'Normal', 'jet-blocks' ), ) ); $this->__add_control( 'registered_link_text_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'scheme' => array( 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_4, ), 'default' => '', 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'registered_link_background_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] => 'background-color: {{VALUE}};', ), ), 25 ); $this->__end_controls_tab(); $this->__start_controls_tab( 'tab_registered_link_hover', array( 'label' => esc_html__( 'Hover', 'jet-blocks' ), ) ); $this->__add_control( 'registered_link_color', array( 'label' => esc_html__( 'Text Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] . ':hover' => 'color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'registered_link_background_hover_color', array( 'label' => esc_html__( 'Background Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] . ':hover' => 'background-color: {{VALUE}};', ), ), 25 ); $this->__add_control( 'registered_link_hover_border_color', array( 'label' => esc_html__( 'Border Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'condition' => array( 'registered_link_border_border!' => '', ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] . ':hover' => 'border-color: {{VALUE}};', ), ), 75 ); $this->__end_controls_tab(); $this->__end_controls_tabs(); $this->__add_group_control( Group_Control_Border::get_type(), array( 'name' => 'registered_link_border', 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} ' . $css_scheme['registered_link'], 'separator' => 'before', ), 75 ); $this->__add_control( 'registered_link_border_radius', array( 'label' => esc_html__( 'Border Radius', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 75 ); $this->__add_group_control( Group_Control_Box_Shadow::get_type(), array( 'name' => 'registered_link_box_shadow', 'selector' => '{{WRAPPER}} ' . $css_scheme['registered_link'], ), 100 ); $this->__add_control( 'registered_link_padding', array( 'label' => esc_html__( 'Padding', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), 'separator' => 'before', ), 25 ); $this->__add_control( 'registered_link_margin', array( 'label' => esc_html__( 'Margin', 'jet-blocks' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em', '%' ), 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_link'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ), 25 ); $this->__add_control( 'registered_prefix_style', array( 'label' => esc_html__( 'Prefix', 'jet-blocks' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ), 25 ); $this->__add_control( 'registered_prefix_color', array( 'label' => __( 'Color', 'jet-blocks' ), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} ' . $css_scheme['registered_prefix'] => 'color: {{VALUE}};', ), ), 25 ); $this->__add_group_control( Group_Control_Typography::get_type(), array( 'name' => 'registered_prefix_typography', 'scheme' => Scheme_Typography::TYPOGRAPHY_3, 'selector' => '{{WRAPPER}} ' . $css_scheme['registered_prefix'], ), 50 ); $this->__end_controls_section(); } protected function render() { $this->__context = 'render'; $this->__open_wrap(); include $this->__get_global_template( 'index' ); $this->__close_wrap(); } /** * Try to get URL from settings by name * * @param array $settings [description] * @param string $name [description] * @return [type] [description] */ public function __get_url( $settings = array(), $name = '' ) { $url = isset( $settings[ $name ] ) ? $settings[ $name ] : ''; if ( ! $url ) { return '#'; } $is_elementor_action = false !== strpos( $url, 'elementor-action' ); if ( false === strpos( $url, 'http' ) && ! $is_elementor_action ) { return get_permalink( get_page_by_path( $url ) ); } else { return $is_elementor_action ? $url : esc_url( $url ); } } /** * Logout URL * * @return string */ public function __logout_url() { $settings = $this->get_settings_for_display(); $logout_redirect = isset( $settings['logout_redirect'] ) ? $settings['logout_redirect'] : 'left'; switch ( $logout_redirect ) { case 'home': $redirect = esc_url( home_url( '/' ) ); break; case 'left': $redirect = get_permalink(); break; case 'custom': $redirect = $this->__get_url( $settings, 'logout_redirect_url' ); break; default: $redirect = ''; break; } return wp_logout_url( $redirect ); } }