<?php
/**
 * @package     productive-commerce
 * @author      productiveminds.com
 * @copyright   productiveminds.com
*/

if ( !defined('ABSPATH') ) {
    die();
}

function productive_commerce_render_header_buttons( $cpt_section_args ) {
    
    $section_content_settings_unique_id = 'section_content_unique_id_'. wp_rand();
    $section_initiator = 'std';
    $section_content_header_is_show_section_header = 1;
    $section_title = esc_html__('Commerce Buttons', 'productive-commerce');
    $section_title_html_tag = 'h2';
    $section_intro = esc_html__('Leave heading fields empty to hide the heading.', 'productive-commerce');
    $section_header_alignment = '';
    
    if ( isset( $cpt_section_args['section_content_settings_unique_id'] ) ) {
        $section_content_settings_unique_id = $cpt_section_args['section_content_settings_unique_id'];
    }
    if ( isset( $cpt_section_args['section_initiator'] ) ) {
        $section_initiator = $cpt_section_args['section_initiator'];
    }
    if ( isset( $cpt_section_args['section_content_header_is_show_section_header'] ) ) {
        $section_content_header_is_show_section_header = $cpt_section_args['section_content_header_is_show_section_header'];
    }
    if ( isset( $cpt_section_args['section_title'] ) ) {
        $section_title = $cpt_section_args['section_title'];
    }
    if ( isset( $cpt_section_args['section_title_html_tag'] ) ) {
        $section_title_html_tag = $cpt_section_args['section_title_html_tag'];
    }
    if ( isset( $cpt_section_args['section_intro'] ) ) {
        $section_intro = $cpt_section_args['section_intro'];
    }
    if ( isset( $cpt_section_args['section_header_alignment'] ) ) {
        $section_header_alignment = $cpt_section_args['section_header_alignment'];
    }
    
    $productiveminds_section_display = 'grided';
    
    ?>
    <div class="productiveminds_section header-buttons <?php echo esc_attr( $productiveminds_section_display ); ?> <?php echo esc_attr( $section_initiator ); ?>" id="<?php echo esc_attr( $section_content_settings_unique_id ); ?>">
        <div class="productiveminds_section_uno generic-box-type parent">
    <?php
    
        if ( $section_content_header_is_show_section_header ) {
            productive_commerce_render_header_v_1( $section_title, $section_title_html_tag, $section_intro, $section_header_alignment );
        }
        
        $section_content_layout_format = 'list';
        $section_content_items_separator = '';
        $section_content_items = array();
        if ( isset( $cpt_section_args['section_content_layout_format'] ) ) {
            $section_content_layout_format = $cpt_section_args['section_content_layout_format'];
        }
        if ( isset( $cpt_section_args['section_content_items_separator'] ) ) {
            $section_content_items_separator = $cpt_section_args['section_content_items_separator'];
        }
        if ( isset( $cpt_section_args['section_content_items'] ) ) {
            $section_content_items = $cpt_section_args['section_content_items'];
        }
        
        $misc = array(
            'section_content_layout_format'                             => $section_content_layout_format,
            'section_content_items_separator'                           => $section_content_items_separator,
            'section_content_items'                                     => $section_content_items,
        );
        
        productive_commerce_render_header_buttons_v_1( $misc );
        
    ?>
        </div><!-- productiveminds_section_uno -->
    </div><!-- productiveminds_section -->
    <?php
}
