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

View File

@@ -0,0 +1,130 @@
<?php
/**
* Main dashboard template
*/
?><div id="jet-blocks-settings-page">
<div class="jet-blocks-settings-page">
<h1 class="cs-vui-title"><?php _e( 'JetBlocks Settings', 'jet-blocks' ); ?></h1>
<div class="cx-vui-panel">
<cx-vui-tabs
:in-panel="false"
value="general-settings"
layout="vertical">
<?php do_action( 'jet-blocks/settings-page-template/tabs-start' ); ?>
<cx-vui-tabs-panel
name="general-settings"
label="<?php _e( 'General Settings', 'jet-blocks' ); ?>"
key="general-settings">
<cx-vui-select
name="widgets_load_level"
label="<?php _e( 'Editor Load Level', 'jet-blocks' ); ?>"
description="<?php _e( 'Choose a certain set of options in the widgets Style tab by moving the slider, and improve your Elementor editor performance by selecting appropriate style settings fill level (from None to Full level)', 'jet-blocks' ); ?>"
:wrapper-css="[ 'equalwidth' ]"
size="fullwidth"
:options-list="pageOptions.widgets_load_level.options"
v-model="pageOptions.widgets_load_level.value">
</cx-vui-select>
</cx-vui-tabs-panel>
<cx-vui-tabs-panel
name="breadcrumb-settings"
label="<?php _e( 'Breadcrumb Settings', 'jet-blocks' ); ?>"
key="breadcrumb-settings"><?php
$post_types = get_post_types( array( 'public' => true ), 'objects' );
if ( is_array( $post_types ) && ! empty( $post_types ) ) {
foreach ( $post_types as $post_type ) {
$taxonomies = get_object_taxonomies( $post_type->name, 'objects' );
if ( is_array( $taxonomies ) && ! empty( $taxonomies ) ) {
$post_type_name = 'breadcrumbs_taxonomy_' . $post_type->name;
?><cx-vui-select
name="<?php echo $post_type_name; ?>"
label="<?php echo $post_type->label; ?>"
:wrapper-css="[ 'equalwidth' ]"
size="fullwidth"
:options-list="pageOptions['<?php echo $post_type_name; ?>']['options']"
v-model="pageOptions['<?php echo $post_type_name; ?>']['value']"
></cx-vui-select><?php
}
}
}
?></cx-vui-tabs-panel>
<cx-vui-tabs-panel
name="available-widgets"
label="<?php _e( 'Available Widgets', 'jet-blocks' ); ?>"
key="available-widgets">
<div class="jet-blocks-settings-page__disable-all-widgets">
<div class="cx-vui-component__label">
<span v-if="disableAllWidgets"><?php _e( 'Disable All Widgets', 'jet-blocks' ); ?></span>
<span v-if="!disableAllWidgets"><?php _e( 'Enable All Widgets', 'jet-blocks' ); ?></span>
</div>
<cx-vui-switcher
name="disable-all-avaliable-widgets"
:prevent-wrap="true"
:return-true="true"
:return-false="false"
@input="disableAllWidgetsEvent"
v-model="disableAllWidgets">
</cx-vui-switcher>
</div>
<div class="jet-blocks-settings-page__avaliable-controls">
<div
class="jet-blocks-settings-page__avaliable-control"
v-for="(option, index) in pageOptions.avaliable_widgets.options">
<cx-vui-switcher
:key="index"
:name="`avaliable-widget-${option.value}`"
:label="option.label"
:wrapper-css="[ 'equalwidth' ]"
return-true="true"
return-false="false"
v-model="pageOptions.avaliable_widgets.value[option.value]"
>
</cx-vui-switcher>
</div>
</div>
</cx-vui-tabs-panel>
<cx-vui-tabs-panel
name="available-extensions"
label="<?php _e( 'Available Extensions', 'jet-blocks' ); ?>"
key="available-extensions">
<div class="jet-blocks-settings-page__avaliable-controls">
<div
class="jet-blocks-settings-page__avaliable-control"
v-for="(option, index) in pageOptions.avaliable_extensions.options">
<cx-vui-switcher
:key="index"
:name="`avaliable-extension-${option.value}`"
:label="option.label"
:wrapper-css="[ 'equalwidth' ]"
return-true="true"
return-false="false"
v-model="pageOptions.avaliable_extensions.value[option.value]"
>
</cx-vui-switcher>
</div>
</div>
</cx-vui-tabs-panel>
<?php do_action( 'jet-blocks/settings-page-template/tabs-end' ); ?>
</cx-vui-tabs>
</div>
</div>
</div>

View File

