50)); if(!empty($sliders)) { foreach($sliders as $key => $item){ $layerslider[ $item['id'] ] = $item['name']; } } } return $layerslider; } // ----------------------------------------- // Revolution Sliders // ----------------------------------------- function dtm_framework_revolutionsliders() { $revolutionslider = array( '' => esc_html__('Select a slider','alagu') ); if( alagu_plugin_is_active('revslider/revslider.php') ) { $sld = new RevSlider(); $sliders = $sld->getArrSliders(); if(!empty($sliders)){ foreach($sliders as $key => $item) { $revolutionslider[$item->getAlias()] = $item->getTitle(); } } } return $revolutionslider; } // ----------------------------------------- // Meta Layout Section // ----------------------------------------- $cart_page_id = get_option('woocommerce_cart_page_id'); $checkout_page_id = get_option('woocommerce_checkout_page_id'); $myaccount_page_id = get_option('woocommerce_myaccount_page_id'); $wishlist_page_id = get_option( 'yith_wcwl_wishlist_page_id' ); if( isset( $_GET['post'] ) && ( $_GET['post'] == $cart_page_id || $_GET['post'] == $checkout_page_id || $_GET['post'] == $myaccount_page_id || $_GET['post'] == $wishlist_page_id ) ) { $page_layout_options = array( 'global-site-layout' => DTM_URL . 'images/admin-option.png', 'content-full-width' => DTM_URL . 'images/without-sidebar.png', 'with-left-sidebar' => DTM_URL . 'images/left-sidebar.png', 'with-right-sidebar' => DTM_URL . 'images/right-sidebar.png', ); } else { $page_layout_options = array( 'global-site-layout' => DTM_URL . 'images/admin-option.png', 'content-full-width' => DTM_URL . 'images/without-sidebar.png', 'with-left-sidebar' => DTM_URL . 'images/left-sidebar.png', 'with-right-sidebar' => DTM_URL . 'images/right-sidebar.png', 'with-both-sidebar' => DTM_URL . 'images/both-sidebar.png', ); } $meta_layout_section =array( 'name' => 'layout_section', 'title' => esc_html__('Layout', 'alagu'), 'icon' => 'fa fa-columns', 'fields' => array( array( 'id' => 'layout', 'type' => 'image_select', 'title' => esc_html__('Page Layout', 'alagu' ), 'options' => $page_layout_options, 'default' => 'global-site-layout', 'attributes' => array( 'data-depend-id' => 'page-layout' ) ), array( 'id' => 'show-standard-sidebar-left', 'type' => 'switcher', 'title' => esc_html__('Show Standard Left Sidebar', 'alagu' ), 'dependency'=> array( 'page-layout', 'any', 'with-left-sidebar,with-both-sidebar' ), 'default' => true, ), array( 'id' => 'widget-area-left', 'type' => 'select', 'title' => esc_html__('Choose Left Widget Areas', 'alagu' ), 'class' => 'chosen', 'options' => alagu_customizer_custom_widgets(), 'info' => esc_html__('You can choose custom widget areas in premium version only.','alagu'), 'attributes' => array( 'multiple' => 'multiple', 'data-placeholder' => esc_html__('Select Left Widget Areas','alagu'), 'style' => 'width: 400px;' ), 'dependency' => array( 'page-layout', 'any', 'with-left-sidebar,with-both-sidebar' ), ), array( 'id' => 'show-standard-sidebar-right', 'type' => 'switcher', 'title' => esc_html__('Show Standard Right Sidebar', 'alagu' ), 'dependency' => array( 'page-layout', 'any', 'with-right-sidebar,with-both-sidebar' ), 'default' => true, ), array( 'id' => 'widget-area-right', 'type' => 'select', 'title' => esc_html__('Choose Right Widget Areas', 'alagu' ), 'class' => 'chosen', 'options' => alagu_customizer_custom_widgets(), 'info' => esc_html__('You can choose custom widget areas in premium version only.','alagu'), 'dependency' => array( 'page-layout', 'any', 'with-right-sidebar,with-both-sidebar' ), 'attributes' => array( 'multiple' => 'multiple', 'data-placeholder' => esc_html__('Select Right Widget Areas','alagu'), 'style' => 'width: 400px;' ), ) ) ); // ----------------------------------------- // Meta Breadcrumb Section // ----------------------------------------- $meta_breadcrumb_section = array( 'name' => 'breadcrumb_section', 'title' => esc_html__('Breadcrumb', 'alagu'), 'icon' => 'fa fa-sitemap', 'fields' => array( array( 'id' => 'breadcrumb-option', 'type' => 'image_select', 'title' => esc_html__('Breadcrumb Option', 'alagu' ), 'options' => array( 'global-option' => DTM_URL . 'images/admin-option.png', 'individual-option' => DTM_URL . 'images/individual-option.png', ), 'default' => 'global-option', 'attributes' => array( 'data-depend-id' => 'breadcrumb-option' ) ), array( 'id' => 'enable-sub-title', 'type' => 'switcher', 'title' => esc_html__('Show Breadcrumb', 'alagu' ), 'default' => true, 'dependency' => array( 'breadcrumb-option', 'any', 'individual-option' ), ), array( 'id' => 'breadcrumb_position', 'type' => 'select', 'title' => esc_html__('Position', 'alagu' ), 'options' => array( 'header-top-absolute' => esc_html__('Behind the Header','alagu'), 'header-top-relative' => esc_html__('Default','alagu'), ), 'default' => 'header-top-relative', 'dependency' => array( 'enable-sub-title|breadcrumb-option', '==|any', 'true|individual-option' ), ), array( 'id' => 'breadcrumb_background', 'type' => 'background', 'title' => esc_html__('Background', 'alagu' ), 'dependency' => array( 'enable-sub-title|breadcrumb-option', '==|any', 'true|individual-option' ), ) ) ); // ----------------------------------------- // Meta Slider Section // ----------------------------------------- $meta_slider_section = array( 'name' => 'slider_section', 'title' => esc_html__('Slider', 'alagu'), 'icon' => 'fa fa-slideshare', 'fields' => array( array( 'id' => 'slider-notice', 'type' => 'notice', 'class' => 'danger', 'content' => esc_html__('Slider tab works only if breadcrumb disabled.','alagu'), 'class' => 'margin-30 cs-danger' ), array( 'id' => 'show_slider', 'type' => 'switcher', 'title' => esc_html__('Show Slider', 'alagu' ), //'dependency' => array( 'enable-sub-title', '==', 'false' ), ), array( 'id' => 'slider_position', 'type' => 'select', 'title' => esc_html__('Position', 'alagu' ), 'options' => array( 'header-top-relative' => esc_html__('Top Header Relative','alagu'), 'header-top-absolute' => esc_html__('Top Header Absolute','alagu'), 'bottom-header' => esc_html__('Bottom Header','alagu'), ), 'default' => 'bottom-header', //'dependency' => array( 'enable-sub-title|show_slider', '==|==', 'false|true' ), 'dependency' => array( 'show_slider', '==', 'true' ), ), array( 'id' => 'slider_type', 'type' => 'select', 'title' => esc_html__('Slider', 'alagu' ), 'options' => array( '' => esc_html__('Select a slider','alagu'), 'layerslider' => esc_html__('Layer slider','alagu'), 'revolutionslider' => esc_html__('Revolution slider','alagu'), 'customslider' => esc_html__('Custom Slider Shortcode','alagu'), ), 'validate' => 'required', //'dependency' => array( 'enable-sub-title|show_slider', '==|==', 'false|true' ), 'dependency' => array( 'show_slider', '==', 'true' ), ), array( 'id' => 'layerslider_id', 'type' => 'select', 'title' => esc_html__('Layer Slider', 'alagu' ), 'options' => dtm_framework_layersliders(), 'validate' => 'required', //'dependency' => array( 'enable-sub-title|show_slider|slider_type', '==|==|==', 'false|true|layerslider' ) 'dependency' => array( 'show_slider|slider_type', '==|==', 'true|layerslider' ), ), array( 'id' => 'revolutionslider_id', 'type' => 'select', 'title' => esc_html__('Revolution Slider', 'alagu' ), 'options' => dtm_framework_revolutionsliders(), 'validate' => 'required', //'dependency' => array( 'enable-sub-title|show_slider|slider_type', '==|==|==', 'false|true|revolutionslider' ) 'dependency' => array( 'show_slider|slider_type', '==|==', 'true|revolutionslider' ), ), array( 'id' => 'customslider_sc', 'type' => 'textarea', 'title' => esc_html__('Custom Slider Code', 'alagu' ), 'validate' => 'required', //'dependency' => array( 'enable-sub-title|show_slider|slider_type', '==|==|==', 'false|true|customslider' ) 'dependency' => array( 'show_slider|slider_type', '==|==', 'true|customslider' ), ), ) ); // =============================================================================================== // ----------------------------------------------------------------------------------------------- // METABOX OPTIONS // ----------------------------------------------------------------------------------------------- // =============================================================================================== $options = array(); // ----------------------------------------- // Page Metabox Options - // ----------------------------------------- array_push( $meta_layout_section['fields'], array( 'id' => 'enable-sticky-sidebar', 'type' => 'switcher', 'title' => esc_html__('Enable Sticky Sidebar', 'alagu' ), 'dependency' => array( 'page-layout', 'any', 'with-left-sidebar,with-right-sidebar,with-both-sidebar' ) ) ); $page_settings = array( $meta_layout_section, $meta_breadcrumb_section, $meta_slider_section, array( 'name' => 'sidenav_template_section', 'title' => esc_html__('Side Navigation Template', 'alagu'), 'icon' => 'fa fa-th-list', 'fields' => array( array( 'id' => 'sidenav-tpl-notice', 'type' => 'notice', 'class' => 'success', 'content' => esc_html__('Side Navigation Tab Works only if page template set to Side Navigation Template in Page Attributes','alagu'), 'class' => 'margin-30 cs-success', ), array( 'id' => 'sidenav-style', 'type' => 'select', 'title' => esc_html__('Side Navigation Style', 'alagu' ), 'options' => array( 'type1' => esc_html__('Type1','alagu'), 'type2' => esc_html__('Type2','alagu'), 'type3' => esc_html__('Type3','alagu'), 'type4' => esc_html__('Type4','alagu'), 'type5' => esc_html__('Type5','alagu') ), ), array( 'id' => 'sidenav-align', 'type' => 'switcher', 'title' => esc_html__('Align Right', 'alagu' ), 'info' => esc_html__('YES! to align right of side navigation.','alagu') ), array( 'id' => 'sidenav-sticky', 'type' => 'switcher', 'title' => esc_html__('Sticky Side Navigation', 'alagu' ), 'info' => esc_html__('YES! to sticky side navigation content.','alagu') ), array( 'id' => 'enable-sidenav-content', 'type' => 'switcher', 'title' => esc_html__('Show Content', 'alagu' ), 'info' => esc_html__('YES! to show content in below side navigation.','alagu') ), array( 'id' => 'sidenav-content', 'type' => 'textarea', 'title' => esc_html__('Side Navigation Content', 'alagu' ), 'info' => esc_html__('Paste any shortcode content here','alagu'), 'attributes' => array( 'rows' => 6 ), ), ) ), ); $shop_page_id = get_option('woocommerce_shop_page_id'); if( isset( $_GET['post'] ) && ( $_GET['post'] != $shop_page_id ) || !isset( $_GET['post'] ) ) { $options[] = array( 'id' => '_tpl_default_settings', 'title' => esc_html__('Page Settings','alagu'), 'post_type' => 'page', 'context' => 'normal', 'priority' => 'high', 'sections' => $page_settings ); } // ----------------------------------------- // Post Metabox Options - // ----------------------------------------- $post_meta_layout_section = $meta_layout_section; $fields = $post_meta_layout_section['fields']; $fields[0]['title'] = esc_html__('Post Layout', 'alagu' ); #unset( $fields[0]['options']['with-both-sidebar'] ); #unset( $fields[0]['info'] ); #unset( $fields[0]['options']['fullwidth'] ); unset( $fields[5] ); unset( $post_meta_layout_section['fields'] ); $post_meta_layout_section['fields'] = $fields; $post_format_section = array( 'name' => 'post_format_data_section', 'title' => esc_html__('Post Format', 'alagu'), 'icon' => 'fa fa-cog', 'fields' => array( array( 'id' => 'single-post-style', 'type' => 'select', 'title' => esc_html__('Post Style', 'alagu'), 'options' => array( 'breadcrumb-fixed' => esc_html__('Breadcrumb Fixed', 'alagu'), 'breadcrumb-parallax' => esc_html__('Breadcrumb Parallax', 'alagu'), 'overlay' => esc_html__('Overlay', 'alagu'), 'overlap' => esc_html__('Overlap', 'alagu'), 'custom' => esc_html__('Custom', 'alagu') ), 'class' => 'chosen', 'default' => 'overlay', 'info' => esc_html__('Choose post style to display single post. If post style is "Custom", display based on Editor content.', 'alagu') ), array( 'id' => 'single-custom-style', 'type' => 'select', 'title' => esc_html__('Custom Style', 'alagu'), 'options' => array( 'minimal' => esc_html__('Minimal', 'alagu'), 'classic' => esc_html__('Classic', 'alagu'), 'modern' => esc_html__('Modern', 'alagu'), ), 'class' => 'chosen', 'default' => 'minimal', 'info' => esc_html__('Select type of custom style.', 'alagu'), 'dependency' => array( 'single-post-style', '==', 'custom' ), ), array( 'id' => 'view_count', 'type' => 'number', 'title' => esc_html__('Views', 'alagu' ), 'info' => esc_html__('No.of views of this post.', 'alagu'), 'attributes' => array( 'style' => 'width: 15%;' ), ), array( 'id' => 'like_count', 'type' => 'number', 'title' => esc_html__('Likes', 'alagu' ), 'info' => esc_html__('No.of likes of this post.', 'alagu'), 'attributes' => array( 'style' => 'width: 15%;' ), ), array( 'id' => 'post-format-type', 'title' => esc_html__('Type', 'alagu' ), 'type' => 'select', 'default' => 'standard', 'options' => array( 'standard' => esc_html__('Standard', 'alagu'), 'status' => esc_html__('Status','alagu'), 'quote' => esc_html__('Quote','alagu'), 'gallery' => esc_html__('Gallery','alagu'), 'image' => esc_html__('Image','alagu'), 'video' => esc_html__('Video','alagu'), 'audio' => esc_html__('Audio','alagu'), 'link' => esc_html__('Link','alagu'), 'aside' => esc_html__('Aside','alagu'), 'chat' => esc_html__('Chat','alagu') ), 'info' => esc_html__('Post Format & Type should be Same. Check the Post Format from the "Format" Tab, which comes in the Right Side Section', 'alagu'), ), array( 'id' => 'post-gallery-items', 'type' => 'gallery', 'title' => esc_html__('Add Images', 'alagu' ), 'add_title' => esc_html__('Add Images', 'alagu' ), 'edit_title' => esc_html__('Edit Images', 'alagu' ), 'clear_title' => esc_html__('Remove Images', 'alagu' ), 'dependency' => array( 'post-format-type', '==', 'gallery' ), ), array( 'id' => 'media-type', 'type' => 'select', 'title' => esc_html__('Select Type', 'alagu' ), 'dependency' => array( 'post-format-type', 'any', 'video,audio' ), 'options' => array( 'oembed' => esc_html__('Oembed','alagu'), 'self' => esc_html__('Self Hosted','alagu'), ) ), array( 'id' => 'media-url', 'type' => 'textarea', 'title' => esc_html__('Media URL', 'alagu' ), 'dependency' => array( 'post-format-type', 'any', 'video,audio' ), ), ) ); $options[] = array( 'id' => '_dt_post_settings', 'title' => esc_html__('Post Settings','alagu'), 'post_type' => 'post', 'context' => 'normal', 'priority' => 'high', 'sections' => array( $post_meta_layout_section, $meta_breadcrumb_section, $post_format_section ) ); // ----------------------------------------- // Tribe Events Post Metabox Options // ----------------------------------------- array_push( $post_meta_layout_section['fields'], array( 'id' => 'event-post-style', 'title' => esc_html__('Post Style', 'alagu' ), 'type' => 'select', 'default' => 'type1', 'options' => array( 'type1' => esc_html__('Classic', 'alagu'), 'type2' => esc_html__('Full Width','alagu'), 'type3' => esc_html__('Minimal Tab','alagu'), 'type4' => esc_html__('Clean','alagu'), 'type5' => esc_html__('Modern','alagu'), ), 'class' => 'chosen', 'info' => esc_html__('Your event post page show at most selected style.', 'alagu') ) ); $options[] = array( 'id' => '_custom_settings', 'title' => esc_html__('Settings','alagu'), 'post_type' => 'tribe_events', 'context' => 'normal', 'priority' => 'high', 'sections' => array( $post_meta_layout_section, $meta_breadcrumb_section ) ); // ----------------------------------------- // Shop Single Product Options Metabox // ----------------------------------------- if( function_exists( 'is_woocommerce' ) ) { require_once ALAGU_THEME_DIR .'/inc/metabox/dtm-framework-override/config/shop-single-product.php'; $shop_single_product_options = alagu_shop_single_product(); $options = array_merge($shop_single_product_options, $options); } // ----------------------------------------- // Shop Product Template Options Metabox // ----------------------------------------- if( function_exists( 'is_woocommerce' ) ) { require_once ALAGU_THEME_DIR .'/inc/metabox/dtm-framework-override/config/shop-product-template.php'; $shop_product_template_options = alagu_shop_product_template(); $options = array_merge($shop_product_template_options, $options); } // ----------------------------------------- // Header And Footer Options Metabox // ----------------------------------------- require_once ALAGU_THEME_DIR .'/inc/metabox/dtm-framework-override/config/header-footer-cpt.php'; $header_footer_options = alagu_header_footer_default_cpt(); $options = array_merge($header_footer_options, $options); DTMFramework_Metabox::instance( $options );