<?php
if ( ot_get_option( 'enable_header_full_width_sidebar', 'off' ) == 'on' ) {
	$full_width_sidebar = leap_override_widget_position( 'header_full_width_sidebar', 'leap_header_full_width_sidebar' );
	if ( $full_width_sidebar != 'none' ) {

		$full_width_sidebar	 = explode( '-', $full_width_sidebar );
		$col_count			 = count( $full_width_sidebar );

		$active_sidebar = array();
		for ( $i = 1; $i <= $col_count; $i++ ) {
			$replacement_sidebar = leap_get_replacement_sidebar( 'header-full-width' . $i );
			$active_sidebar[]	 = is_active_sidebar( $replacement_sidebar );
			unset( $replacement_sidebar );
		}

		if ( in_array( 1, $active_sidebar ) ) {
			$sidebar_id			 = leap_get_current_sidebar_style();
			$headerful_parallax	 = leap_get_sidebar_option_with_default( 'leap_headerfull_sidebar_parallax_background_image', $sidebar_id );
			?>
			<div id="header-full-width-sidebar" <?php echo ($headerful_parallax == 'on' ? 'class="leap-parallax"' : '') ?>>
				<div class="<?php echo apply_filters( 'leap_container_class', 'container-fluid' ); ?>">
					<div class="row">
						<?php
						for ( $i = 1; $i <= $col_count; $i++ ) {
							echo '<div class="' . leap_bws_col_class( $full_width_sidebar[ $i - 1 ] ) . '" >';
							leap_dynamic_sidebar( 'header-full-width' . $i );
							echo '</div>';
						}
						?>
					</div>
				</div>
			</div>
			<?php
		}
	}
}