@@ -0,0 +1,24 @@
<?php
/**
* Auth Links Template
*/
$settings = $this->get_settings_for_display();
$order = isset( $settings['order'] ) ? esc_attr( $settings['order'] ) : 'login_register';
switch ( $order ) {
case 'register_login':
$templates_order = array( 'register', 'registered', 'login', 'logout' );
break;
default:
$templates_order = array( 'login', 'logout', 'register', 'registered' );
break;
}
?>
<div class="jet-auth-links"><?php
foreach ( $templates_order as $template ) {
include $this->__get_global_template( $template );
}
?></div>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Login Link template
*/
if ( ! $settings['show_login_link'] ) {
return;
}
if ( is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
return;
}
$url = $this->__get_url( $settings, 'login_link_url' );
?>
<div class="jet-auth-links__section jet-auth-links__login">
<?php $this->__html( 'login_prefix', '<div class="jet-auth-links__prefix">%s</div>' ); ?>
<a class="jet-auth-links__item" href="<?php echo $url; ?>"><?php
$this->__icon( 'login_link_icon', '<span class="jet-auth-links__item-icon jet-blocks-icon">%s</span>' );
$this->__html( 'login_link_text', '<span class="jet-auth-links__item-text">%s</span>' );
?></a>
</div>

View File

@@ -0,0 +1,23 @@
<?php
/**
* Login Link template
*/
if ( ! $settings['show_logout_link'] ) {
return;
}
if ( ! is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
return;
}
$prefix = $this->__get_html( 'logout_prefix', '<div class="jet-auth-links__prefix">%s</div>' );
$current_user = wp_get_current_user();
?>
<div class="jet-auth-links__section jet-auth-links__logout">
<?php printf( $prefix, $current_user->display_name ); ?>
<a class="jet-auth-links__item" href="<?php echo $this->__logout_url(); ?>"><?php
$this->__icon( 'logout_link_icon', '<span class="jet-auth-links__item-icon jet-blocks-icon">%s</span>' );
$this->__html( 'logout_link_text', '<span class="jet-auth-links__item-text">%s</span>' );
?></a>
</div>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Register Link template
*/
if ( ! $settings['show_register_link'] ) {
return;
}
if ( is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
return;
}
$url = $this->__get_url( $settings, 'register_link_url' );
?>
<div class="jet-auth-links__section jet-auth-links__register">
<?php $this->__html( 'register_prefix', '<div class="jet-auth-links__prefix">%s</div>' ); ?>
<a class="jet-auth-links__item" href="<?php echo $url; ?>"><?php
$this->__icon( 'register_link_icon', '<span class="jet-auth-links__item-icon jet-blocks-icon">%s</span>' );
$this->__html( 'register_link_text', '<span class="jet-auth-links__item-text">%s</span>' );
?></a>
</div>

View File

@@ -0,0 +1,22 @@
<?php
/**
* Register Link template
*/
if ( ! $settings['show_registered_link'] ) {
return;
}
if ( ! is_user_logged_in() && ! jet_blocks_integration()->in_elementor() ) {
return;
}
$url = $this->__get_url( $settings, 'registered_link_url' );
?>
<div class="jet-auth-links__section jet-auth-links__registered">
<?php $this->__html( 'registered_prefix', '<div class="jet-auth-links__prefix">%s</div>' ); ?>
<a class="jet-auth-links__item" href="<?php echo $url; ?>"><?php
$this->__icon( 'registered_link_icon', '<span class="jet-auth-links__item-icon jet-blocks-icon">%s</span>' );
$this->__html( 'registered_link_text', '<span class="jet-auth-links__item-text">%s</span>' );
?></a>
</div>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Cart count template
*/
$elementor = Elementor\Plugin::instance();
$is_edit_mode = $elementor->editor->is_edit_mode();
if ( ( $is_edit_mode && ! wp_doing_ajax() ) || null === WC()->cart ) {
$count = '';
} else {
$count = WC()->cart->get_cart_contents_count();
}
?>
<span class="jet-blocks-cart__count-val"><?php
echo $count;
?></span>

View File

