<?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-field-text-logo">
	<div class="input-append row-fluid">
<?php
// Backup name/value pair
$backup_name  = $this->name;
$backup_value = $this->value;

// Temporary change name/value pair
$this->name  = $this->get( 'name', null, true ) . '[text]';
$this->value = $this->value['text'];

// Render text field for inputing logo text
$this->get( 'input', 'text' );

// Restore name/value pair
$this->name  = $backup_name;
$this->value = $backup_value;
?>
		<a href="javascript:void(0);" class="btn it-text-logo-btn" title="<?php _e( 'Design Logo', IT_THEME_TEXTDOMAIN ); ?>">...</a>
	</div>

	<div id="<?php $this->get( 'id' ); ?>-text-logo-modal" class="jsn-bootstrap it-text-logo-modal hidden" title="<?php esc_attr_e( $this->label, IT_THEME_TEXTDOMAIN ); ?>">
		<div class="it-text-logo-preview"><?php esc_html_e( $this->value['text'] ); ?></div>
		<hr />
		<div class="<?php $this->get( 'id' ); ?>-settings form-horizontal">
			<div class="control-group">
				<label class="control-label"><?php _e( 'Font Face', IT_THEME_TEXTDOMAIN ); ?></label>
				<div class="controls">
<?php
// Render font face selector
$this->choices = array( 'font-face' );

$this->get( 'input', 'typography' );
?>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php _e( 'Font Attributes', IT_THEME_TEXTDOMAIN ); ?></label>
				<div class="controls">
<?php
// Render font attributes editor
$this->choices = array( 'font-size', 'font-unit', 'font-display', 'text-color' );

$this->get( 'input', 'typography' );
?>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php _e( 'Shadow', IT_THEME_TEXTDOMAIN ); ?></label>
				<div class="controls">
<?php
// Render text effect editor
$this->choices = array( 'text-effect' );

$this->get( 'input', 'typography' );
?>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label"><?php _e( 'Padding', IT_THEME_TEXTDOMAIN ); ?></label>
				<div class="controls">
<?php
foreach ( array( 'top', 'right', 'bottom', 'left' ) as $edge ) :

$value = isset( $this->value["padding-{$edge}"] ) ? $this->value["padding-{$edge}"] : '5';
?>
					<div class="input-append">
						<input id="<?php $this->get( 'id' ); esc_attr_e( "-padding-{$edge}" ); ?>" type="number" name="<?php $this->get( 'name' ); ?>[padding-<?php esc_attr_e( $edge ); ?>]" value="<?php esc_attr_e( $value ); ?>" size="5" />
						<span class="btn"><?php _e( 'px', IT_THEME_TEXTDOMAIN ); ?></span>
					</div>
<?php endforeach; ?>
				</div>
			</div>
		</div>
	</div>
<?php
// Load assets if not already loaded
if ( ! defined( 'IT_TEXT_LOGO_INITIALIZED' ) ) :

define( 'IT_TEXT_LOGO_INITIALIZED', true );

IT_Init_Assets::load( 'it-text-logo-js', 'wp-jquery-ui-dialog-css' );

$script = '
	new $.IT_TextLogo({
		lang: {
			Close: "' . __( 'Close', IT_THEME_TEXTDOMAIN ) . '"
		}
	});';

IT_Init_Assets::inline( 'js', $script, true );

endif;
?>
</div>
