<?php

$html = '';
foreach ($modules as $module) {
	$html .= $module;
}

?>
<?php if ($html != '') { ?>
<column id="column-left" class="col-xs-12 col-sm-3">
	<div class="row">
		<?php echo $html; ?>
	</div>
</column>

<script>
$(function(){
	var hiddenXS = 0;
	var hiddenSM = 0;
	var hiddenMD = 0;
	var hiddenLG = 0;

	var $column = $('#column-left');
	var $children = $column.find('.row').children();
	var childrenTotal = $children.length;

	$children.each(function(){
		var $this = $(this);
		if ($this.hasClass('hidden-xs')) { hiddenXS++; }
		if ($this.hasClass('hidden-sm')) { hiddenSM++; }
		if ($this.hasClass('hidden-md')) { hiddenMD++; }
		if ($this.hasClass('hidden-lg')) { hiddenLG++; }
	});

	if (hiddenXS == childrenTotal) { $column.addClass('hidden-xs'); }
	if (hiddenSM == childrenTotal) { $column.addClass('hidden-sm'); }
	if (hiddenMD == childrenTotal) { $column.addClass('hidden-md'); }
	if (hiddenLG == childrenTotal) { $column.addClass('hidden-lg'); }
});
</script>
<?php } ?>