function zn_add_factory()
    {
        $elements_data = $page_options_data = array();
        $categories = $this->zn_categories();
        foreach (ZNPB()->all_available_elements as $class => $values) {
            $elements_data[] = $values;
        }
        // Get the page options
        include_once THEME_BASE . '/template_helpers/pagebuilder/page_options.php';
        unset($options['has_tabs']);
        // Loop trough all the options tabs
        foreach ($options as $key => $tab) {
            foreach ($tab['options'] as $key => $option) {
                $page_options_data[$option['id']] = get_post_meta(zn_get_the_id(), $option['id'], true);
            }
        }
        ?>
		<!-- PAGEBUILDER FACTORY -->
		<script>

			!function ($) {
				$.ZnPbFactory = {
					current_layout : <?php 
        echo json_encode(ZNPB()->current_modules);
        ?>
,
					elements_data : <?php 
        echo json_encode($elements_data);
        ?>
,
					pb_menu :<?php 
        echo json_encode($categories);
        ?>
,
					page_options :<?php 
        echo json_encode($page_options_data);
        ?>
,
				};
			}(jQuery)

		</script><?php 
    }
Example #2
0
function znpb_add_kallyas_template($current_layout, $post, $post_id)
{
    if (!is_page($post_id)) {
        return $current_layout;
    }
    $sidebar_pos = get_post_meta($post_id, 'zn_page_layout', true);
    $sidebar_to_use = get_post_meta($post_id, 'zn_sidebar_select', true);
    $subheader_style = get_post_meta($post_id, 'zn_subheader_style', true) !== '0' ? get_post_meta($post_id, 'zn_subheader_style', true) : 'zn_def_header_style';
    $sidebar_saved_data = zget_option('page_sidebar', 'unlimited_sidebars', false, array('layout' => 'right_sidebar', 'sidebar' => 'defaultsidebar'));
    if ($sidebar_pos == 'default' || empty($sidebar_pos)) {
        $sidebar_pos = $sidebar_saved_data['layout'];
    }
    if ($sidebar_to_use == 'default' || empty($sidebar_to_use)) {
        $sidebar_to_use = $sidebar_saved_data['sidebar'];
    }
    // We will add the new elements here
    $sidebar = ZNPB()->add_module_to_layout('TH_Sidebar', array('sidebar_select' => $sidebar_to_use));
    $sidebar_column = ZNPB()->add_module_to_layout('ZnColumn', array(), array($sidebar), 'col-sm-3');
    $sections[] = ZNPB()->add_module_to_layout('TH_CustomSubHeaderLayout', array('hm_header_style' => $subheader_style));
    // If the sidebar was saved as left sidebar
    if ($sidebar_pos == 'left_sidebar') {
        $columns[] = $sidebar_column;
    }
    // Add the main shop content
    $archive_columns = $sidebar_pos == 'no_sidebar' ? 4 : 3;
    $textbox = ZNPB()->add_module_to_layout('TH_TextBox', array('stb_title' => $post->post_title, 'stb_content' => $post->post_content));
    $columns[] = ZNPB()->add_module_to_layout('ZnColumn', array(), array($textbox), 'col-sm-9');
    // If the sidebar was saved as right sidebar
    if ($sidebar_pos == 'right_sidebar') {
        $columns[] = $sidebar_column;
    }
    $sections[] = ZNPB()->add_module_to_layout('ZnSection', array(), $columns, 'col-sm-12');
    return $sections;
}
Example #3
0
        echo '</a>';
        echo '</div>';
        echo '<div id="acc' . $uniq . '' . $acc_id . '" class="acc-panel-collapse collapse ' . $colapsed . '">';
        echo '<div class="acc-content row zn_columns_container zn_content" data-droplevel="1">';
        // Convert the old content to PB elements
        if (empty($this->data['content'][$i]) && !empty($acc['acc_single_desc'])) {
            $textbox = ZNPB()->add_module_to_layout('TH_TextBox', array('stb_content' => $acc['acc_single_desc']));
            $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array($textbox), 'col-sm-12');
            $this->data['content'][$i] = array($column);
        }
        if (empty($this->data['content'][$i])) {
            $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array(), 'col-sm-12');
            $this->data['content'][$i] = array($column);
        }
        if (!empty($this->data['content'][$i])) {
            ZNPB()->zn_render_content($this->data['content'][$i]);
        }
        echo '</div>';
        // acc-content
        echo '</div>';
        // end .acc-panel-collapse
        echo '</div>';
        // end .acc-group
        $acc_id++;
        $i++;
    }
}
echo '</div>';
//.panel-group
?>
</div>
 /**
  * This method is used to display the output of the element.
  *
  * @return void
  */
 function element()
 {
     $options = $this->data['options'];
     if (empty($options['single_horizontal_tab'])) {
         return;
     }
     $icon = '';
     $elm_classes = array();
     $elm_classes[] = $uid = $this->data['uid'];
     $elm_classes[] = $this->opt('css_class', '');
     $color_scheme = $this->opt('element_scheme', '') == '' ? zget_option('zn_main_style', 'color_options', false, 'light') : $this->opt('element_scheme', '');
     $elm_classes[] = 'tabs--' . $color_scheme;
     $elm_classes[] = 'element-scheme--' . $color_scheme;
     $single_tabs = $this->opt('single_horizontal_tab');
     $tabsListCount = count($single_tabs);
     $elm_classes[] = $this->opt('vts_tab_style', 'tabs_style1');
     $pb_tab = 0;
     echo '<div class="tabbable ' . implode(' ', $elm_classes) . '">';
     if (!empty($single_tabs) && is_array($single_tabs)) {
         echo '<ul class="nav nav-alignment--' . $this->opt('tabs_alignment', 'left') . ' clearfix" role="tablist">';
         // foreach ( $single_tabs as $tab )
         for ($i = 0; $i < $tabsListCount; $i++) {
             $cls = '';
             if ($i === 0) {
                 $cls = 'active in';
             }
             // ICON CHECK
             if (!empty($single_tabs[$i]['vts_tab_icon'])) {
                 $iconHolder = $single_tabs[$i]['vts_tab_icon'];
                 $icon = !empty($iconHolder['family']) ? '<span class="hr-tabs-nav-icon " ' . zn_generate_icon($single_tabs[$i]['vts_tab_icon']) . '></span>' : '';
             }
             $uniq_name = $uid . '_' . $i;
             // Tab Handle
             echo '<li class="' . $cls . '">';
             echo '<a href="#' . $uniq_name . '" role="tab" data-toggle="tab">';
             echo $icon;
             echo '<span>' . $single_tabs[$i]['vts_tab_title'] . '</span>';
             echo '</a>';
             echo '</li>';
             // $i++;
         }
         echo '</ul>';
         echo '<div class="tab-content">';
         // foreach ( $single_tabs as $tab )
         for ($i = 0; $i < $tabsListCount; $i++) {
             $cls = $content = '';
             if ($i === 0) {
                 $cls = 'active in';
             }
             $uniq_name = $uid . '_' . $i;
             // TAB CONTENT
             echo '<div class="tab-pane ' . $cls . '" id="' . $uniq_name . '">';
             // Convert the old content to PB elements
             if (empty($this->data['content'][$i]) && (!empty($single_tabs[$i]['vts_tab_c_title']) || !empty($single_tabs[$i]['vts_tab_c_content']))) {
                 $textbox = ZNPB()->add_module_to_layout('TH_TextBox', array('stb_title' => $single_tabs[$i]['vts_tab_c_title'], 'stb_content' => $single_tabs[$i]['vts_tab_c_content']));
                 $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array($textbox), 'col-sm-12');
                 $this->data['content'][$i] = array($column);
             }
             // Add complex page builder element
             echo '<div class="row tabPaneContainer zn_columns_container zn_content" data-droplevel="1">';
             if (empty($this->data['content'][$i])) {
                 $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array(), 'col-sm-12');
                 $this->data['content'][$i] = array($column);
             }
             if (!empty($this->data['content'][$i])) {
                 // print_z($this);
                 ZNPB()->zn_render_content($this->data['content'][$i]);
             }
             echo '   </div>';
             echo '</div>';
         }
         echo '</div>';
     }
     echo '</div>';
 }
