first commit
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Frontend;
|
||||
use Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'accordion_items' => array(),
|
||||
'expand_icon' => '',
|
||||
'expand_icon_active' => '',
|
||||
'accordion_type' => 'accordion',
|
||||
'accordion_collapsible' => '',
|
||||
'accordion_interactivity' => 'click',
|
||||
'equal_height' => '',
|
||||
|
||||
), $settings ) );
|
||||
|
||||
$widget_class = 'stratum-advanced-accordion';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
]);
|
||||
|
||||
$accordion_options = [
|
||||
'accordion_type' => $accordion_type,
|
||||
'accordion_collapsible' => ($accordion_collapsible == 'yes'),
|
||||
'accordion_interactivity' => $accordion_interactivity,
|
||||
'equal_height' => (($equal_height == 'yes' && $accordion_type == 'accordion') ? true : false),
|
||||
];
|
||||
|
||||
$out = "";
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $expand_icon, [ 'aria-hidden' => 'true' ] );
|
||||
$expand_icon_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $expand_icon_active, [ 'aria-hidden' => 'true' ] );
|
||||
$expand_icon_active_html = ob_get_clean();
|
||||
|
||||
$once_active = false;
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-accordion-options="<?php echo esc_attr( json_encode($accordion_options) ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__wrapper' ); ?>">
|
||||
<?php
|
||||
foreach ( $accordion_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__item',
|
||||
(($item['active'] == 'yes' && $once_active == false) ? 'active-accordion' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($accordion_type == 'accordion' && $item['active'] == 'yes'){
|
||||
$once_active = true;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['title_icon'], [ 'aria-hidden' => 'true' ] );
|
||||
$title_icon_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['title_icon_active'], [ 'aria-hidden' => 'true' ] );
|
||||
$title_icon_active_html = ob_get_clean();
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-header' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__title' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $title_icon_html ) || ! empty( $title_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__title-icon' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $title_icon_html ) ) {
|
||||
?>
|
||||
<span class="normal"><?php echo $title_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?></span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( ! empty( $title_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="active"><?php echo $title_icon_active_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo esc_html($item['title']);
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__expand-icon' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $expand_icon_html ) ) {
|
||||
?>
|
||||
<span class="normal"><?php echo $expand_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( ! empty( $expand_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="active"><?php echo $expand_icon_active_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-content-overlay' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__text' ); ?>">
|
||||
<?php
|
||||
if ( $item['content_type'] == 'text' ) {
|
||||
if ( !empty($item['text']) ) {
|
||||
echo wp_kses_post( $item['text'] );
|
||||
}
|
||||
} elseif ( $item['content_type'] == 'template' ) {
|
||||
if ( !empty($item['accordion_template']) ) {
|
||||
echo $frontend->get_builder_content($item['accordion_template'], true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-advanced-google-map';
|
||||
$out = "";
|
||||
|
||||
//Get Api Key
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$api_key = isset( $stratum_api['google_api_key'] ) ? $stratum_api['google_api_key'] : '';
|
||||
|
||||
//If Empty Key
|
||||
if ( empty( $api_key ) ) {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class. '__notice' ); ?>">
|
||||
<p><?php echo esc_html__( 'Whoops! It seems like you didn\'t set Google Map API key. You can set it from Stratum > Settings > API > Google Api Key', 'stratum' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$options = [
|
||||
'center' => [
|
||||
'mapLat' => esc_attr( $settings[ 'map_lat' ] ),
|
||||
'mapLng' => esc_attr( $settings[ 'map_lng' ] )
|
||||
],
|
||||
'controls' => [
|
||||
'streetViewControl' => !empty( $settings[ 'street_view_control' ] ) ? true : false,
|
||||
'mapTypeControl' => !empty( $settings[ 'map_type_control' ] ) ? true : false,
|
||||
'zoomControl' => !empty( $settings[ 'zoom_control' ] ) ? true : false,
|
||||
'fullscreenControl' => !empty( $settings[ 'fullscreen_control' ] ) ? true : false
|
||||
],
|
||||
'zoomLevel' => $settings[ 'zoom_level' ],
|
||||
'markerTypeSetup' => $settings[ 'marker_type_setup' ],
|
||||
'mapTypeSetup' => $settings[ 'map_type_setup' ],
|
||||
'interaction' => $settings[ 'interaction' ],
|
||||
|
||||
'markers' => $this->get_markers_options( $settings ),
|
||||
'mapTheme' => $this->set_map_theme_style( $settings )
|
||||
];
|
||||
|
||||
$map_options = json_encode( $options );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ) ?>" data-map-options="<?php echo esc_attr( $map_options ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__container' ) ;?>"></div>
|
||||
</div>
|
||||
368
wp-content/plugins/stratum/includes/templates/advanced-posts.php
Normal file
368
wp-content/plugins/stratum/includes/templates/advanced-posts.php
Normal file
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
|
||||
use Stratum\Ajax\Advanced_Posts_Ajax;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'slide_animation_effect' => '',
|
||||
'slide_text_animation_effect' => '',
|
||||
'title_typography_html_tag' => 'h3',
|
||||
'show_image' => '',
|
||||
'show_title' => '',
|
||||
'show_content' => '',
|
||||
'show_excerpt' => '',
|
||||
'show_read_more' => '',
|
||||
'read_more_text' => '',
|
||||
'open_new_tab' => '',
|
||||
'excerpt_length' => apply_filters( 'excerpt_length', 25 ),
|
||||
'show_meta' => array(),
|
||||
'meta_fields_divider' => '',
|
||||
'image_size' => '',
|
||||
'image_hover_effect' => '',
|
||||
'posts_layout' => '',
|
||||
'pagination' => '',
|
||||
'page_pagination_style' => '',
|
||||
'scroll_icon' => '',
|
||||
'load_more_text' => '',
|
||||
'column_gap' => '',
|
||||
'row_gap' => '',
|
||||
'masonry' => '',
|
||||
'columns' => '',
|
||||
'columns_tablet' => '',
|
||||
'columns_mobile' => '',
|
||||
'animate_on_scroll' => '',
|
||||
'animation_effects' => '',
|
||||
|
||||
//Swiper
|
||||
'columns_count' => '1',
|
||||
'slides_in_columns' => '1',
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
//Query builder
|
||||
$query_args = [];
|
||||
stratum_build_custom_query( $query_args, $settings );
|
||||
|
||||
$q = new \WP_Query( $query_args );
|
||||
|
||||
$widget_class = 'stratum-advanced-posts';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
'layout-'.$posts_layout,
|
||||
($masonry == '' || intval($columns) == 1 || $posts_layout == 'carousel' || $posts_layout == 'list' ? 'masonry-disable' : 'masonry-enable'),
|
||||
(($posts_layout == 'grid' && $masonry == '') ? "elementor-grid-{$columns} elementor-grid-tablet-{$columns_tablet} elementor-grid-mobile-{$columns_mobile}" : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && $image_hover_effect != 'none') ? "image-effect-".esc_attr( $image_hover_effect ) : ''),
|
||||
(($posts_layout == 'carousel' && $slide_animation_effect != 'none') ? "slide-effect-".esc_attr( $slide_animation_effect ) : ''),
|
||||
(($posts_layout == 'carousel' && $slide_text_animation_effect != 'none' && (intval($columns_count) == 1 && intval($slides_in_columns) == 1 )) ? "has-text-animation-".esc_attr( $slide_text_animation_effect ) : '')
|
||||
]);
|
||||
|
||||
$wrapper_class = stratum_css_class([
|
||||
$widget_class . '__wrapper',
|
||||
(($posts_layout == 'grid' && $masonry == '') ? 'elementor-grid' : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && ($animate_on_scroll == 'yes' || ($masonry == 'yes' && intval($columns) > 1))) ? "masonry-grid" : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && $animate_on_scroll == 'yes') ? "animate_on_scroll ".esc_attr($animation_effects) : ''),
|
||||
]);
|
||||
|
||||
$query_options = [
|
||||
//Query args
|
||||
'include_ids' => $settings['include_ids'],
|
||||
'post_type' => $settings['post_type'],
|
||||
'posts_per_page' => $settings['posts_per_page'],
|
||||
'order' => $settings['order'],
|
||||
'orderby' => $settings['orderby'],
|
||||
'ignore_sticky_posts' => $settings['ignore_sticky_posts'],
|
||||
'pagination' => $settings['pagination'],
|
||||
'exclude_ids' => $settings['exclude_ids'],
|
||||
'exclude_current' => $settings['exclude_current'],
|
||||
'taxonomies' => $settings['taxonomies'],
|
||||
'terms_relation' => $settings['terms_relation'],
|
||||
|
||||
//Settings
|
||||
'posts_layout' => $settings['posts_layout'],
|
||||
'columns' => $settings['columns'],
|
||||
'masonry' => $settings['masonry'],
|
||||
'animate_on_scroll' => $settings['animate_on_scroll'],
|
||||
'show_title' => $settings['show_title'],
|
||||
'show_image' => $settings['show_image'],
|
||||
'image_size' => $settings['image_size'],
|
||||
'title_typography_html_tag' => stratum_validate_heading_html_tag( $settings['title_typography_html_tag'] ),
|
||||
'title_over_image' => $settings['title_over_image'],
|
||||
'show_meta' => $settings['show_meta'],
|
||||
'meta_fields_divider' => $settings['meta_fields_divider'],
|
||||
'show_content' => $settings['show_content'],
|
||||
'show_excerpt' => $settings['show_excerpt'],
|
||||
'excerpt_length' => $settings['excerpt_length'],
|
||||
'show_read_more' => $settings['show_read_more'],
|
||||
'open_new_tab' => $settings['open_new_tab'],
|
||||
'read_more_text' => $settings['read_more_text'],
|
||||
];
|
||||
|
||||
//Add terms from taxonomies list
|
||||
if (!empty($settings['taxonomies'])){
|
||||
foreach ($settings['taxonomies'] as $taxonomy_key => $taxonomy_name) {
|
||||
if (isset($settings[$taxonomy_name.'_terms'])){
|
||||
$query_options[$taxonomy_name.'_terms'] = $settings[$taxonomy_name.'_terms'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$masonry_options = [
|
||||
'columns' => $columns,
|
||||
'column_gap' => $column_gap['size'],
|
||||
'row_gap' => $row_gap['size'],
|
||||
];
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
|
||||
//Generate options for swiper
|
||||
$slider_options = stratum_generate_swiper_options($settings);
|
||||
|
||||
if ( $posts_layout == 'grid' || $posts_layout == 'list' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>"
|
||||
<?php
|
||||
if ( $pagination == 'yes' && ( $page_pagination_style == 'load_more_btn' || $page_pagination_style == 'load_more_scroll' ) ) {
|
||||
?>
|
||||
data-query-options="<?php echo esc_attr( json_encode( $query_options ) ); ?>"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
>
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>" data-masonry-options="<?php echo esc_attr( json_encode( $masonry_options ) ); ?>">
|
||||
<?php
|
||||
if ( $posts_layout == 'grid' && intval($columns) > 1 && $masonry == 'yes' ) {
|
||||
?>
|
||||
<div class="grid-sizer masonry-col-<?php echo esc_attr( $columns ); ?>"></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Get Articles
|
||||
echo Advanced_Posts_Ajax::get_instance()->get_articles($settings, 'render'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $pagination == 'yes' ) {
|
||||
if ( $page_pagination_style == 'load_more_btn' || $page_pagination_style == 'load_more_scroll' ) {
|
||||
?>
|
||||
<nav class="ajax_load_more_pagination <?php if ( $page_pagination_style == 'load_more_scroll' ) { ?> load_more_scroll <?php } ?>" role="navigation">
|
||||
<?php
|
||||
if ( $page_pagination_style == 'load_more_scroll' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__ajax-load-more-arrow' ); ?>"><i class="<?php echo esc_attr( $scroll_icon ); ?>"></i></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="<?php echo esc_attr( $widget_class . '__ajax-load-more-btn' ); ?>" href="#" data-current-page="1" data-max-page="<?php echo esc_attr($q->max_num_pages); ?>"><?php echo esc_html($load_more_text); ?></a>
|
||||
</nav>
|
||||
<?php
|
||||
} else if ( $page_pagination_style == 'navigation' ) {
|
||||
?>
|
||||
<nav class="navigation pagination" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php echo esc_html__('Posts navigation', 'stratum'); ?></h2>
|
||||
<div class="nav-links">
|
||||
<?php
|
||||
$pagination_args = array(
|
||||
'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
|
||||
'total' => $q->max_num_pages,
|
||||
'current' => max( 1, get_query_var( 'paged' ) ),
|
||||
'format' => '?paged=%#%',
|
||||
'show_all' => false,
|
||||
'type' => 'plain',
|
||||
'end_size' => 2,
|
||||
'mid_size' => 1,
|
||||
'prev_next' => true,
|
||||
'prev_text' => sprintf( '<i></i> %1$s', esc_html_x( '<', 'Previous post', 'stratum' ) ),
|
||||
'next_text' => sprintf( '%1$s <i></i>', esc_html_x( '>', 'Next post', 'stratum' ) ),
|
||||
'add_args' => false,
|
||||
'add_fragment' => ''
|
||||
);
|
||||
|
||||
$pagination_args = apply_filters( 'stratum/widgets/advanced-posts/pagination_args', $pagination_args );
|
||||
echo paginate_links( $pagination_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
} elseif ( $posts_layout == 'carousel' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode( $slider_options ) ); ?>">
|
||||
<div class="swiper swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
if ( $q->have_posts() ) {
|
||||
|
||||
while( $q->have_posts() ):
|
||||
$q->the_post();
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$url = get_the_post_thumbnail_url($post_id, $image_size);
|
||||
|
||||
?>
|
||||
<div class="swiper-slide <?php echo esc_attr( $widget_class . '__post' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__image' ); ?>" style="background-image: url('<?php echo esc_url($url); ?>');"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-container' ); ?>">
|
||||
|
||||
<?php
|
||||
if ( !empty( $show_meta ) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__entry-meta' ); ?>">
|
||||
<?php
|
||||
if ( in_array("date", $show_meta) ) {
|
||||
$archive_year = get_the_time('Y');
|
||||
$archive_month = get_the_time('m');
|
||||
$archive_day = get_the_time('d');
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__post-date' ); ?>">
|
||||
<time datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
|
||||
<a href="<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day) ); ?>">
|
||||
<?php echo esc_html( get_the_date( '' ) ); ?>
|
||||
</a>
|
||||
</time>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("author", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-author' ); ?>">
|
||||
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>">
|
||||
<?php echo esc_html( get_the_author() ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("categories", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) || in_array("author", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-categories' ); ?>">
|
||||
<?php echo get_the_category_list(', '); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("comments", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) || in_array("author", $show_meta) || in_array("categories", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-comments' ); ?>">
|
||||
<a href="<?php echo esc_url( get_comments_link() ); ?>">
|
||||
<?php
|
||||
if ( get_comments_number() ) {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
_n( '%d Comment', '%d Comments', get_comments_number(), 'stratum' ),
|
||||
get_comments_number()
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo esc_html__( 'No comments', 'stratum' );
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $show_title == 'yes' ) {
|
||||
the_title( '<'.esc_attr($title_typography_html_tag).' class="'.esc_attr( $widget_class . '__post-title' ).'"><a href="'.esc_url(get_permalink()).'">', '</a></'.esc_attr($title_typography_html_tag).'>' );
|
||||
}
|
||||
|
||||
if ( $show_content == 'yes' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-content' ); ?>">
|
||||
<?php
|
||||
if ( $show_excerpt == 'yes' ) {
|
||||
|
||||
if ( $excerpt_length ) {
|
||||
\Stratum\Excerpt_Helper::get_instance()->setExcerptLength( $excerpt_length );
|
||||
add_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
}
|
||||
|
||||
the_excerpt();
|
||||
|
||||
remove_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
|
||||
} else {
|
||||
the_content();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $show_read_more == 'yes' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__entry-footer' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__read-more' ); ?>">
|
||||
<a href="<?php the_permalink() ?>" <?php if ( $open_new_tab == 'yes') { ?> target="_blank" <?php } ?>>
|
||||
<?php echo esc_html($read_more_text); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__overlay' ); ?>"></div>
|
||||
</div>
|
||||
<?php
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
|
||||
} else {
|
||||
?><p><?php echo esc_html__( 'Nothing found.', 'stratum' ); ?></p><?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ($pagination_style == 'scrollbar'){
|
||||
?><div class="swiper-scrollbar"></div><?php
|
||||
} else {
|
||||
?><div class="swiper-pagination"></div><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) {
|
||||
?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'animation_effect' => '',
|
||||
'text_animation_effect' => '',
|
||||
'sub_title_typography_html_tag' => 'div',
|
||||
'title_typography_html_tag' => 'h3',
|
||||
'description_typography_html_tag' => 'div',
|
||||
'slides' => array(),
|
||||
'image_size' => '',
|
||||
|
||||
//Swiper
|
||||
'columns_count' => '1',
|
||||
'slides_in_columns' => '1',
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
$sub_title_typography_html_tag = stratum_validate_heading_html_tag( $sub_title_typography_html_tag );
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
$description_typography_html_tag = stratum_validate_heading_html_tag( $description_typography_html_tag );
|
||||
|
||||
$widget_class = 'stratum-advanced-slider';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
($animation_effect !='none' ? "stratum-effect-".esc_attr( $animation_effect ) : ''),
|
||||
(($text_animation_effect !='none' && (intval($columns_count) == 1 && intval($slides_in_columns) == 1 ) ) ? "has-text-animation-".esc_attr( $text_animation_effect ) : '')
|
||||
]);
|
||||
|
||||
//Generate options for swiper
|
||||
$slider_options = stratum_generate_swiper_options($settings);
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode($slider_options) ); ?>">
|
||||
<div class="swiper swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
foreach ( $slides as $index => $item ) {
|
||||
$id = $item[ 'image' ][ 'id' ];
|
||||
|
||||
if ( $id ) {
|
||||
$url = wp_get_attachment_image_url($id, $image_size );
|
||||
} else {
|
||||
$url = Utils::get_placeholder_image_src();
|
||||
}
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
?>
|
||||
<div class="swiper-slide <?php echo esc_attr($current_item); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__image' ); ?>" style="background-image: url('<?php echo esc_url($url); ?>'); "></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-container' ); ?>">
|
||||
<?php
|
||||
if ( !empty($item['sub_title']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($sub_title_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__sub-title' ); ?>">
|
||||
<?php echo esc_html($item['sub_title']); ?>
|
||||
</<?php echo esc_html($sub_title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['title']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($title_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__title' );?>">
|
||||
<?php echo esc_html($item['title']); ?>
|
||||
</<?php echo esc_html($title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['description']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($description_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__description' ); ?>">
|
||||
<?php echo esc_html($item['description']); ?>
|
||||
</<?php echo esc_html($description_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['button_text']) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__button' ); ?>">
|
||||
<a href="<?php echo esc_url( $item['button_link']['url'] ) ?>" <?php if ( $item['button_link']['is_external'] ) { ?>target="_blank" <?php } ?> ><?php echo esc_html( $item['button_text'] ); ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__overlay' ); ?>"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ( $pagination_style == 'scrollbar' ) {
|
||||
?>
|
||||
<div class="swiper-scrollbar"></div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) {
|
||||
?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
125
wp-content/plugins/stratum/includes/templates/advanced-tabs.php
Normal file
125
wp-content/plugins/stratum/includes/templates/advanced-tabs.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Frontend;
|
||||
use Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'tabs_items' => array(),
|
||||
'item_icon' => '',
|
||||
'tabs_layout' => 'horizontal',
|
||||
'tabs_interactivity' => 'click',
|
||||
'equal_height' => '',
|
||||
'content_animation' => '',
|
||||
|
||||
), $settings ) );
|
||||
|
||||
$widget_class = 'stratum-advanced-tabs';
|
||||
|
||||
$is_active = false;
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
if ($item['active']){
|
||||
$is_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
'tabs-layout-'.esc_attr($tabs_layout),
|
||||
($content_animation != 'none' ? $content_animation.'-animation' : ''),
|
||||
]);
|
||||
|
||||
$accordion_options = [
|
||||
'tabs_interactivity' => $tabs_interactivity,
|
||||
'equal_height' => ($equal_height == 'yes' ? true : false),
|
||||
];
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item_icon, [ 'aria-hidden' => 'true' ] );
|
||||
$item_icon_html = ob_get_clean();
|
||||
|
||||
$once_active_nav = false;
|
||||
$once_active_content = false;
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-tabs-options="<?php echo esc_attr( json_encode($accordion_options) ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__navigation' ); ?>">
|
||||
<?php
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__navigation-item',
|
||||
(($item['active'] == 'yes' && $once_active_nav == false) || ($index == 0 && $is_active == false) ? 'active-nav' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($item['active'] == 'yes'){
|
||||
$once_active_nav = true;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['tab_icon'], [ 'aria-hidden' => 'true' ] );
|
||||
$item_icon_html = ob_get_clean();
|
||||
?>
|
||||
<div data-tab-id="<?php echo esc_attr($index); ?>" class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<?php
|
||||
if ( !empty($item['tab_title']) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__title' ); ?>">
|
||||
<?php echo esc_html($item['tab_title']); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( !empty($item_icon_html) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__icon' ); ?>">
|
||||
<span><?php echo $item_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content' ); ?>">
|
||||
<?php
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__content-item',
|
||||
(($item['active'] == 'yes' && $once_active_content == false ) || ($index == 0 && $is_active == false) ? 'active-content' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($item['active'] == 'yes'){
|
||||
$once_active_content = true;
|
||||
}
|
||||
?>
|
||||
<div data-tab-id="<?php echo esc_attr($index); ?>" class="<?php echo esc_attr( $item_class );?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content-overlay' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__text' ); ?>">
|
||||
<?php
|
||||
if ( $item['content_type'] == 'text' ) {
|
||||
if ( !empty($item['tab_text']) ) {
|
||||
echo wp_kses_post( $item['tab_text'] );
|
||||
}
|
||||
} elseif ( $item['content_type'] == 'template' ) {
|
||||
if ( !empty($item['tab_template']) ) {
|
||||
echo $frontend->get_builder_content($item['tab_template'], true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
76
wp-content/plugins/stratum/includes/templates/banner.php
Normal file
76
wp-content/plugins/stratum/includes/templates/banner.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( [
|
||||
'image' => '',
|
||||
'image_size' => '',
|
||||
'hosted_url' => '',
|
||||
'title' => '',
|
||||
'text' => '',
|
||||
'title_typography_html_tag' => 'h5',
|
||||
'link' => '',
|
||||
'link_target' => '',
|
||||
'link_rel' => '',
|
||||
'animation_effect' => 'none',
|
||||
'text_animation_effect' => 'none',
|
||||
'background_type' => 'image'
|
||||
], $settings ) );
|
||||
|
||||
$class = 'stratum-banner';
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
|
||||
$id = $image[ 'id' ];
|
||||
$link = !empty( $link ) ? $link : "#";
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset($image[ 'id' ], $image_size);
|
||||
|
||||
?>
|
||||
<figure class="<?php echo esc_attr( $class . ' stratum-effect-' . $animation_effect . ' has-text-animation-' . $text_animation_effect ); ?> ">
|
||||
<a href="<?php echo esc_url( $link ); ?>" class="<?php echo esc_attr( $class.'__link' ); ?>"
|
||||
<?php
|
||||
if ( ! empty( $link_target ) ) {
|
||||
?>
|
||||
target="<?php echo esc_attr( $link_target ); ?>"
|
||||
<?php
|
||||
}
|
||||
if ( ! empty( $link_rel ) ) {
|
||||
?>
|
||||
rel="<?php echo esc_attr( $link_rel ); ?>"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
>
|
||||
<?php
|
||||
if ( $link ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__wrapper' ); ?>">
|
||||
<?php
|
||||
if ( $background_type == 'video' ) {
|
||||
?>
|
||||
<video class="<?php echo esc_attr( $class.'__video' ); ?>" autoplay muted loop>
|
||||
<source src="<?php echo esc_url( $hosted_url[ 'url' ] ); ?>" type='video/mp4'>
|
||||
</video>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<img src="<?php if ( empty( $id ) ) { echo esc_url(Utils::get_placeholder_image_src()); } else { esc_url( $url ); } ?>" class="<?php echo esc_attr( $class . '__image' . ' wp-image-' . $id ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__overlay' ); ?>"></div>
|
||||
<figcaption class="<?php echo esc_attr( $class.'__content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__content-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__content-container' ); ?>">
|
||||
<<?php echo esc_html($title_typography_html_tag); ?> class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></<?php echo esc_html($title_typography_html_tag); ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__text' ); ?>"><?php echo esc_html( $text ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</figcaption>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</figure>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
//Settings
|
||||
$text = ($type == 'php') ? $settings['text'] : '{{{settings.text}}}';
|
||||
$show_percents = ($type == 'php') ? $settings['show_percents'] : '{{{settings.show_percents}}}';
|
||||
$value = ($type == 'php') ? $settings['value'] : '{{{settings.value}}}';
|
||||
$round = ($type == 'php') ? $settings['round'] : '{{{settings.round}}}';
|
||||
$circle = ($type == 'php') ? $settings['circle'] : '{{{settings.circle}}}';
|
||||
$padding = ($type == 'php') ? $settings['padding'] : '{{{settings.padding}}}';
|
||||
$widget_width = ($type == 'php') ? $settings['widget_width'] : '{{{settings.widget_width}}}';
|
||||
$thickness = ($type == 'php') ? $settings['thickness'] : '{{{settings.thickness}}}';
|
||||
$line_color = ($type == 'php') ? $settings['line_color'] : '{{{settings.line_color}}}';
|
||||
$background_color = ($type == 'php') ? $settings['background_color'] : '{{{settings.background_color}}}';
|
||||
|
||||
//=======================RENDER TYPE=======================
|
||||
$js_settings = '';
|
||||
|
||||
//-----------PHP-----------
|
||||
if ( $type == 'php' ) {
|
||||
$options = [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'value' => isset($value['size']) ? $value['size'] : $value,
|
||||
'text' => ($show_percents == 'yes' ? true : false),
|
||||
'round' => ($round == 'yes' ? true : false),
|
||||
'circle' => ($circle == 'yes' ? true : false),
|
||||
'padding' => isset($padding['size']) ? $padding['size'] : $padding,
|
||||
'radius' => ($widget_width['size'] / 2),
|
||||
'thickness' => isset($thickness['size']) ? $thickness['size'] : $thickness,
|
||||
'bg' => $background_color,
|
||||
'color' => $line_color
|
||||
];
|
||||
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [ 'stratum-circle-progress-bar' ]
|
||||
] );
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-circle-progress-bar__wrapper',
|
||||
'data-options' => json_encode( $options )
|
||||
] );
|
||||
//-----------/PHP-----------
|
||||
|
||||
}
|
||||
//-----------JS (BACKBONE)-----------
|
||||
elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<#
|
||||
const options = {
|
||||
min: 0,
|
||||
max: 100,
|
||||
value: (settings.value.size != '' ? settings.value.size : 0),
|
||||
text: (settings.show_percents == 'yes' ? true : false),
|
||||
round: (settings.round == 'yes' ? true : false),
|
||||
circle: (settings.circle == 'yes' ? true : false),
|
||||
padding: settings.padding.size,
|
||||
radius: (settings.widget_width.size / 2),
|
||||
thickness: settings.thickness.size,
|
||||
bg: settings.background_color,
|
||||
color: settings.line_color
|
||||
};
|
||||
|
||||
view.addRenderAttribute( 'widget', {
|
||||
'class': [ 'stratum-circle-progress-bar' ]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper', {
|
||||
'class': [ 'stratum-circle-progress-bar__wrapper' ],
|
||||
'data-options': JSON.stringify(options),
|
||||
} );
|
||||
#>
|
||||
<?php
|
||||
}
|
||||
//-----------/JS (BACKBONE)-----------
|
||||
|
||||
//Render attr
|
||||
$attr_widget = ($type == 'php') ? $this->get_render_attribute_string( 'widget' ) : "{{{ view.getRenderAttributeString( 'widget' ) }}}";
|
||||
$attr_wrapper = ($type == 'php') ? $this->get_render_attribute_string( 'wrapper' ): "{{{ view.getRenderAttributeString( 'wrapper' ) }}}";
|
||||
|
||||
?>
|
||||
|
||||
<div <?php echo $attr_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $attr_wrapper; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $show_percents != 'yes' ) {
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $text ) ) {
|
||||
?>
|
||||
<span class="stratum-circle-progress-bar__title"><?php echo esc_html( $text ); ?></span>
|
||||
<?php
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.show_percents == '' && settings.text != '' ) { #>
|
||||
<span class="stratum-circle-progress-bar__title"><?php echo esc_html( $text ); ?></span>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Frontend;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'content_type' => '',
|
||||
'content_items' => array(),
|
||||
'content_animation' => '',
|
||||
), $settings ) );
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
$class = 'stratum-content-switcher';
|
||||
$wrap_class = $class;
|
||||
|
||||
$animation_class = stratum_css_class( [ ( $content_animation != 'none' ? $content_animation.'-animation' : 'none-animation' ) ] );
|
||||
|
||||
|
||||
if ( $content_type === 'multiple' ) {
|
||||
$wrap_class .= ' is-multiple';
|
||||
}
|
||||
|
||||
if ( $content_type === 'toggle' ) {
|
||||
$wrap_class .= ' is-toggle';
|
||||
}
|
||||
|
||||
$once_active_nav = false;
|
||||
$once_active_sw = false;
|
||||
$once_active_content = false;
|
||||
|
||||
$is_active = false;
|
||||
|
||||
$unique_id = uniqid();
|
||||
|
||||
foreach ( $content_items as $index => $item ) {
|
||||
if ( $item[ 'active' ] ) {
|
||||
$is_active = true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr( $wrap_class ); ?> ">
|
||||
<div class="<?php echo esc_attr( $class . '__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__nav' ) ;?>">
|
||||
<?php
|
||||
if ( $content_type === 'multiple' ) :
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__nav-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__nav-pill' ); ?>"></div>
|
||||
<ul class="<?php echo esc_attr( $class . '__nav-items' ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__nav-item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_nav == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_nav = true;
|
||||
endif;
|
||||
|
||||
if ( $content_type !== 'multiple' ) {
|
||||
$toggleNavCounter++;
|
||||
|
||||
if ( $toggleNavCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $item[ 'title' ] != '' ) :
|
||||
?>
|
||||
<li data-tab-id="<?php echo esc_attr( $index ); ?>" class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<a class="<?php echo esc_attr( $class . '__nav-button' ); ?>" href="#" data-content="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>">
|
||||
<span class="<?php echo esc_attr( $class . '__nav-title' );?>"><?php echo esc_html__( $item[ 'title' ], 'stratum' ); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
else :
|
||||
$toggleNavCounter = 0;
|
||||
|
||||
?>
|
||||
<label class="<?php echo esc_attr( $class . '__label' ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$toggleNavCounter++;
|
||||
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__nav-item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_sw == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_sw = true;
|
||||
endif;
|
||||
|
||||
if ( $toggleNavCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $item[ 'title' ] != '' ) :
|
||||
?>
|
||||
<a class="<?php echo esc_attr( $item_class . ' ' . $class . '__nav-button' ); ?>" href="#" data-content="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>">
|
||||
<span class="<?php echo esc_attr( $class . '__nav-title' ); ?>"><?php echo esc_html( $item[ 'title' ] ); ?></span>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( $toggleNavCounter === 1 ) {
|
||||
?>
|
||||
<input type="checkbox" />
|
||||
<i class="<?php echo esc_attr( $class . '__toggle' ); ?>"></i>
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</label>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__content' . ' ' . $animation_class ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_content == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_content = true;
|
||||
endif;
|
||||
|
||||
if ( $content_type !== 'multiple' ) {
|
||||
$toggleContentCounter = 0;
|
||||
$toggleContentCounter++;
|
||||
|
||||
if ( $toggleContentCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $item[ 'content_template' ] ) ) :
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $item_class ); ?>" id="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>" >
|
||||
<div class="<?php echo esc_attr( $class . '__item-wrapper' ); ?>">
|
||||
<?php echo $frontend->get_builder_content( $item[ 'content_template' ], true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
else :
|
||||
?>
|
||||
<div class="content-not-found" id="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>"></div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
92
wp-content/plugins/stratum/includes/templates/countdown.php
Normal file
92
wp-content/plugins/stratum/includes/templates/countdown.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Plugin;
|
||||
|
||||
$current_date = new \DateTime(current_time('Y-m-d H:i:s')); //Server time
|
||||
|
||||
try {
|
||||
$target_date = new \DateTime( $settings['date_time'] );
|
||||
} catch ( Exception $e ) {
|
||||
return esc_html__( 'Invalid date.', 'stratum' );
|
||||
}
|
||||
|
||||
if ( $current_date < $target_date ) {
|
||||
$dateTime_until = $current_date->diff( $target_date )->format( "+%yy +%mo +%dd +%hh +%im +%ss" );
|
||||
} else {
|
||||
$dateTime_until = 'negative';
|
||||
}
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'date_time' => $dateTime_until,
|
||||
'show_years' => 'yes',
|
||||
'show_months' => 'yes',
|
||||
'show_weeks' => 'yes',
|
||||
'show_days' => 'yes',
|
||||
'show_hours' => 'yes',
|
||||
'show_minutes' => 'yes',
|
||||
'show_seconds' => 'yes',
|
||||
|
||||
'show_labels' => 'yes',
|
||||
'custom_labels' => '',
|
||||
'label_years' => 'Years',
|
||||
'label_months' => 'Months',
|
||||
'label_weeks' => 'Weeks',
|
||||
'label_days' => 'Days',
|
||||
'label_hours' => 'Hours',
|
||||
'label_minutes' => 'Minutes',
|
||||
'label_seconds' => 'Seconds',
|
||||
|
||||
'stratum_expire_actions' => [],
|
||||
'message_after_expire' => '',
|
||||
'expire_redirect_url' => '',
|
||||
), $settings ) );
|
||||
|
||||
if ($custom_labels == 'yes'){
|
||||
$custom_labels_arr = array(
|
||||
$label_years,
|
||||
$label_months,
|
||||
$label_weeks,
|
||||
$label_days,
|
||||
$label_hours,
|
||||
$label_minutes,
|
||||
$label_seconds
|
||||
);
|
||||
}
|
||||
|
||||
$is_editor = Plugin::instance()->editor->is_edit_mode();
|
||||
|
||||
$countdown_options = array(
|
||||
( $show_years == 'yes' ? 'data-years="true"' : '' ),
|
||||
( $show_months == 'yes' ? 'data-months="true"' : '' ),
|
||||
( $show_weeks == 'yes' ? 'data-weeks="true"' : '' ),
|
||||
( $show_days == 'yes' ? 'data-days="true"' : '' ),
|
||||
( $show_hours == 'yes' ? 'data-hours="true"' : '' ),
|
||||
( $show_minutes == 'yes' ? 'data-minutes="true"' : '' ),
|
||||
( $show_seconds == 'yes' ? 'data-seconds="true"' : '' ),
|
||||
( $custom_labels == 'yes' ? "data-labels='".json_encode($custom_labels_arr)."'" : '' ),
|
||||
((!$is_editor && !empty( $settings['stratum_expire_actions'] )) ? "data-expire-actions='".json_encode($stratum_expire_actions)."'" : '' ),
|
||||
((!$is_editor && is_array($stratum_expire_actions) && in_array("redirect", $stratum_expire_actions) && $expire_redirect_url['url'] != '') ? "data-expire-url='".esc_url($expire_redirect_url['url'])."'" : '' ),
|
||||
((!$is_editor && is_array($stratum_expire_actions) && in_array("message", $stratum_expire_actions) && $message_after_expire != '') ? "data-expire-text='".$message_after_expire."'" : '' )
|
||||
);
|
||||
|
||||
$countdown_options_str = implode( ' ', $countdown_options );
|
||||
|
||||
$widget_name = 'stratum-countdown';
|
||||
|
||||
$class = $block_name = 'stratum-countdown';
|
||||
|
||||
$wrapper_class = stratum_css_class([
|
||||
$widget_name . '__wrapper',
|
||||
($show_labels == 'yes' ? '' : 'hide_labels')
|
||||
]);
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>">
|
||||
<div class="<?php
|
||||
echo esc_attr( $widget_name ); ?>__content" data-datetime="<?php
|
||||
echo esc_attr( !empty( $dateTime_until ) ? $dateTime_until : '' ); ?>" <?php
|
||||
echo $countdown_options_str; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
122
wp-content/plugins/stratum/includes/templates/counter.php
Normal file
122
wp-content/plugins/stratum/includes/templates/counter.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
$start = $type == 'php' ? $settings[ 'start' ] : '{{{settings.start}}}';
|
||||
$end = $type == 'php' ? $settings[ 'end'] : '{{{settings.end}}}';
|
||||
$prefix = $type == 'php' ? $settings[ 'prefix' ] : '{{{settings.prefix}}}';
|
||||
$suffix = $type == 'php' ? $settings[ 'suffix' ] : '{{{settings.suffix}}}';
|
||||
|
||||
$duration = $type == 'php' ? $settings[ 'duration' ] : '{{{settings.duration}}}';
|
||||
$numerals = $type == 'php' ? $settings[ 'numerals' ] : '{{{settings.numerals}}}';
|
||||
|
||||
$smooth_animation = $type == 'php' ? $settings[ 'smooth_animation' ] : '{{{settings.smooth_animation}}}';
|
||||
$display_separator = $type == 'php' ? $settings[ 'display_separator' ] : '{{{settings.display_separator}}}';
|
||||
$decimal_places = $type == 'php' ? $settings[ 'decimal_places' ] : '{{{settings.decimal_places}}}';
|
||||
$animation_effect = $type == 'php' ? $settings[ 'animation_effect' ] : '{{{settings.animation_effect}}}';
|
||||
|
||||
$decimal_separator = $type == 'php' ? $settings[ 'decimal_separator' ] : '{{{settings.decimal_separator}}}';
|
||||
$thousands_separator = $type == 'php' ? $settings[ 'thousands_separator' ] : '{{{settings.thousands_separator}}}';
|
||||
|
||||
//=======================RENDER TYPE=======================
|
||||
$js_settings = '';
|
||||
|
||||
//-----------PHP-----------
|
||||
if ( $type == 'php' ) {
|
||||
|
||||
$options = [
|
||||
'start' => !empty( $start ) ? $start : 0,
|
||||
'end' => !empty( $end ) ? $end : 100,
|
||||
'decimalPlaces' => !empty( $decimal_places ) ? $decimal_places : 0,
|
||||
'duration' => !empty( $duration ) ? $duration : 3,
|
||||
|
||||
'useEasing' => !empty( $smooth_animation ) ? true : false,
|
||||
'useGrouping' => !empty( $display_separator ) ? true : false,
|
||||
|
||||
'separator' => $thousands_separator,
|
||||
'decimal' => $decimal_separator,
|
||||
'easingFn' => $animation_effect,
|
||||
'numerals' => $numerals
|
||||
];
|
||||
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [ 'stratum-counter' ]
|
||||
] );
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-counter__wrapper',
|
||||
'data-options' => json_encode( $options )
|
||||
] );
|
||||
//-----------/PHP-----------
|
||||
}
|
||||
//-----------JS (BACKBONE)-----------
|
||||
else if ( $type == 'js' ) {
|
||||
?>
|
||||
<#
|
||||
const { start, end, decimal_places, duration, smooth_animation, display_separator, thousands_separator, decimal_separator, animation_effect, numerals } = settings;
|
||||
|
||||
const options = {
|
||||
start: start != '' ? start: 0,
|
||||
end: end != '' ? end: 0,
|
||||
|
||||
decimalPlaces: decimal_places != '' ? decimal_places : 0,
|
||||
duration: duration != '' ? duration : 3,
|
||||
|
||||
useEasing: smooth_animation != '' ? true : false,
|
||||
useGrouping: display_separator != '' ? true : false,
|
||||
|
||||
separator: thousands_separator,
|
||||
decimal: decimal_separator,
|
||||
easingFn: animation_effect,
|
||||
numerals: numerals
|
||||
};
|
||||
|
||||
view.addRenderAttribute( 'widget', {
|
||||
'class': [ 'stratum-counter' ]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper', {
|
||||
'class': [ 'stratum-counter__wrapper' ],
|
||||
'data-options': JSON.stringify( options )
|
||||
} );
|
||||
#>
|
||||
<?php
|
||||
}
|
||||
//-----------/JS (BACKBONE)-----------
|
||||
|
||||
$class = 'stratum-counter';
|
||||
|
||||
//Render attr
|
||||
$widget_class = $type == 'php' ? $this->get_render_attribute_string( 'widget' ) : "{{{ view.getRenderAttributeString( 'widget' ) }}}";
|
||||
$widget_wrapper = $type == 'php' ? $this->get_render_attribute_string( 'wrapper' ) : "{{{ view.getRenderAttributeString( 'wrapper' ) }}}";
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $widget_wrapper; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $prefix ) ) { ?>
|
||||
<p class="stratum-counter__prefix"><?php echo esc_html( $prefix ); ?></p>
|
||||
<?php }
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.prefix != '' ) { #>
|
||||
<p class="stratum-counter__prefix"><?php echo esc_html( $prefix ); ?></p>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class ); ?>__number"></span>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $suffix ) ) { ?>
|
||||
<p class="stratum-counter__suffix"><?php echo esc_html( $suffix ); ?></p>
|
||||
<?php }
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.suffix != '' ) { #>
|
||||
<p class="stratum-counter__suffix"><?php echo esc_html( $suffix ); ?></p>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
83
wp-content/plugins/stratum/includes/templates/flip-box.php
Normal file
83
wp-content/plugins/stratum/includes/templates/flip-box.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
extract(shortcode_atts([
|
||||
'image' => [],
|
||||
'link' => [],
|
||||
'image_size' => 'full',
|
||||
'flip_effect' => 'flip',
|
||||
'flip_direction' => 'right',
|
||||
'icon_shape' => 'circle',
|
||||
'icon_view' => 'default',
|
||||
'show_button' => '',
|
||||
'button_text' => ''
|
||||
], $settings ));
|
||||
|
||||
$class = $this->get_name();
|
||||
|
||||
|
||||
/* #region Flip Box classes */
|
||||
$widget_class = [ $class, 'flip-box-effect-'.esc_attr( $flip_effect ) ];
|
||||
$icon_class = [ $class.'__icon-wrapper', 'stratum-view-'.$icon_view ];
|
||||
|
||||
if ( $flip_effect == 'flip' || $flip_effect == 'slide' || $flip_effect == 'push' ) {
|
||||
array_push(
|
||||
$widget_class,
|
||||
'flip-box-direction-'.esc_attr( $flip_direction )
|
||||
);
|
||||
}
|
||||
|
||||
if ( $icon_view != 'default' && $icon_shape == 'circle' || $icon_shape == 'square' ) {
|
||||
array_push(
|
||||
$icon_class,
|
||||
'stratum-shape-'.esc_attr( $icon_shape )
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'widget', 'class', $widget_class );
|
||||
$this->add_render_attribute( 'icon-wrapper', 'class', $icon_class );
|
||||
/* #endregion */
|
||||
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__inner' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__layer ' . $class . '__front' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__overlay' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__inner' ); ?>">
|
||||
<?php
|
||||
$graphic = $settings[ 'graphic_element' ];
|
||||
if ( $graphic == 'icon' ) {
|
||||
echo $this->flip_box_render_icon( $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else if ( $graphic == 'image' ) {
|
||||
echo $this->flip_box_render_image( $image, $image_size ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
$title = $settings[ 'front_title_text' ];
|
||||
$description = $settings[ 'front_description_text' ];
|
||||
?>
|
||||
<h3 class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></h3>
|
||||
<div class="<?php echo esc_attr( $class.'__description' ); ?>"><?php echo esc_html( $description ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__layer ' . $class . '__back' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__layer__overlay' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__inner' ); ?>">
|
||||
<?php
|
||||
$title = $settings[ 'back_title_text' ];
|
||||
$description = $settings[ 'back_description_text' ];
|
||||
?>
|
||||
<h3 class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></h3>
|
||||
<div class="<?php echo esc_attr( $class.'__description' ); ?>"><?php echo esc_html( $description ); ?></div>
|
||||
<?php
|
||||
if ( !empty($button_text) && $show_button == 'yes' ) {
|
||||
echo $this->flip_box_render_button( $button_text, $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-horizontal-timeline';
|
||||
|
||||
$alignment = $settings[ 'horizontal_alignment' ];
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [
|
||||
$class,
|
||||
$class . '--align-' . $alignment
|
||||
]
|
||||
] );
|
||||
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__inner' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__track' ); ?>">
|
||||
<?php
|
||||
/* #region Render card */
|
||||
$layout = $settings[ 'horisontal_layout' ]; ?>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--top' ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
$title_html_tag = $settings[ 'item_title_tag' ];
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $layout != 'bottom' ) {
|
||||
if ( $layout == 'chess' ) {
|
||||
if ( (int)bcmod( strval( $index + 1 ), '2' ) != 0 ) {
|
||||
echo $this->_generate_card_content( $class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
} else {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} else if ( $layout == 'bottom' ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div><?php
|
||||
} ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #endregion */
|
||||
|
||||
/* #region Render points */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--middle' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__line' ); ?>"></div>
|
||||
<?php
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '-item__point' ); ?>">
|
||||
<?php echo $this->_generate_point_content( $class, $item, $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #endregion */
|
||||
|
||||
/* #region Render meta */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--bottom' ); ?>">
|
||||
<?php
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $layout != 'bottom' ) {
|
||||
if ( $layout == 'chess' ) {
|
||||
if ( (int)bcmod( strval( $index + 1 ), '2' ) != 0 ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div><?php
|
||||
}
|
||||
} else if ( $layout == 'bottom' ) {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div><?php
|
||||
/* #endregion */
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
extract(shortcode_atts([
|
||||
'direction' => 'horizontal',
|
||||
'active_type' => 'activate-on-click',
|
||||
'skew_switcher' => '',
|
||||
'skew_direction' => 'right',
|
||||
'content_align' => 'center',
|
||||
'hovered_default_active' => 0,
|
||||
'opened_default_active' => 0
|
||||
], $settings ));
|
||||
|
||||
$class = $this->get_name();
|
||||
|
||||
/* #region Widget classes */
|
||||
$widget_class = [ $class, 'image-accordion-' . esc_attr( $direction ), $active_type ];
|
||||
|
||||
$skew_class = '';
|
||||
if ( $skew_switcher && $direction == 'horizontal' ) {
|
||||
$skew_class = 'skew-direction-' . $skew_direction;
|
||||
array_push(
|
||||
$widget_class,
|
||||
'image-accordion-skew'
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'widget', 'class', $widget_class );
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
/* #endregion */
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( trim( $class . '__container' . ' ' . $skew_class ) ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'image_content' ] as $index => $item ) {
|
||||
|
||||
/* #region Item classes */
|
||||
$item_classes = [ $class . '__item' ,'elementor-repeater-item-' . esc_attr( $item[ '_id' ] ) ];
|
||||
$default_active = $active_type == 'activate-on-click' ? $opened_default_active : $hovered_default_active;
|
||||
|
||||
if ( $default_active && ($default_active - 1) == $index ) {
|
||||
array_push( $item_classes, 'default-active' );
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'item' . $index, [ 'class' => $item_classes ] );
|
||||
$item_classes = $this->get_render_attribute_string( 'item' . $index );
|
||||
/* #endregion */
|
||||
?>
|
||||
<div <?php echo $item_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__background' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $class . '__overlay' ); ?>">
|
||||
<?php
|
||||
/* #region Content classes */
|
||||
$this->add_render_attribute( 'content', [ 'class' => [ $class . '__content', 'image-accordion-' . $content_align ] ] );
|
||||
$content_classes = $this->get_render_attribute_string( 'content' );
|
||||
/* #endregion */
|
||||
|
||||
if ( $item[ 'content_switcher' ] ) {
|
||||
|
||||
$title = $item[ 'item_title' ];
|
||||
$description = $item[ 'item_description' ];
|
||||
?>
|
||||
<div <?php echo $content_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $item[ 'icon_switcher' ] ) {
|
||||
$icon = $item[ 'icon_updated' ]; ?>
|
||||
<i class="<?php echo esc_attr( $class . '__icon ' . $icon ); ?>"></i>
|
||||
<?php } ?>
|
||||
<h3 class="<?php echo esc_attr( $class . '__title' ); ?>">
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</h3>
|
||||
<div class="<?php echo esc_attr( $class . '__description' ); ?>">
|
||||
<?php echo esc_html( $description ) ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #region Render button */
|
||||
$link = $item[ 'link' ];
|
||||
$button_text = $item[ 'button_text' ];
|
||||
$show_button = $item[ 'show_button' ];
|
||||
|
||||
if ( ! empty( $button_text ) && $show_button == 'yes' ) {
|
||||
echo $this->image_accordion_render_button( $index, $button_text, $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
/* #endregion */
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
137
wp-content/plugins/stratum/includes/templates/image-hotspot.php
Normal file
137
wp-content/plugins/stratum/includes/templates/image-hotspot.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Group_Control_Image_Size;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Core\Settings\Manager;
|
||||
|
||||
if ( $type == 'php' ) {
|
||||
$dot_animation = $settings[ 'hotspot_dot_animation' ];
|
||||
|
||||
$dot_classes = [
|
||||
'stratum-image-hotspot__dot',
|
||||
!empty( $dot_animation ) ? 'has-animation-pulse' : ''
|
||||
];
|
||||
}
|
||||
|
||||
$class = 'stratum-image-hotspot';
|
||||
|
||||
$url_placeholder = Utils::get_placeholder_image_src();
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__image' ); ?>">
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
|
||||
list( , $id ) = array_values( $settings[ 'image' ] );
|
||||
|
||||
if ( empty( $id ) ) { ?>
|
||||
<img src="<?php echo esc_url( $url_placeholder ); ?>"/><?php
|
||||
} else {
|
||||
echo Group_Control_Image_Size::get_attachment_image_html( $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.image.url != '' ) {
|
||||
const image = {
|
||||
id: settings.image.id,
|
||||
url: settings.image.url,
|
||||
size: settings.image_size,
|
||||
model: view.getEditModel()
|
||||
};
|
||||
|
||||
const image_url = elementor.imagesManager.getImageUrl( image );
|
||||
#>
|
||||
<img class="wp-image-{{ settings.image.id }}" src="{{ image_url }}" />
|
||||
<# } else { #>
|
||||
<img src="<?php echo esc_url( $url_placeholder ); ?>"/>
|
||||
<# } #>
|
||||
<?php
|
||||
}?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
foreach ( $settings[ 'hot_spots' ] as $index => $item ) {
|
||||
|
||||
$icon_class = $item[ 'hotspot_icon' ];
|
||||
$merge = array_merge( $dot_classes, [ 'elementor-repeater-item-'.esc_attr( $item[ '_id' ] ) ] );
|
||||
|
||||
$this->add_render_attribute( 'dot'.$index, [ 'class' => $merge ] );
|
||||
$dot_class = $this->get_render_attribute_string( 'dot'.$index );
|
||||
|
||||
$wrapper = [
|
||||
'class' => $class.'__dot-wrapper'
|
||||
];
|
||||
|
||||
if ( !empty( $item[ 'tooltip' ] ) ) {
|
||||
$options = [
|
||||
'open' => !empty( $item[ 'open_by_default' ] ) ? true : false,
|
||||
'tooltipArrow' => !empty( $item[ 'tooltip_arrow' ] ) ? true : false,
|
||||
'placement' => $item[ 'placement' ],
|
||||
'tooltipTheme' => $item[ 'tooltip_theme' ],
|
||||
'tooltipAnimation' => $item[ 'tooltip_animation' ],
|
||||
'tooltipTrigger' => $item[ 'tooltip_interactivity' ],
|
||||
'tooltipContent' => $item[ 'tooltip_content' ],
|
||||
'tooltipTitle' => $item[ 'tooltip_title' ]
|
||||
];
|
||||
|
||||
$wrapper[ 'data-options' ] = json_encode( $options );
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'wrapper'.$index, $wrapper );
|
||||
$wrapper_class = $this->get_render_attribute_string( 'wrapper'.$index );
|
||||
|
||||
echo $this->get_dot_template( $class, $dot_class, $wrapper_class, $icon_class, $type, $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# let index = 0; #>
|
||||
<# _.each( settings.hot_spots, item => { #>
|
||||
<#
|
||||
const { tooltip, open_by_default, placement, tooltip_arrow, tooltip_theme } = settings.hot_spots[ index ];
|
||||
const { tooltip_animation, tooltip_interactivity } = settings.hot_spots[ index ];
|
||||
|
||||
let options;
|
||||
if ( tooltip != '' ) {
|
||||
options = {
|
||||
open : open_by_default != '' ? true : false,
|
||||
tooltipArrow: tooltip_arrow != '' ? true : false,
|
||||
tooltipAnimation: tooltip_animation,
|
||||
tooltipTrigger: tooltip_interactivity,
|
||||
tooltipContent: item.tooltip_content,
|
||||
tooltipTheme: tooltip_theme,
|
||||
tooltipTitle: item.tooltip_title,
|
||||
placement : placement
|
||||
}
|
||||
}
|
||||
|
||||
view.addRenderAttribute( 'dot' + index, {
|
||||
'class': [
|
||||
'stratum-image-hotspot__dot',
|
||||
settings.hotspot_dot_animation != '' ? 'has-animation-pulse' : '',
|
||||
'elementor-repeater-item-' + item._id
|
||||
]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper' + index, {
|
||||
'class': [ 'stratum-image-hotspot__dot-wrapper' ],
|
||||
...tooltip && {
|
||||
'data-options': JSON.stringify( options )
|
||||
}
|
||||
} );
|
||||
#>
|
||||
|
||||
<?php
|
||||
$icon_class = "{{ item.hotspot_icon }}";
|
||||
|
||||
$dot_class = "{{{ view.getRenderAttributeString( 'dot' + index ) }}}";
|
||||
$wrapper_class = "{{{ view.getRenderAttributeString( 'wrapper' + index ) }}}";
|
||||
|
||||
echo $this->get_dot_template( $class, $dot_class, $wrapper_class, $icon_class, $type ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
<# index++; } ); #>
|
||||
<?php
|
||||
}?>
|
||||
</div>
|
||||
</div>
|
||||
55
wp-content/plugins/stratum/includes/templates/instagram.php
Normal file
55
wp-content/plugins/stratum/includes/templates/instagram.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'items' => 6,
|
||||
'columns' => 3,
|
||||
'columns_mobile' => 3,
|
||||
'columns_tablet' => 3,
|
||||
'animate_on_scroll' => '',
|
||||
'animation_effects' => '',
|
||||
), $settings ) );
|
||||
|
||||
extract( shortcode_atts(
|
||||
array(
|
||||
'media' => array()
|
||||
),
|
||||
$extra_params
|
||||
) );
|
||||
|
||||
|
||||
$widget_name = 'stratum-instagram';
|
||||
|
||||
$class = $block_name = 'stratum-instagram';
|
||||
|
||||
$wrapper_class = 'stratum-instagram__wrapper masonry-grid' . ( $animate_on_scroll == 'yes' ? (' ' . $animation_effects . ' animate_on_scroll') : '' );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>">
|
||||
<?php
|
||||
$counter = 1;
|
||||
foreach ( $media as $value ) {
|
||||
if ( $counter <= $items ) {
|
||||
|
||||
$alt = '';
|
||||
if ( isset( $value->caption ) ) {
|
||||
$alt = wp_trim_words( $value->caption );
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_name ); ?>__item masonry-item">
|
||||
<div class="<?php echo esc_attr( $widget_name ); ?>__media-wrapper">
|
||||
<a class="<?php echo esc_attr( $widget_name ); ?>__media-link" target="_blank" href="<?php echo esc_url( $value->permalink ); ?>">
|
||||
<?php
|
||||
if ( $value->media_type == 'IMAGE' || $value->media_type == 'CAROUSEL_ALBUM' ){ ?>
|
||||
<img class="<?php echo esc_attr( $widget_name ); ?>__media" src="<?php echo esc_url( $value->media_url ); ?>" alt="<?php echo esc_attr( $alt ); ?>"/>
|
||||
<?php } elseif ($value->media_type == 'VIDEO'){ ?>
|
||||
<img class="<?php echo esc_attr( $widget_name ); ?>__media" src="<?php echo esc_url( $value->thumbnail_url ); ?>" alt="<?php echo esc_attr( $alt ); ?>"/>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
$counter ++;
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
$anim_url = $settings[ 'lottie_url' ];
|
||||
|
||||
if( empty( $anim_url ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$class = 'stratum-lottie-animations';
|
||||
$out = "";
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => [ $class.'__wrapper' ],
|
||||
'data-lottie-url' => $settings[ 'lottie_url' ],
|
||||
'data-lottie-render' => $settings[ 'lottie_renderer' ],
|
||||
'data-lottie-loop' => $settings[ 'lottie_loop' ],
|
||||
'data-lottie-reverse' => $settings[ 'lottie_reverse' ],
|
||||
'data-lottie-speed' => $settings[ 'lottie_speed' ],
|
||||
'data-lottie-hover' => $settings[ 'lottie_hover' ]
|
||||
]);
|
||||
|
||||
if( $settings[ 'animate_on_scroll' ] ) {
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-lottie-scroll',
|
||||
'data-lottie-scroll' => 'true',
|
||||
'data-scroll-start' => $settings['animate_view']['sizes']['start'],
|
||||
'data-scroll-end' => $settings['animate_view']['sizes']['end'],
|
||||
'data-scroll-speed' => $settings[ 'animate_speed' ][ 'size' ]
|
||||
]);
|
||||
}
|
||||
|
||||
$wrapper_classes = $this->get_render_attribute_string( 'wrapper' );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div <?php echo $wrapper_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>></div>
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'gallery_images' => array(),
|
||||
'gallery_columns' => array(),
|
||||
'gutter' => array(),
|
||||
'animate_on_scroll' => false,
|
||||
'animation_effects' => '',
|
||||
'image_size' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-masonry-gallery';
|
||||
|
||||
$gallery_id = uniqid( 'gallery-' );
|
||||
|
||||
$options = [
|
||||
'columns' => $gallery_columns['size'],
|
||||
'gutter' => $gutter['size'],
|
||||
'animate' => ($animate_on_scroll == 'yes' ? true : false)
|
||||
];
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ) . ($animate_on_scroll == 'yes' ? ' animate_on_scroll' : ''); ?> masonry-grid <?php
|
||||
echo esc_attr($animation_effects); ?>" data-options="<?php echo esc_attr(json_encode($options)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
|
||||
<div class="grid-sizer masonry-col-<?php echo esc_attr($gallery_columns['size']); ?>"></div>
|
||||
<?php
|
||||
foreach ( $gallery_images as $index => $image ) {
|
||||
$data_img = $this->_get_image_attributes( $image[ 'id' ] );
|
||||
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $image[ 'id' ], $image_size );
|
||||
$caption = wp_get_attachment_caption( $image[ 'id' ] );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__item' ); ?> masonry-item">
|
||||
<?php
|
||||
if (is_admin()){ ?>
|
||||
<a href="#" class="<?php echo esc_attr( $class . '__link' ); ?>">
|
||||
<?php } else { ?>
|
||||
<a data-elementor-open-lightbox="default" data-elementor-lightbox-slideshow="<?php echo esc_attr($gallery_id); ?>" href="<?php
|
||||
echo esc_url($image['url']); ?>" class="<?php echo esc_attr( $class . '__link' ); ?>">
|
||||
<?php } ?>
|
||||
<div class="<?php echo esc_attr( $class . '__image' ); ?>">
|
||||
<figure>
|
||||
<img class="wp-image-<?php echo esc_attr($image[ 'id' ]); ?>" alt="<?php
|
||||
echo esc_attr( $data_img[ 'alt' ] ); ?>" src="<?php echo esc_url($url); ?>" srcset="<?php
|
||||
echo $srcset; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php
|
||||
|
||||
if ( ! empty( $caption ) ) { ?>
|
||||
<figcaption class="<?php echo esc_attr( $class . '__caption' ); ?>">
|
||||
<?php echo wp_kses_post( $data_img[ 'caption' ] ); ?>
|
||||
</figcaption>
|
||||
<?php } ?>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__overlay' ); ?>"></div>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
63
wp-content/plugins/stratum/includes/templates/price-list.php
Normal file
63
wp-content/plugins/stratum/includes/templates/price-list.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( [
|
||||
'image' => '',
|
||||
'image_size' => 'full',
|
||||
'item_title' => '',
|
||||
'item_price' => '',
|
||||
'title_html_tag' => 'h3',
|
||||
'list_title' => '',
|
||||
'image_position' => '',
|
||||
'show_image' => 'no',
|
||||
'title_price_connector' => false
|
||||
], $settings ) );
|
||||
|
||||
$class = 'stratum-price-list';
|
||||
|
||||
$title_html_tag = stratum_validate_heading_html_tag( $title_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.' '.$image_position ); ?>">
|
||||
<?php
|
||||
if ( $image[ 'id' ] && $show_image == 'yes' ) {
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $image[ 'id' ], $image_size );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__image-wrapper' ); ?>">
|
||||
<img src="<?php echo esc_url( $url ); ?>" class="wp-image-<?php echo esc_attr( $image[ 'id' ] . ' ' . $class . '__image' ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__content' ); ?>">
|
||||
<<?php echo esc_html($title_html_tag); ?> class="<?php echo esc_attr( $class.'__heading' ); ?>"><?php echo esc_html( $list_title ); ?></<?php echo esc_html($title_html_tag); ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__items' ); ?>">
|
||||
<?php
|
||||
foreach ( $settings[ 'list_items' ] as $index => $item ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__item' ); ?>">
|
||||
<?php
|
||||
$tag_name = stratum_validate_heading_html_tag( $item[ 'title_html_tag' ] );
|
||||
$title = $item[ 'item_title' ];
|
||||
$price = $item[ 'item_price' ];
|
||||
?>
|
||||
<<?php echo esc_html($tag_name); ?> class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title );?></<?php echo esc_html($tag_name); ?>>
|
||||
<?php
|
||||
if ( $title_price_connector == 'yes' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class.'__connector' ); ?>"></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class.'__price' ); ?>"><?php echo esc_html( $price ); ?></span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
67
wp-content/plugins/stratum/includes/templates/price-menu.php
Normal file
67
wp-content/plugins/stratum/includes/templates/price-menu.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'title_price_connector' => false,
|
||||
'items_divider' => false,
|
||||
'menu_items' => array(),
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-price-menu';
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__items' ); ?>">
|
||||
<?php
|
||||
foreach ( $menu_items as $index => $item ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( 'elementor-repeater-item-'.$item['_id'] . ' ' . $class . '__item-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__item' ); ?>">
|
||||
<?php
|
||||
$id = $item[ 'image' ][ 'id' ];
|
||||
|
||||
if ( $id && $item[ 'show_image' ] ) {
|
||||
$image_size = $item[ 'image_size' ];
|
||||
$url = wp_get_attachment_image_url( $id, $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $id, $image_size );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__image image-align-' . $item[ 'image_align' ] ); ?>">
|
||||
<img class="wp-image-<?php echo esc_attr( $id ); ?>" src="<?php echo esc_url( $url ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__header' ); ?>">
|
||||
<?php
|
||||
$tag_name = stratum_validate_heading_html_tag( $item[ 'title_html_tag' ] );
|
||||
$menu_title = $item[ 'menu_title' ];
|
||||
$menu_price = $item[ 'menu_price' ];
|
||||
?>
|
||||
<<?php echo esc_html($tag_name); ?> class="<?php echo esc_attr( $class . '__title' ); ?>"><?php echo esc_html( $menu_title ); ?></<?php echo esc_html($tag_name); ?>>
|
||||
<?php
|
||||
if ( $title_price_connector == 'yes' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__connector' ); ?>"></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__price' ); ?>"><?php echo esc_html( $menu_price ); ?></span>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__description' ); ?>"><?php echo esc_html( $item[ 'menu_description' ] ); ?></div>
|
||||
<?php
|
||||
if ( $items_divider == 'yes') {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__divider' ); ?>"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
146
wp-content/plugins/stratum/includes/templates/price-table.php
Normal file
146
wp-content/plugins/stratum/includes/templates/price-table.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'title' => '',
|
||||
'title_typography' => array(),
|
||||
'title_typography_html_tag' => '',
|
||||
'subtitle' => '',
|
||||
'subtitles_typography' => array(),
|
||||
'subtitles_typography_html_tag' => '',
|
||||
'price_text' => '',
|
||||
'price' => '',
|
||||
'price_typography' => array(),
|
||||
'price_currency' => '',
|
||||
'price_description' => '',
|
||||
'content_items' => '',
|
||||
'align' => '',
|
||||
'button_show' => '',
|
||||
'button_text' => '',
|
||||
'button_url' => '',
|
||||
'title_color' => '',
|
||||
'title_color_hover' => '',
|
||||
'subtitle_color' => '',
|
||||
'subtitle_color_hover' => '',
|
||||
'price_color' => '',
|
||||
'price_color_hover' => '',
|
||||
'price_text_color' => '',
|
||||
'price_text_color_hover' => '',
|
||||
'description_color' => '',
|
||||
'description_color_hover' => '',
|
||||
'content_color' => '',
|
||||
'content_color_hover' => '',
|
||||
'button_color_font' => '',
|
||||
'button_color_font_hover' => '',
|
||||
'button_color_background' => '',
|
||||
'button_color_background_hover' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-price-table';
|
||||
|
||||
$title = wp_kses( $title, array(
|
||||
'span' => array(),
|
||||
'mark' => array(),
|
||||
'b' => array(),
|
||||
'strong' => array(),
|
||||
'br' => array()
|
||||
), $title );
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
$subtitles_typography_html_tag = stratum_validate_heading_html_tag( $subtitles_typography_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>">
|
||||
<div class="<?php echo esc_attr($class); ?>__wrapper">
|
||||
<?php
|
||||
//Headers
|
||||
if( !empty($subtitle) || !empty($title) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__header">
|
||||
<?php
|
||||
if ( !empty($subtitle) ) {
|
||||
?>
|
||||
<<?php echo esc_attr($subtitles_typography_html_tag); ?> class="<?php echo esc_attr($class); ?> __subtitle"><?php echo esc_html($subtitle); ?></<?php echo esc_attr($subtitles_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
if ( !empty($title) ) {
|
||||
?>
|
||||
<<?php echo esc_attr($title_typography_html_tag); ?> class="<?php echo esc_attr($class);?>__title"><?php echo esc_html($title); ?></<?php echo esc_attr($title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Price section
|
||||
if ( !empty($price_text) || !empty($price) || !empty($price_description) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__price-wrapper">
|
||||
<?php
|
||||
if ( !empty($price_text) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__price-text"><?php echo esc_html($price_text); ?></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($price) ) {
|
||||
?>
|
||||
<p class="<?php echo esc_attr($class); ?>__price"><?php echo esc_html($price);
|
||||
if ( !empty( $price_currency ) ) {
|
||||
?><i class="<?php echo esc_attr($class); ?>__price-currency"><?php echo esc_html($price_currency); ?></i><?php
|
||||
}
|
||||
?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($price_description) ) {
|
||||
?>
|
||||
<p class="<?php echo esc_attr($class); ?>__price-description"><?php echo esc_html($price_description); ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Content section
|
||||
if ( !empty($content_items) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__content-wrapper">
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($content_items as $key => $item) {
|
||||
$item_id = 'elementor-repeater-item-'.esc_attr($item['_id']);
|
||||
?>
|
||||
<li class="<?php echo esc_attr($item_id . ' ' . $class . '__content');?>"><?php
|
||||
if ( !empty($item['item_icon']) ) {
|
||||
?><i class="<?php echo esc_attr($item['item_icon']); ?>"></i> <?php
|
||||
}
|
||||
echo esc_html($item['item_text']);
|
||||
?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $button_show == 'yes' ) {
|
||||
//Button
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__button elementor-widget-button">
|
||||
<a href="<?php echo esc_url($button_url['url']); ?>" class="button elementor-button" <?php
|
||||
if ( $button_url['is_external'] ) {
|
||||
?>
|
||||
target="_blank"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
><?php echo esc_html($button_text); ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
186
wp-content/plugins/stratum/includes/templates/table.php
Normal file
186
wp-content/plugins/stratum/includes/templates/table.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Frontend;
|
||||
use \Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'table_head_items' => array(),
|
||||
'table_body_items' => array(),
|
||||
'table_head_alignment_horizontal' => '',
|
||||
'table_body_alignment_horizontal' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-table';
|
||||
|
||||
$table_tr = [];
|
||||
$table_td = [];
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<table class="<?php echo esc_attr( $class . '__table' ); ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
foreach ( $table_head_items as $key => $table_head ) :
|
||||
$current_text_align = ! empty( $table_head[ 'table_content_alignment' ] ) ? $table_head[ 'table_content_alignment' ] : null;
|
||||
$current_bg = ! empty( $table_head[ 'table_head_unique_bgcolor' ] ) ? "style='background: " . esc_attr( $table_head[ 'table_head_unique_bgcolor' ] ) . ";'" : null;
|
||||
$current_text_color = ! empty( $table_head[ 'table_head_unique_text_color' ] ) ? "style='color: " . esc_attr( $table_head[ 'table_head_unique_text_color' ] ) . ";'" : null;
|
||||
$current_icon_color = ! empty( $table_head[ 'table_head_unique_icon_color' ] ) ? "color: " . esc_attr( $table_head[ 'table_head_unique_icon_color' ] ) . ";" : null;
|
||||
$current_media_space = ! empty( $table_head[ 'table_head_icon_margin' ][ 'top' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'right' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'bottom' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'left' ] ) ? "margin: " . $table_head[ 'table_head_icon_margin' ][ 'top' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'right' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'bottom' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'left' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ";" : null;
|
||||
$icon_style = ! empty( $current_media_space ) || ! empty( $current_icon_color ) ? sprintf( 'style="%1$s %2$s"', esc_attr( $current_media_space ), esc_attr( $current_icon_color ) ) : null;
|
||||
?>
|
||||
<th colspan="<?php echo esc_attr( $table_head[ 'table_colspan_head' ] ); ?>" <?php echo $current_bg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__header-cell' ) . ' ' . esc_attr( 'align-content-' . ( ! empty( $current_text_align ) ? $current_text_align : $table_head_alignment_horizontal ) ); ?>">
|
||||
|
||||
<span class="<?php echo esc_attr( $class . '__cell-title' ) . ' ' . esc_attr( 'has-media-' . $table_head[ 'table_head_pos' ] ); ?>" <?php echo $current_text_color; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php echo esc_html__( $table_head[ 'table_head_title' ] );
|
||||
|
||||
if ( $table_head[ 'table_head_icon_type' ] != 'none' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-icon' );?>" <?php echo $icon_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>>
|
||||
<?php
|
||||
if ( $table_head[ 'table_head_icon_type' ] == 'icon' ) :
|
||||
$migrated = isset( $table_head[ '__fa4_migrated' ][ 'table_head_icons' ] );
|
||||
$is_new = empty( $table_head[ 'table_head_icon' ] );
|
||||
|
||||
if ( $is_new || $migrated ) :
|
||||
Icons_Manager::render_icon( $table_head[ 'table_head_icons' ], [ 'aria-hidden' => 'true' ] );
|
||||
else: ?>
|
||||
<i class="<?php echo esc_attr( $table_head[ 'table_head_icon' ] ); ?>"></i>
|
||||
<?php endif;
|
||||
|
||||
elseif ( $table_head[ 'table_head_icon_type' ] == 'image' ) :
|
||||
?>
|
||||
<img src="<?php
|
||||
echo esc_url( $table_head[ 'table_head_image' ][ 'url' ] ); ?>" alt="<?php
|
||||
echo esc_attr( get_post_meta( $table_head[ 'table_head_image' ][ 'id' ], '_wp_attachment_image_alt', true ) );
|
||||
?>" style="width: <?php echo esc_attr( $table_head[ 'table_head_image_size' ] ); ?>px"/><?php
|
||||
endif; ?>
|
||||
|
||||
</span>
|
||||
<?php
|
||||
endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
</th><?php
|
||||
endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $table_body_items as $key => $table_body ) :
|
||||
$row_id = uniqid();
|
||||
|
||||
if ( $table_body[ 'table_col_select' ] == 'Row' ) :
|
||||
$table_tr[] = [
|
||||
'id' => $row_id,
|
||||
'type' => $table_body[ 'table_col_select' ]
|
||||
];
|
||||
endif;
|
||||
|
||||
if ( $table_body[ 'table_col_select' ] == 'Col' ) :
|
||||
$table_tr_keys = array_keys( $table_tr );
|
||||
$last_key = end( $table_tr_keys );
|
||||
|
||||
$table_td[] = [
|
||||
'row_id' => $table_tr[ $last_key ][ 'id' ],
|
||||
'type' => $table_body[ 'table_col_select' ],
|
||||
'title' => esc_html__( $table_body[ 'table_col_title' ] ),
|
||||
'content_type' => $table_body[ 'table_col_content_type' ],
|
||||
'table_colspan' => $table_body[ 'table_colspan_body' ],
|
||||
'template' => $table_body[ 'table_col_template' ],
|
||||
'editor' => $table_body[ 'table_col_editor' ],
|
||||
'icon_type' => $table_body[ 'table_col_icon_type' ],
|
||||
'f4_comp' => isset( $table_body[ '__fa4_migrated' ][ 'table_col_icons' ] ),
|
||||
'icon' => empty( $table_body[ 'table_col_icon' ] ),
|
||||
'icons' => $table_body[ 'table_col_icons' ],
|
||||
'image' => $table_body[ 'table_col_image' ],
|
||||
'image_size' => $table_body[ 'table_col_image_size' ],
|
||||
'icon_pos' => $table_body[ 'table_col_pos' ],
|
||||
'content_align' => $table_body[ 'table_col_content_alignment' ],
|
||||
'icon_color' => $table_body[ 'table_body_unique_icon_color' ],
|
||||
'media_space' => $table_body[ 'table_col_margin' ],
|
||||
'text_color' => $table_body[ 'table_body_unique_text_color' ],
|
||||
'bg_color' => $table_body[ 'table_body_unique_bgcolor' ],
|
||||
];
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
for ( $i = 0; $i < count( $table_tr ); $i++ ) :
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
for ( $j = 0; $j < count( $table_td ); $j++ ) :
|
||||
if ( $table_tr[ $i ][ 'id' ] === $table_td[ $j ][ 'row_id' ] ) :
|
||||
$body_text_align = ! empty( $table_td[ $j ][ 'content_align' ] ) ? $table_td[ $j ][ 'content_align' ] : null;
|
||||
$body_bg = ! empty( $table_td[ $j ][ 'bg_color' ] ) ? "style='background: " . $table_td[ $j ][ 'bg_color' ] . ";'" : null;
|
||||
$body_text_color = ! empty( $table_td[ $j ][ 'text_color' ] ) ? "style='color: " . esc_attr( $table_td[ $j ][ 'text_color' ] ) . ";'" : null;
|
||||
$body_icon_color = ! empty( $table_td[ $j ][ 'icon_color' ] ) ? "color: " . esc_attr( $table_td[ $j ][ 'icon_color' ] ) . ";" : null;
|
||||
$body_media_space = ! empty( $table_td[ $j ][ 'media_space' ][ 'top' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'right' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'bottom' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'left' ] ) ? "margin: " . $table_td[ $j ][ 'media_space' ][ 'top' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'right' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'bottom' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'left' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ";" : null;
|
||||
$body_icon_style = ! empty( $body_media_space ) || ! empty( $body_icon_color ) ? sprintf( 'style="%1$s %2$s"', esc_attr( $body_media_space ), esc_attr( $body_icon_color ) ) : null;
|
||||
?>
|
||||
<td <?php echo $body_bg; ?> colspan="<?php echo esc_attr( $table_td[ $j ][ 'table_colspan' ] ); ?>"><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="<?php echo esc_attr( $class . '__body-cell' ) . ' ' . esc_attr( 'align-content-' . ( ! empty( $body_text_align ) ? $body_text_align : $table_body_alignment_horizontal ) ); ?>">
|
||||
<?php
|
||||
if ( $table_td[ $j ][ 'content_type' ] === 'default' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-title' ) . ' ' . esc_attr( 'has-media-' . $table_td[ $j ][ 'icon_pos' ] ); ?>" <?php echo $body_text_color; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php echo wp_kses_post( $table_td[ $j ][ 'title' ] );
|
||||
|
||||
if ( $table_td[ $j ][ 'icon_type' ] != 'none' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-icon' ); ?>" <?php echo $body_icon_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $table_td[ $j ][ 'icon_type' ] == 'icon' ) :
|
||||
$migrated = isset( $table_td[ $j ][ 'f4_comp' ] );
|
||||
$is_new = empty( $table_td[ $j ][ 'icon' ] );
|
||||
|
||||
if ( $is_new || $migrated ) :
|
||||
Icons_Manager::render_icon( $table_td[ $j ][ 'icons' ], [ 'aria-hidden' => 'true' ] );
|
||||
else: ?>
|
||||
<i class="<?php echo esc_attr( $table_td[ $j ][ 'icon' ] ); ?>"></i><?php
|
||||
endif;
|
||||
|
||||
elseif ( $table_td[ $j ][ 'icon_type' ] == 'image' ) :
|
||||
?>
|
||||
<img src="<?php
|
||||
echo esc_url( $table_td[ $j ][ 'image' ][ 'url' ] ); ?>" alt="<?php
|
||||
echo esc_attr( get_post_meta( $table_td[ $j ][ 'image' ][ 'id' ], '_wp_attachment_image_alt', true ) );
|
||||
?>" style="width: <?php echo esc_attr( $table_td[ $j ][ 'image_size' ] ); ?>px"/><?php
|
||||
endif;
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
endif; ?>
|
||||
</span>
|
||||
<?php
|
||||
elseif ( $table_td[ $j ][ 'content_type' ] === 'template' ) :
|
||||
$get_template = $frontend->get_builder_content( $table_td[ $j ][ 'template' ], true );
|
||||
|
||||
if ( ! empty( $get_template ) ) :
|
||||
echo $get_template; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
else : ?>
|
||||
<span><?php echo esc_html__( 'Template is not found', 'stratum' ); ?></span>
|
||||
<?php endif;
|
||||
else : ?>
|
||||
<div class="<?php echo esc_attr( $class . '__editor-content' ); ?>">
|
||||
<?php echo $table_td[ $j ][ 'editor' ]; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div><?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</td><?php
|
||||
endif;
|
||||
endfor;
|
||||
?>
|
||||
</tr><?php
|
||||
endfor; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
//Swiper
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
'heading_typography_html_tag' => 'h3',
|
||||
'subtitle_typography_html_tag' => 'span',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-testimonial-carousel';
|
||||
$slider_options = stratum_generate_swiper_options( $settings );
|
||||
|
||||
$heading_typography_html_tag = stratum_validate_heading_html_tag( $heading_typography_html_tag );
|
||||
$subtitle_typography_html_tag = stratum_validate_heading_html_tag( $subtitle_typography_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode( $slider_options ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
<div class="swiper swiper-container stratum-main-swiper">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
foreach ( $settings[ 'slides' ] as $index => $item ) {
|
||||
|
||||
$current_item = 'elementor-repeater-item-' . $item[ '_id' ];?>
|
||||
<div class="swiper-slide <?php echo esc_attr( $current_item ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__wrapper" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__container" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__container-inner" ) ;?>">
|
||||
<div class="<?php echo esc_attr( $class . "__footer" ); ?>">
|
||||
<?php
|
||||
list( , $id ) = array_values( $item[ 'image' ] );
|
||||
|
||||
if ( ! empty( $item[ 'image' ][ 'url' ] ) ) {
|
||||
$url_placeholder = Utils::get_placeholder_image_src();
|
||||
$srcset = wp_get_attachment_image_srcset( $id, 'full' );
|
||||
$url = wp_get_attachment_image_url ( $id, 'full' );
|
||||
$src_url = empty( $url ) ? $url_placeholder : $url;
|
||||
?>
|
||||
<img src="<?php echo esc_url( $src_url ); ?>" class="<?php
|
||||
echo esc_attr( $class . '__image' ) . " wp-image-" . esc_attr( $id ) ?>" srcset="<?php
|
||||
echo $srcset; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"/>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . "__content" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__cite" );?> ">
|
||||
<<?php echo esc_html( $heading_typography_html_tag ); ?> class="<?php echo esc_attr( $class . "__heading" ); ?>">
|
||||
<?php echo esc_html( $item[ 'heading' ] ); ?>
|
||||
</<?php echo esc_html( $heading_typography_html_tag ); ?>>
|
||||
<<?php echo esc_html( $subtitle_typography_html_tag ); ?> class="<?php echo esc_attr( $class . "__subtitle" ); ?>">
|
||||
<?php echo esc_html( $item[ 'subtitle' ] ); ?>
|
||||
</<?php echo esc_html( $subtitle_typography_html_tag ); ?>>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . "__text" ); ?>">
|
||||
<?php echo esc_html( $item[ 'content' ] ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div><?php
|
||||
//swiper-wrapper
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ( $pagination_style == 'scrollbar' ) { ?>
|
||||
<div class="swiper-scrollbar"></div>
|
||||
<?php } else { ?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php }
|
||||
}?>
|
||||
</div><?php
|
||||
//swiper-container
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) { ?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-vertical-timeline';
|
||||
|
||||
$alignment = $settings[ 'vertical_alignment' ];
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [
|
||||
$class,
|
||||
$class . '--align-' . $alignment
|
||||
],
|
||||
'data-animation' => esc_attr( $settings[ 'animate_cards' ] )
|
||||
]);
|
||||
|
||||
$this->add_render_attribute( 'inner', [
|
||||
'class' => [
|
||||
$class . '-item__inner',
|
||||
$class . '-item__inner' . $this->_get_alignment( $settings, 'vertical' )
|
||||
]
|
||||
]);
|
||||
|
||||
$item_classes = [
|
||||
$class . '-item',
|
||||
$this->_get_alignment( $settings, 'horizontal' )
|
||||
];
|
||||
|
||||
$widget_classes = $this->get_render_attribute_string( 'widget' );
|
||||
$inner_classes = $this->get_render_attribute_string( 'inner' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__line' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__line-progress' ); ?>"></div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__list' ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'image_content' ] as $index => $item ) {
|
||||
|
||||
$merge = array_merge( $item_classes, [ 'elementor-repeater-item-' . esc_attr( $item[ '_id' ] ) ] );
|
||||
$title_html_tag = stratum_validate_heading_html_tag( $settings[ 'title_tag' ] );
|
||||
|
||||
$this->add_render_attribute( 'item' . $index, [ 'class' => $merge ] );
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $index );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-inner' );?>">
|
||||
<?php
|
||||
/* #region Render image */
|
||||
if ( !empty( $item[ 'show_item_image' ] ) ) {
|
||||
echo $this->_get_timeline_image( $class, $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
/* #endregion */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-content' );?>">
|
||||
<?php
|
||||
if ( ! empty( $item[ 'item_link' ][ 'url' ] ) ) {
|
||||
$this->add_link_attributes( 'url' . $index, $item[ 'item_link' ] ); ?>
|
||||
<a class="<?php echo esc_attr( $class . '-item__card-link' );?>" <?php
|
||||
echo $this->get_render_attribute_string( 'url' . $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>>
|
||||
<?php } ?>
|
||||
|
||||
<<?php echo esc_html($title_html_tag); ?> class="<?php echo esc_attr( $class . '-item__card-title' );?>">
|
||||
<?php echo esc_html( $item[ 'item_title' ] ); ?>
|
||||
</<?php echo esc_html($title_html_tag); ?>>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $item[ 'item_link' ][ 'url' ] ) ) { ?>
|
||||
</a>
|
||||
<?php }
|
||||
|
||||
if ( $item[ 'item_description_type' ] === 'default' ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-description' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_description' ] ); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-description' ); ?>">
|
||||
<?php echo wp_kses_post( $item[ 'item_description_editor' ] ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-arrow' ); ?>"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '-item__point' ); ?>">
|
||||
<?php
|
||||
echo $this->_generate_point_content( $class, $item, $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta-content' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user