<div class="container">
<?php
/*
 * \SentraDesigner\modules\cat.container\tcs\final.tpl
 */

/* Now we print the column contents */
$sideBar_required = {{SideRequired}};
$sideBar_active = {{SideActive}};

$SIDE = $SIDE_BAR;
if ($sideBar_required)
	$SIDE = true;
if (!$sideBar_active)
	$SIDE = false;

$topicBar_required = {{TopicRequired}};
$topicBar_active = {{TopicActive}};

$TOPIC = $TOPIC_BAR;
if ($topicBar_required)
	$TOPIC = true;
if (!$topicBar_active)
	$TOPIC = false;

SWITCH (GetColumnOrder()) {
	case 0:	// Template's Standard column mode
		If (!isset($colorder)) {
			$colorder = strtoupper('{{ColumnOrder}}');
		}
	break;

	case 1:	// TCS
		$colorder = 'TCS';
	break;

	case 2:	// CTS
		$colorder = 'CTS';
	break;

	case 3:	// TSC
		$colorder = 'TSC';
	break;
}

$localcolorder = $colorder;
$wb->colorder = $localcolorder;
unset($colorder);
if (!$TOPIC && !$SIDE){	// We have the contentbar only utilizing full page width
?>
		<div class="row cb">
			<div class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push">
			<a id="tcspage"> </a>
				<div class="CbC">
{{cc}}
				</div>	<!-- Close class="CbC" -->
			</div>		<!-- Close class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push" -->
		</div>		<!-- Close class="row cb" -->
<?php
} elseif ($TOPIC && !$SIDE) {
	/* We have the left topicbar + the contentbar which utilizes the width of the sidebar too */
	SWITCH (strtolower($localcolorder)) {
		default:
		case 'tcs':
			$classTC = 'tc';
			$IDTC = 'TC';
		break;

		case 'cts':
			$classTC = 'ct';
			$IDTC = 'CT';
		break;

		case 'tsc':
			$classTC = 'tc';
			$IDTC = 'TC';
		break;

	}
	echo '		<div id="'.$IDTC.'" class="row '.$classTC.'">';
?>
			<div class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push">
			<a id="tcspage"> </a>
				<div class="CbC">
{{cc}}
				</div>	<!-- Close class="CbC" -->
			</div>		<!-- Close class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push" -->
			<div class="topicbar T_md_Width T_sm_Width T_md_pull T_sm_pull">
				<div class="TbC">
{{tc}}
				</div>	<!-- Close  class="TbC" -->
			</div>		<!-- Close class="topicbar T_md_Width T_sm_Width T_md_pull T_sm_pull" -->
<?php
	echo '		</div> 	<!-- close id="'.$IDTC.'" class="row '.$classTC.'" -->';
} elseif (!$TOPIC && $SIDE){
	/* We have the right sidebar + the contentbar which utilizes the width of the topicbar too */
	SWITCH (strtolower($localcolorder)) {
		default:
		case 'tcs':
			$classCS = 'cs';
			$IDCS = 'CS';
		break;

		case 'cts':
			$classCS = 'cs';
			$IDCS = 'CS';
		break;

		case 'tsc':
			$classCS = 'sc';
			$IDCS = 'SC';
		break;
	}
	echo '		<div id="'.$IDCS.'" class="row '.$classCS.'">';
?>
			<div class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push">
			<a id="tcspage"> </a>
				<div class="CbC">
{{cc}}
				</div>	<!-- Close class="CbC" -->
			</div>		<!-- Close class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push" -->
			<div class="sidebar S_md_Width S_sm_Width S_md_pull">
				<div class="SbC">
{{sc}}
				</div> <!-- Close class="SbC" -->
			</div> <!-- Close class="sidebar S_md_Width S_sm_Width S_md_pull" -->
<?php
	echo '	</div>	<!-- close id="'.$IDCS.'" class="row '.$classCS.'" -->'.PHP_EOL;

} elseif ($TOPIC && $SIDE){
	/* Here we have three columns */
	$IDtcs = strtoupper($localcolorder);
	echo '		<div id="'.$IDtcs.'" class="row '.strtolower($localcolorder).'">'.PHP_EOL;

?>
			<div class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push">
			<a id="tcspage"> </a>
				<div class="CbC">
{{cc}}
				</div>	<!-- Close class="CbC" -->
			</div>		<!-- Close class="contentbar C_md_Width C_sm_Width C_md_push C_sm_push" -->
			<div class="topicbar T_md_Width T_sm_Width T_md_pull T_sm_pull">
				<div class="TbC">
{{tc}}
				</div>	<!-- Close  class="TbC" -->
			</div>		<!-- Close class="topicbar T_md_Width T_sm_Width T_md_pull T_sm_pull" -->
			<div class="sidebar S_md_Width S_sm_Width S_md_pull">
				<div class="SbC">
{{sc}}
				</div> <!-- Close class="SbC" -->
			</div> <!-- Close class="sidebar S_md_Width S_sm_Width S_md_pull" -->
<?php
echo '	</div>	<!-- close id="'.$IDtcs.'" class="row '.$localcolorder.'" -->'.PHP_EOL;
}
?>
</div>	<!-- Close class="container" -->
{{SCRIPT}}