Пример #1
0
 function presscore_footer_html_class($class = array())
 {
     $output = array('footer');
     $config = Presscore_Config::get_instance();
     switch ($config->get('template.footer.style')) {
         case 'full_width_line':
             $output[] = 'full-width-line';
             break;
         case 'solid_background':
             $output[] = 'solid-bg';
             break;
         case 'transparent_bg_line':
             $output[] = 'transparent-bg';
             break;
             // default - content_width_line
     }
     //////////////
     // Output //
     //////////////
     if ($class && !is_array($class)) {
         $class = explode(' ', $class);
     }
     $output = apply_filters('presscore_footer_html_class', array_merge($class, $output));
     return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : '';
 }
Пример #2
0
 /**
  * @since 1.0.0
  * 
  * @param  array  $class
  * @return string
  */
 function presscore_list_container_html_class($custom_class = array())
 {
     $config = presscore_get_config();
     $html_class = array();
     if ('dark' == $config->get('post.preview.hover.color')) {
         $html_class[] = 'hover-color-static';
     }
     $html_class[] = presscore_template_loading_effect_html_class($config->get('post.preview.load.effect'));
     // ajax class
     if (!in_array($config->get('load_style'), array('default', false))) {
         $html_class[] = 'with-ajax';
     }
     // lazy loading
     if ('lazy_loading' == $config->get('load_style')) {
         $html_class[] = 'lazy-loading-mode';
     }
     //////////////
     // Output //
     //////////////
     if ($custom_class && !is_array($custom_class)) {
         $custom_class = explode(' ', $custom_class);
     }
     $html_class = apply_filters('presscore_masonry_container_class', array_merge($custom_class, $html_class));
     return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : '';
 }
 function presscore_footer_html_class($class = array())
 {
     if ($class) {
         $output = is_array($class) ? $class : explode(' ', $class);
     } else {
         $output = array();
     }
     switch (presscore_config()->get('template.footer.style')) {
         case 'full_width_line':
             $output[] = 'full-width-line';
             break;
         case 'solid_background':
             $output[] = 'solid-bg';
             if ('outline' === presscore_config()->get('template.footer.decoration')) {
                 $output[] = 'footer-outline-decoration';
             }
             break;
             // default - content_width_line
     }
     $output = apply_filters('presscore_footer_html_class', $output);
     return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : '';
 }
 /**
  * @since 1.0.0
  * 
  * @param  array  $class
  * @return string
  */
 function presscore_masonry_container_class($custom_class = array())
 {
     $config = Presscore_Config::get_instance();
     $html_class = array();
     //////////////////////
     // Common classes //
     //////////////////////
     // ajax class
     if (!in_array($config->get('load_style'), array('default', false))) {
         $html_class[] = 'with-ajax';
     }
     // loading effect
     $html_class[] = presscore_template_loading_effect_html_class($config->get('post.preview.load.effect'));
     // lazy loading
     if ('lazy_loading' == $config->get('load_style')) {
         $html_class[] = 'lazy-loading-mode';
     }
     // description style
     $description_style = $config->get('post.preview.description.style');
     if ('under_image' == $description_style) {
         $html_class[] = 'description-under-image';
     } else {
         if ('disabled' != $description_style) {
             $html_class[] = 'description-on-hover';
         }
     }
     // layout
     switch ($config->get('layout')) {
         case 'grid':
             $html_class[] = 'iso-grid';
             break;
         case 'masonry':
             $html_class[] = 'iso-container';
             break;
     }
     if ($config->get('justified_grid')) {
         $html_class[] = 'jg-container';
     }
     // post preview background
     if ($config->get('post.preview.background.enabled')) {
         $html_class[] = 'bg-under-post';
     }
     // hover classes
     switch ($config->get('post.preview.description.style')) {
         case 'on_hoover_centered':
             $html_class[] = 'hover-style-two';
             $html_class[] = presscore_hover_animation_class();
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'under_image':
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'on_dark_gradient':
             $html_class[] = 'hover-style-one';
             if ('always' == $config->get('post.preview.hover.content.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
         case 'from_bottom':
             $html_class[] = 'hover-style-three';
             $html_class[] = 'cs-style-3';
             if ('always' == $config->get('post.preview.hover.content.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
     }
     // round images
     if ('round' == $config->get('image_layout')) {
         $html_class[] = 'round-images';
     }
     //////////////
     // Output //
     //////////////
     if ($custom_class && !is_array($custom_class)) {
         $custom_class = explode(' ', $custom_class);
     }
     $html_class = apply_filters('presscore_masonry_container_class', array_merge($custom_class, $html_class));
     return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : '';
 }
 /**
  * Dispay login form.
  *
  * @since 3.0.0
  */
 function pressocore_render_login_form()
 {
     $config = presscore_config();
     if (is_user_logged_in()) {
         $caption = $config->get('header.elements.logout.caption');
         $login_link = wp_logout_url();
     } else {
         $caption = $config->get('header.elements.login.caption');
         $login_link = esc_url($config->get('header.elements.login.url'));
         if (!$login_link) {
             $login_link = wp_login_url();
         }
     }
     $class = array('submit');
     if (!$config->get('header.elements.login.icon.enabled')) {
         $class[] = 'icon-off';
     } else {
         if (!$caption) {
             $class[] = 'text-disable';
         }
     }
     if (!$caption) {
         $caption = ' ';
     }
     $classes = presscore_get_mini_widget_class('header-elements-login', 'mini-login');
     echo '<div class="' . implode(' ', $classes) . '"><a href="' . esc_url($login_link) . '" class="' . presscore_esc_implode(' ', $class) . '">' . esc_html($caption) . '</a></div>';
 }
Пример #6
0
 function presscore_get_page_title_wrap_html_class($class = array())
 {
     $config = Presscore_Config::get_instance();
     $output = array();
     switch ($config->get('page_title.align')) {
         case 'right':
             $output[] = 'title-right';
             break;
         case 'left':
             $output[] = 'title-left';
             break;
         case 'all_right':
             $output[] = 'content-right';
             break;
         case 'all_left':
             $output[] = 'content-left';
             break;
         default:
             $output[] = 'title-center';
     }
     $title_bg_mode_class = presscore_get_page_title_bg_mode_html_class();
     if ($title_bg_mode_class) {
         $output[] = $title_bg_mode_class;
     }
     if (!$config->get('page_title.breadcrumbs.enabled')) {
         $output[] = 'breadcrumbs-off';
     }
     if ($config->get('page_title.background.parallax_speed')) {
         $output[] = 'page-title-parallax-bg';
     }
     //////////////
     // Output //
     //////////////
     if ($class && !is_array($class)) {
         $class = explode(' ', $class);
     }
     $output = apply_filters('presscore_get_page_title_wrap_html_class', array_merge($class, $output));
     return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : '';
 }
    case 'rectangular':
        $dt_cart_class[] = 'rectangular-counter-style';
        break;
}
if ($config->get_bool('woocommerce.mini_cart.dropdown')) {
    $dt_cart_class[] = 'show-sub-cart';
}
?>

<div class="<?php 
echo 'shopping-cart ' . implode(' ', presscore_get_mini_widget_class('header-elements-woocommerce_cart', $dt_cart_class));
?>
">

	<a class="wc-ico-cart <?php 
echo presscore_esc_implode(' ', $dt_cart_class);
?>
" href="<?php 
echo WC()->cart->get_cart_url();
?>
"><?php 
echo $dt_cart_caption, $dt_product_counter_html;
?>
</a>

	<div class="shopping-cart-wrap">
		<div class="shopping-cart-inner">

			<?php 
$cart_is_empty = count(WC()->cart->get_cart()) <= 0;
$list_class = array('cart_list', 'product_list_widget');
 /**
  * Returns html class property based on current template settings.
  * 
  * @since 1.0.0
  * @param  array  $custom_class Custom class.
  * @return string
  */
 function presscore_masonry_container_class($custom_class = array())
 {
     $_custom_class = $custom_class;
     if (!is_array($_custom_class)) {
         $_custom_class = (string) $_custom_class;
         $_custom_class = explode(' ', $_custom_class);
     }
     $html_class = $_custom_class;
     $config = presscore_config();
     // ajax class
     if (!in_array($config->get('load_style'), array('default', false))) {
         $html_class[] = 'with-ajax';
     }
     // loading effect
     $html_class[] = presscore_tpl_get_load_effect_class($config->get('post.preview.load.effect'));
     // lazy loading
     if ('lazy_loading' == $config->get('load_style')) {
         $html_class[] = 'lazy-loading-mode';
     }
     // layout
     switch ($config->get('layout')) {
         case 'grid':
             $html_class[] = 'iso-grid';
             break;
         case 'masonry':
             $html_class[] = 'iso-container';
             break;
     }
     if ($config->get('justified_grid')) {
         $html_class[] = 'jg-container';
     }
     // post preview background
     if ($config->get('post.preview.background.enabled')) {
         $html_class[] = 'bg-under-post';
     }
     // description style
     $description_style = $config->get('post.preview.description.style');
     if ('under_image' == $description_style) {
         $html_class[] = 'description-under-image';
     } else {
         if ('disabled' != $description_style) {
             $html_class[] = 'description-on-hover';
         }
     }
     // hover classes
     switch ($description_style) {
         case 'on_hoover_centered':
             $html_class[] = 'hover-style-two';
             $html_class[] = presscore_tpl_get_hover_anim_class($config->get('post.preview.hover.animation'));
             // content align
             $html_class[] = presscore_tpl_get_content_align_class($config->get('post.preview.description.alignment'));
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'under_image':
             // content align
             $html_class[] = presscore_tpl_get_content_align_class($config->get('post.preview.description.alignment'));
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             break;
         case 'on_dark_gradient':
             $html_class[] = 'hover-style-one';
             // content align
             $html_class[] = presscore_tpl_get_content_align_class($config->get('post.preview.description.alignment'));
             if ('always' == $config->get('post.preview.hover.content.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
         case 'from_bottom':
             $html_class[] = 'hover-style-three';
             $html_class[] = 'cs-style-3';
             // content align
             $html_class[] = presscore_tpl_get_content_align_class($config->get('post.preview.description.alignment'));
             break;
         case 'bg_with_lines':
             $html_class[] = 'hover-style-two';
             $html_class[] = presscore_tpl_get_anim_effect_class($config->get('post.preview.hover.lines.animation'));
             if ('dark' == $config->get('post.preview.hover.color')) {
                 $html_class[] = 'hover-color-static';
             }
             if ('always' == $config->get('post.preview.hover.title.visibility')) {
                 $html_class[] = 'always-show-info';
             }
             break;
     }
     // round images
     if ('round' == $config->get('image_layout')) {
         $html_class[] = 'round-images';
     }
     /**
      * Masonry container class filter.
      *
      * @since 1.0.0
      * @var array $html_class
      */
     $html_class = apply_filters('presscore_masonry_container_class', $html_class);
     return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : '';
 }
 /**
  * Add post open div for masonry layout.
  */
 function presscore_before_post_masonry()
 {
     global $post;
     $config = presscore_config();
     $html_class = array('wf-cell');
     // wide posts
     if (!$config->get('all_the_same_width') && 'wide' == $config->get('post.preview.width')) {
         $html_class[] = 'double-width';
     }
     // masonry layout
     if ('masonry' == $config->get('layout')) {
         $html_class[] = 'iso-item';
     }
     // if filter enabled
     if ($config->get('template.posts_filter.terms.enabled') || $config->get('template.posts_filter.orderby.enabled') || $config->get('template.posts_filter.order.enabled')) {
         // add terms to class
         $taxonomy = apply_filters('presscore_before_post_masonry-filter_taxonomy', 'category', get_post_type());
         $terms = get_the_terms(get_the_ID(), $taxonomy);
         if ($terms && !is_wp_error($terms)) {
             foreach ($terms as $term) {
                 $html_class[] = 'category-' . $term->term_id;
             }
         } else {
             $html_class[] = 'category-0';
         }
     }
     // data attributes for filtering
     $data_attr = array('post-id' => get_the_ID(), 'date' => esc_attr(get_the_date('c')), 'name' => esc_attr($post->post_title));
     $data_attr = apply_filters('presscore_before_post_masonry-wrap_data_attr', $data_attr);
     $html_class = apply_filters('presscore_before_post_masonry-wrap_class', $html_class);
     echo '<div class="' . presscore_esc_implode(' ', $html_class) . '" ' . presscore_get_inlide_data_attr($data_attr) . '>';
 }
Пример #10
0
 protected function get_html_class()
 {
     // static classes
     $classes = array('btn-shortcode');
     // base classes table
     // contains array( 'attribute' => array( 'value' => 'class' ) )
     $att_value_class_table = array('size' => array('small' => 'dt-btn-s', 'medium' => 'dt-btn-m', 'big' => 'dt-btn-l'), 'style' => array('light' => 'dt-btn btn-light', 'outline' => 'dt-btn outline-btn', 'outline_with_bg' => 'dt-btn outline-bg-btn', 'link' => 'btn-link', 'light_with_bg' => 'dt-btn light-bg-btn', 'default' => 'dt-btn'), 'text_color_style' => array('context' => 'title-btn-color', 'default' => 'default-btn-color', 'accent' => 'accent-btn-color', 'custom' => 'custom-btn-color'), 'text_hover_color_style' => array('context' => 'title-btn-hover-color', 'default' => 'default-btn-hover-color', 'accent' => 'accent-btn-hover-color', 'custom' => 'custom-btn-hover-color'), 'bg_color_style' => array('default' => 'default-btn-bg-color', 'accent' => 'accent-btn-bg-color'), 'bg_hover_color_style' => array('default' => 'default-btn-bg-hover-color', 'accent' => 'accent-btn-bg-hover-color'));
     foreach ($att_value_class_table as $att => $values) {
         // if att from table exists - get it's value
         $value = array_key_exists($att, $this->atts) ? $this->atts[$att] : false;
         // if att value mentioned in table - add class from table
         if ($value && array_key_exists($value, $values)) {
             $classes[] = $values[$value];
         }
     }
     // animation
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $classes[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
         $classes[] = 'animation-builder';
     }
     // icon alignment
     if ($this->atts['icon'] && 'right' == $this->atts['icon_align']) {
         $classes[] = 'ico-right-side';
     }
     // smooth scroll
     if ($this->atts['smooth_scroll']) {
         $classes[] = 'anchor-link';
     }
     // custom class
     if ($this->atts['el_class']) {
         $classes[] = $this->atts['el_class'];
     }
     return presscore_esc_implode(' ', $classes);
 }
 public static function render_header_language_switcher_action()
 {
     echo '<div class="' . presscore_esc_implode(' ', presscore_get_mini_widget_class('header-elements-language', 'mini-wpml')) . '">';
     do_action('icl_language_selector');
     echo '</div>';
 }