<?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
 */

// Generate class to indicate current selection
$grouped  = $this->visible_button == 1 ? ''            : 'btn-group';
$selected = $this->visible_button == 1 ? 'hide hidden' : 'disabled';
$enabled  = $this->value == 1          ? true          : false;

// Set class for hidden field to indicate that it contains form state
$this->attributes['class'] = 'it-form-state';
?>
<div class="it-form-field-form-state">
	<?php $this->get( 'input', 'hidden' ); ?>

	<span class="it-form-state-switcher <?php echo '' . $grouped; ?>">
		<a class="btn<?php if ( $enabled ) echo ' btn-success ' . $selected; ?> turn-on"><?php esc_html_e( $this->choices['enable'], IT_THEME_TEXTDOMAIN ); ?></a>
		<a class="btn<?php if ( ! $enabled ) echo ' btn-danger '. $selected; ?> turn-off"><?php esc_html_e( $this->choices['disable'], IT_THEME_TEXTDOMAIN ); ?></a>
	</span>
</div>