@@ -0,0 +1,35 @@
<?php
/**
* Cart Link
*/
$this->add_render_attribute( 'cart-link', 'href', esc_url( wc_get_cart_url() ) );
$this->add_render_attribute( 'cart-link', 'class', 'jet-blocks-cart__heading-link' );
$this->add_render_attribute( 'cart-link', 'title', esc_attr__( 'View your shopping cart', 'jet-blocks' ) );
?>
<a <?php echo $this->get_render_attribute_string( 'cart-link' ); ?>><?php
$this->__icon( 'cart_icon', '<span class="jet-blocks-cart__icon jet-blocks-icon">%s</span>' );
$this->__html( 'cart_label', '<span class="jet-blocks-cart__label">%s</span>' );
if ( 'yes' === $settings['show_count'] ) {
?>
<span class="jet-blocks-cart__count"><?php
ob_start();
include $this->__get_global_template( 'cart-count' );
printf( $settings['count_format'], ob_get_clean() );
?></span>
<?php
}
if ( 'yes' === $settings['show_total'] ) {
?>
<span class="jet-blocks-cart__total"><?php
ob_start();
include $this->__get_global_template( 'cart-totals' );
printf( $settings['total_format'], ob_get_clean() );
?></span>
<?php
}
?></a>

View File

@@ -0,0 +1,9 @@
<?php
/**
* Cart list template
*/
?>
<div class="jet-blocks-cart__list">
<?php $this->__html( 'cart_list_label', '<h4 class="jet-blocks-cart__list-title">%s</h4>' ); ?>
<?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
</div>

View File

@@ -0,0 +1,18 @@
<?php
/**
* Cart totals template
*/
$elementor = Elementor\Plugin::instance();
$is_edit_mode = $elementor->editor->is_edit_mode();
if ( ( $is_edit_mode && ! wp_doing_ajax() ) || null === WC()->cart ) {
$totals = '';
} else {
$totals = wp_kses_data( WC()->cart->get_cart_subtotal() );
}
?>
<span class="jet-blocks-cart__total-val"><?php
echo $totals;
?></span>

View File

@@ -0,0 +1,14 @@
<?php
/**
* Main cart template
*/
?>
<div class="jet-blocks-cart">
<div class="jet-blocks-cart__heading"><?php
include $this->__get_global_template( 'cart-link' );
?></div>
<?php if ( 'yes' === $settings['show_cart_list'] ) {
include $this->__get_global_template( 'cart-list' );
} ?>
</div>

View File

@@ -0,0 +1,13 @@
<?php
/**
* Lost password link
*/
if ( ! isset( $settings['lost_password_link'] ) || ! filter_var( $settings['lost_password_link'], FILTER_VALIDATE_BOOLEAN ) ) {
return;
}
?>
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" class="jet-login-lost-password-link"><?php
echo esc_html( $settings['lost_password_link_text'] );
?></a>

View File

@@ -0,0 +1,15 @@
<?php
/**
* Login messages
*/
$message = wp_cache_get( 'jet-login-messages' );
if ( ! $message ) {
return;
}
?>
<div class="jet-login-message"><?php
echo $message;
?></div>

View File

@@ -0,0 +1,25 @@
<?php
/**
* Loop item template
*/
$is_linked = $this->__is_linked();
$settings = $this->get_settings();
?>
<div class="<?php echo $this->__get_logo_classes(); ?>">
<?php
if ( $is_linked ) {
printf( '<a href="%1$s" class="jet-logo__link">', esc_url( home_url( '/' ) ) );
} else {
echo '<div class="jet-logo__link">';
}
echo $this->__get_logo_image();
echo $this->__get_logo_text();
if ( $is_linked ) {
echo '</a>';
} else {
echo '</div>';
}
?>
</div>

View File

@@ -0,0 +1,10 @@
<?php
/**
* Mobile menu trigger template
*/
?>
<div class="jet-nav__mobile-trigger jet-nav-mobile-trigger-align-<?php echo esc_attr( $trigger_align ); ?>">
<?php $this->__icon( 'mobile_trigger_icon', '<span class="jet-nav__mobile-trigger-open jet-blocks-icon">%s</span>' ); ?>
<?php $this->__icon( 'mobile_trigger_close_icon', '<span class="jet-nav__mobile-trigger-close jet-blocks-icon">%s</span>' ); ?>
</div>

View File