function znpb_woo_add_kallyas_template($current_layout, $post, $post_id)
{
    if (is_shop()) {
        global $zn_config;
        $current_layout = $columns = array();
        // Get sidebars set in page options
        $sidebar_pos = get_post_meta($post_id, 'zn_page_layout', true);
        $sidebar_to_use = get_post_meta($post_id, 'zn_sidebar_select', true);
        $subheader_style = get_post_meta($post_id, 'zn_subheader_style', true);
        // Get sidebar set in theme options
        $sidebar_saved_data = zget_option('woo_archive_sidebar', 'unlimited_sidebars', false, array('layout' => 'right_sidebar', 'sidebar' => 'defaultsidebar'));
        if ($sidebar_pos == 'default' || empty($sidebar_pos)) {
            $sidebar_pos = $sidebar_saved_data['layout'];
        }
        if ($sidebar_to_use == 'default' || empty($sidebar_to_use)) {
            $sidebar_to_use = $sidebar_saved_data['sidebar'];
        }
        // We will add the new elements here
        $sidebar = ZNPB()->add_module_to_layout('TH_Sidebar', array('sidebar_select' => $sidebar_to_use));
        $sidebar_column = ZNPB()->add_module_to_layout('ZnColumn', array(), array($sidebar), 'col-sm-3');
        $current_layout[] = ZNPB()->add_module_to_layout('TH_CustomSubHeaderLayout', array('hm_header_style' => $subheader_style));
        // If the sidebar was saved as left sidebar
        if ($sidebar_pos == 'left_sidebar') {
            $columns[] = $sidebar_column;
        }
        // Add the main shop content
        $archive_columns = $sidebar_pos == 'no_sidebar' ? 4 : 3;
        $shop_archive = ZNPB()->add_module_to_layout('TH_ProductArchive', array('num_columns' => $archive_columns));
        $columns[] = ZNPB()->add_module_to_layout('ZnColumn', array(), array($shop_archive), 'col-sm-9');
        // If the sidebar was saved as right sidebar
        if ($sidebar_pos == 'right_sidebar') {
            $columns[] = $sidebar_column;
        }
        $current_layout[] = ZNPB()->add_module_to_layout('ZnSection', array(), $columns, 'col-sm-12');
        return $current_layout;
    }
    return $current_layout;
}
Example #6
0
 /**
  * This method is used to display the output of the element.
  * @return void
  */
 function element()
 {
     $options = $this->data['options'];
     $elm_classes = array();
     $elm_classes[] = $uid = $this->data['uid'];
     $elm_classes[] = $this->opt('css_class', '');
     $color_scheme = $this->opt('element_scheme', '') == '' ? zget_option('zn_main_style', 'color_options', false, 'light') : $this->opt('element_scheme', '');
     $elm_classes[] = 'verttabs--' . $color_scheme;
     $elm_classes[] = 'element-scheme--' . $color_scheme;
     $elm_classes[] = $vt_style = $this->opt('vtabs_style', 'kl-style-2');
     $elm_classes[] = 'vr-tabs-' . $vt_style;
     $single_tabs = $this->opt('single_vertical_tab', array());
     $tabsListCount = count($single_tabs);
     if (empty($single_tabs)) {
         return;
     }
     // Begin render
     echo '<div class="vertical_tabs vr-tabs ' . implode(' ', $elm_classes) . ' clearfix">';
     echo '<div class="tabbable vr-tabs-tbb">';
     echo '<ul class=" vr-tabs-nav fixclear">';
     $content = '';
     for ($i = 0; $i < $tabsListCount; $i++) {
         $cls = '';
         $icon = '';
         if ($i == 0) {
             $cls = 'active';
         }
         $uniq_name = $uid . '_' . $i;
         // ICON CHECK
         if (!empty($single_tabs[$i]['vts_tab_icon'])) {
             $iconHolder = $single_tabs[$i]['vts_tab_icon'];
             $icon = !empty($iconHolder['family']) ? '<span class="vr-tabs-nav-icon " ' . zn_generate_icon($single_tabs[$i]['vts_tab_icon']) . '></span>' : '';
         }
         // Tab Handle
         echo '<li class="vr-tabs-nav-item ' . ($vt_style == 'kl-style-1' ? 'text-custom-parent-act' : '') . ' ' . $cls . '">';
         echo '<a class="vr-tabs-nav-link text-custom-active text-custom-hover " href="#tabs_v2-pane' . $uniq_name . '" data-toggle="tab">';
         echo $icon;
         echo $single_tabs[$i]['vts_tab_title'];
         echo '</a>';
         echo '</li>';
     }
     echo '</ul>';
     echo '<div class="tab-content vr-tabs-content">';
     // foreach ( $single_tabs as $tab )
     for ($i = 0; $i < $tabsListCount; $i++) {
         $cls = $content = '';
         $uniq_name = $uid . '_' . $i;
         if ($i === 0) {
             $cls = 'active';
         }
         // Convert the old content to PB elements
         if (empty($this->data['content'][$i]) && (!empty($single_tabs[$i]['vts_tab_c_title']) || !empty($single_tabs[$i]['vts_tab_c_content']))) {
             $textbox = ZNPB()->add_module_to_layout('TH_TextBox', array('stb_title' => $single_tabs[$i]['vts_tab_c_title'], 'stb_content' => $single_tabs[$i]['vts_tab_c_content'], 'stb_title_heading' => 'h4'));
             $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array($textbox), 'col-sm-12');
             $this->data['content'][$i] = array($column);
         }
         echo '<div class="tab-pane vr-tabs-tabpane fade in ' . $cls . ' row zn_columns_container zn_content" data-droplevel="1" id="tabs_v2-pane' . $uniq_name . '">';
         if (empty($this->data['content'][$i])) {
             $column = ZNPB()->add_module_to_layout('ZnColumn', array(), array(), 'col-sm-12');
             $this->data['content'][$i] = array($column);
         }
         if (!empty($this->data['content'][$i])) {
             ZNPB()->zn_render_content($this->data['content'][$i]);
         }
         echo '</div>';
     }
     echo '</div>';
     echo '</div>';
     echo '</div>';
 }
Example #7
0
<?php

/**
 * Displays the main header
*/
global $post;
if (!isset($post) || empty($post)) {
    $pid = get_option('page_for_posts');
    $post = get_post($pid);
}
$style = "";
$show_header = true;
if (is_singular() && get_post_meta(get_the_ID(), 'show_header', true) === 'zn_dummy_value') {
    $show_header = false;
    if (ZNPB()->is_active_editor) {
        $show_header = true;
        $style = ' style="display:none" ';
    }
}
// Bail early if we don't have to show the header
if (!$show_header) {
    return;
}
$header_class = array();
/*
 * Header Layout
 */
$header_class[] = $headerLayoutStyle = zget_option('zn_header_layout', 'general_options', false, 'style2');
// Get classic headers
if (in_array($headerLayoutStyle, array('style1', 'style2', 'style3', 'style4', 'style5', 'style6'))) {
    $header_class[] = 'siteheader-classic';