<?php
/**
 * @version    $Id$
 * @package    IT_Theme_Framework
 * @author     InnoThemes Team <support@innothemes.com>
 * @copyright  Copyright (C) 2012 InnoThemes.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.innothemes.com
 */
?>
<div class="it-form-tabs">
	<ul>
		<?php foreach ( $this->current_tabs as $tid => $tab ) : ?>
		<li><a href="#it-form-tab-<?php esc_attr_e( $tid ); ?>"><?php esc_html_e( isset( $tab['title'] ) ? $tab['title'] : $tid, IT_THEME_TEXTDOMAIN ); ?></a></li>
		<?php endforeach; ?>
	</ul>

	<?php foreach ( $this->current_tabs as $tid => $tab ) : ?>
	<div id="it-form-tab-<?php esc_attr_e( $tid ); ?>">
		<?php
		if ( isset( $tab['fields'] ) ) :
			$this->current_fields = $tab['fields'];

			// Load fields template
			include IT_Loader::get_path( 'form/tmpl/fields.php' );
		endif;

		if ( isset( $tab['fieldsets'] ) ) :
			$this->current_fieldsets = $tab['fieldsets'];

			// Load fieldsets template
			include IT_Loader::get_path( 'form/tmpl/fieldsets.php' );
		endif;

		if ( isset( $tab['accordion'] ) ) :
			$this->current_accordion = $tab['accordion'];

			// Load accordion template
			include IT_Loader::get_path( 'form/tmpl/accordion.php' );
		endif;
		?>
	</div>
	<?php endforeach; ?>
</div>
