<?php
/**
* Widget Functions.
*
* @package Solar Energy Engine
*/

function solar_energy_engine_widgets_init(){

	register_sidebar(array(
	    'name' => esc_html__('Main Sidebar', 'solar-energy-engine'),
	    'id' => 'sidebar-1',
	    'description' => esc_html__('Add widgets here.', 'solar-energy-engine'),
	    'before_widget' => '<div id="%1$s" class="widget %2$s">',
	    'after_widget' => '</div>',
	    'before_title' => '<h3 class="widget-title"><span>',
	    'after_title' => '</span></h3>',
	));


    $solar_energy_engine_default = solar_energy_engine_get_default_theme_options();
    $solar_energy_engine_solar_energy_engine_footer_column_layout = absint( get_theme_mod( 'solar_energy_engine_footer_column_layout',$solar_energy_engine_default['solar_energy_engine_footer_column_layout'] ) );

    for( $solar_energy_engine_i = 0; $solar_energy_engine_i < $solar_energy_engine_solar_energy_engine_footer_column_layout; $solar_energy_engine_i++ ){
    	
    	if( $solar_energy_engine_i == 0 ){ $solar_energy_engine_count = esc_html__('One','solar-energy-engine'); }
    	if( $solar_energy_engine_i == 1 ){ $solar_energy_engine_count = esc_html__('Two','solar-energy-engine'); }
    	if( $solar_energy_engine_i == 2 ){ $solar_energy_engine_count = esc_html__('Three','solar-energy-engine'); }

	    register_sidebar( array(
	        'name' => esc_html__('Footer Widget ', 'solar-energy-engine').$solar_energy_engine_count,
	        'id' => 'solar-energy-engine-footer-widget-'.$solar_energy_engine_i,
	        'description' => esc_html__('Add widgets here.', 'solar-energy-engine'),
	        'before_widget' => '<div id="%1$s" class="widget %2$s">',
	        'after_widget' => '</div>',
	        'before_title' => '<h2 class="widget-title">',
	        'after_title' => '</h2>',
	    ));
	}

}

add_action('widgets_init', 'solar_energy_engine_widgets_init');