@@ -0,0 +1,49 @@
<?php
/**
* Register form template
*/
$username = ! empty( $_POST['username'] ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : '';
$email = ! empty( $_POST['email'] ) ? esc_attr( wp_unslash( $_POST['email'] ) ) : '';
?>
<form method="post" class="jet-register">
<p class="jet-register__row">
<label class="jet-register__label" for="jet_username"><?php echo $settings['label_username']; ?></label>
<input type="text" class="jet-register__input" name="username" id="jet_username" value="<?php echo $username; ?>" placeholder="<?php echo $settings['placeholder_username']; ?>"/>
</p>
<p class="jet-register__row">
<label class="jet-register__label" for="jet_email"><?php echo $settings['label_email']; ?></label>
<input type="email" class="jet-register__input" name="email" id="jet_email" value="<?php echo $email; ?>" placeholder="<?php echo $settings['placeholder_email']; ?>"/>
</p>
<p class="jet-register__row">
<label class="jet-register__label" for="jet_password"><?php echo $settings['label_pass']; ?></label>
<input type="password" class="jet-register__input" name="password" id="jet_password" placeholder="<?php echo $settings['placeholder_pass']; ?>"/>
</p>
<?php if ( 'yes' === $settings['confirm_password'] ) : ?>
<p class="jet-register__row">
<label class="jet-register__label" for="jet_password_confirm"><?php echo $settings['label_pass_confirm']; ?></label>
<input type="password" class="jet-register__input" name="password-confirm" id="jet_password_confirm" placeholder="<?php echo $settings['placeholder_pass_confirm']; ?>"/>
<?php echo '<input type="hidden" name="jet_confirm_password" value="true">'; ?>
</p>
<?php endif; ?>
<?php do_action( 'jet_register_form' ); ?>
<p class="jet-register__row jet-register-submit">
<?php
wp_nonce_field( 'jet-register', 'jet-register-nonce' );
printf( '<input type="hidden" name="jet_redirect" value="%s">', $redirect_url );
?>
<button type="submit" class="jet-register__submit button" name="register"><?php
echo $settings['label_submit'];
?></button>
</p>
</form>
<?php
include $this->__get_global_template( 'messages' );

View File

@@ -0,0 +1,15 @@
<?php
/**
* Registration messages
*/
$message = wp_cache_get( 'jet-register-messages' );
if ( ! $message ) {
return;
}
?>
<div class="jet-register-message"><?php
echo $message;
?></div>

View File

@@ -0,0 +1,20 @@
<?php
/**
* Search form template
*/
$settings = $this->get_settings();
?>
<form role="search" method="get" class="jet-search__form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label class="jet-search__label">
<input type="search" class="jet-search__field" placeholder="<?php echo esc_attr( $settings['search_placeholder'] ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
</label>
<?php if ( 'true' === $settings['show_search_submit'] ) : ?>
<button type="submit" class="jet-search__submit"><?php
$this->__icon( 'search_submit_icon', '<span class="jet-search__submit-icon jet-blocks-icon">%s</span>' );
$this->__html( 'search_submit_label', '<div class="jet-search__submit-label">%s</div>' );
?></button>
<?php endif; ?>
<?php if ( isset( $settings['is_product_search'] ) && 'true' === $settings['is_product_search'] ) : ?>
<input type="hidden" name="post_type" value="product" />
<?php endif; ?>
</form>

View File

@@ -0,0 +1,13 @@
<?php
/**
* Main template
*/
$settings = $this->get_settings();
?>
<div class="jet-search"><?php
if ( 'true' === $settings['show_search_in_popup'] ) {
include $this->__get_global_template( 'popup' );
} else {
include $this->__get_global_template( 'form' );
}
?></div>

View File

@@ -0,0 +1,6 @@
<?php
/**
* Popup trigger
*/
$this->__icon( 'search_close_icon', '<button type="button" class="jet-search__popup-close"><span class="jet-search__popup-close-icon jet-blocks-icon">%s</span></button>' );

View File

@@ -0,0 +1,10 @@
<?php
/**
* Popup trigger
*/
?>
<div class="jet-search__popup-trigger-container">
<button type="button" class="jet-search__popup-trigger"><?php
$this->__icon( 'search_popup_trigger_icon', '<span class="jet-search__popup-trigger-icon jet-blocks-icon">%s</span>' )
?></button>
</div>

View File

@@ -0,0 +1,23 @@
<?php
/**
* Popup template
*/
$settings = $this->get_settings();
$this->add_render_attribute( 'jet-search-popup', 'class', 'jet-search__popup' );
if ( isset( $settings['full_screen_popup'] ) && 'true' === $settings['full_screen_popup'] ) {
$this->add_render_attribute( 'jet-search-popup', 'class', 'jet-search__popup--full-screen' );
}
if ( isset( $settings['popup_show_effect'] ) ) {
$this->add_render_attribute( 'jet-search-popup', 'class', sprintf( 'jet-search__popup--%s-effect', $settings['popup_show_effect'] ) );
}
?>
<div <?php $this->print_render_attribute_string( 'jet-search-popup' ); ?>>
<div class="jet-search__popup-content"><?php
include $this->__get_global_template( 'form' );
include $this->__get_global_template( 'popup-close' );
?></div>
</div>
<?php include $this->__get_global_template( 'popup-trigger' ); ?>