<?php
// don't load directly
if ( ! defined( 'ABSPATH' ) ) {
    die( '-1' );
}

?>
<?php
// filter plus products
if(!class_exists("nfpfilter_vc_toggle_sidebar")) {
    class nfpfilter_vc_toggle_sidebar
    {
        function __construct()
        {
            add_action('init', array($this, "nfpfilter_toggle_sidebar_func"));
        }
        function nfpfilter_toggle_sidebar_func() {

            global $wp_registered_sidebars;
            $curr_sidebar = array(esc_html__( 'Select sidebar', "nfpfilter" ));
            if(is_array($wp_registered_sidebars)){
                foreach($wp_registered_sidebars as $wp_registered_sidebar){
                    $curr_sidebar[$wp_registered_sidebar['name']] = $wp_registered_sidebar['id'];
                }
            }


            vc_map( array(
                "name" => esc_html__( "Filter Plus Toggle Sidebar", "nfpfilter" ),
                "base" => "nfpfilter_toggle_sidebar",
                "icon" => "nfpfilter-vc-icon",
                "params" => array(
                    array(
                        'type' => 'dropdown',
                        'heading' => esc_html__( 'Select Sidebar', "nfpfilter" ),
                        'param_name' => 'sidebar_id',
                        'std' => '',
                        "value" => $curr_sidebar,
                        'admin_label' => true,

                    ),
                    array(
                        'type' => 'dropdown',
                        'heading' => esc_html__( 'Columns Per Row', "nfpfilter" ),
                        'param_name' => 'sidebar_style',
                        'std' => 'widget_and_button',
                        'value' => array(
                            esc_html__( 'Widget and Toggle Button', "nfpfilter" ) => 'widget_and_button',
                            esc_html__( 'Hidden Widget and Toggle Button', "nfpfilter" ) => 'hidden_widget_and_button',
                            esc_html__( 'Widget Only', "nfpfilter" ) => 'widget_only',
                            esc_html__( 'Absolute Widget And Button', "nfpfilter" ) => 'absolute_widget_and_button',
                        ),
                        "admin_label" => true,
                    ),
                    array(
                        'type' => 'dropdown',
                        'heading' => esc_html__( 'Button Float', "nfpfilter" ),
                        'param_name' => 'button_float',
                        'std' => 'right',
                        'value' => array(
                            esc_html__( 'Left', "nfpfilter" ) => 'left',
                            esc_html__( 'Right', "nfpfilter" ) => 'right',
                        ),
                        "admin_label" => true,
                    ),
                )
            ) );
        }
    }
    new nfpfilter_vc_toggle_sidebar;
}
