Current File : /home/mdkeenpw/www/wp-content/themes/globallogistics/skins/default/templates/footer-widgets.php
<?php
/**
 * The template to display the widgets area in the footer
 *
 * @package GLOBALLOGISTICS
 * @since GLOBALLOGISTICS 1.0.10
 */

// Footer sidebar
$globallogistics_footer_name    = globallogistics_get_theme_option( 'footer_widgets' );
$globallogistics_footer_present = ! globallogistics_is_off( $globallogistics_footer_name ) && is_active_sidebar( $globallogistics_footer_name );
if ( $globallogistics_footer_present ) {
	globallogistics_storage_set( 'current_sidebar', 'footer' );
	$globallogistics_footer_wide = globallogistics_get_theme_option( 'footer_wide' );
	ob_start();
	if ( is_active_sidebar( $globallogistics_footer_name ) ) {
		dynamic_sidebar( $globallogistics_footer_name );
	}
	$globallogistics_out = trim( ob_get_contents() );
	ob_end_clean();
	if ( ! empty( $globallogistics_out ) ) {
		$globallogistics_out          = preg_replace( "/<\\/aside>[\r\n\s]*<aside/", '</aside><aside', $globallogistics_out );
		$globallogistics_need_columns = true;   //or check: strpos($globallogistics_out, 'columns_wrap')===false;
		if ( $globallogistics_need_columns ) {
			$globallogistics_columns = max( 0, (int) globallogistics_get_theme_option( 'footer_columns' ) );			
			if ( 0 == $globallogistics_columns ) {
				$globallogistics_columns = min( 4, max( 1, globallogistics_tags_count( $globallogistics_out, 'aside' ) ) );
			}
			if ( $globallogistics_columns > 1 ) {
				$globallogistics_out = preg_replace( '/<aside([^>]*)class="widget/', '<aside$1class="column-1_' . esc_attr( $globallogistics_columns ) . ' widget', $globallogistics_out );
			} else {
				$globallogistics_need_columns = false;
			}
		}
		?>
		<div class="footer_widgets_wrap widget_area<?php echo ! empty( $globallogistics_footer_wide ) ? ' footer_fullwidth' : ''; ?> sc_layouts_row sc_layouts_row_type_normal">
			<?php do_action( 'globallogistics_action_before_sidebar_wrap', 'footer' ); ?>
			<div class="footer_widgets_inner widget_area_inner">
				<?php
				if ( ! $globallogistics_footer_wide ) {
					?>
					<div class="content_wrap">
					<?php
				}
				if ( $globallogistics_need_columns ) {
					?>
					<div class="columns_wrap">
					<?php
				}
				do_action( 'globallogistics_action_before_sidebar', 'footer' );
				globallogistics_show_layout( $globallogistics_out );
				do_action( 'globallogistics_action_after_sidebar', 'footer' );
				if ( $globallogistics_need_columns ) {
					?>
					</div><!-- /.columns_wrap -->
					<?php
				}
				if ( ! $globallogistics_footer_wide ) {
					?>
					</div><!-- /.content_wrap -->
					<?php
				}
				?>
			</div><!-- /.footer_widgets_inner -->
			<?php do_action( 'globallogistics_action_after_sidebar_wrap', 'footer' ); ?>
		</div><!-- /.footer_widgets_wrap -->
		<?php
	}
}