<?php
/**
 * The Sidebar containing the Header Right Widget Area
 *
 * @package Catch Themes
 * @subpackage Catch Flames Pro
 * @since Catch Flames Pro 1.0
 */
?>

<?php
//Getting Ready to load data from Theme Options Panel
global $catchflames_options_settings;
$options = $catchflames_options_settings;
if ( !empty( $options[ 'disable_header_right_sidebar' ]  ) ) :

	return false;

else : ?>

    <div id="sidebar-header-right" class="widget-area sidebar-top clearfix">

		<?php if ( has_nav_menu( 'third' ) ) : ?>
			<aside id="header-right-menu" class="widget widget_nav_menu">
				<nav id="access-header-sidebar" role="navigation">
					<?php $args = array(
						'theme_location'    => 'third',
						'container' 		=> false,
						'items_wrap'        => '<ul id="header-right-nav" class="menu">%3$s</ul>'
					);
					wp_nav_menu( $args ); ?>
				</nav><!-- #mobile-header-sidebar -->
			</aside>
		<?php endif; ?>

		<?php if ( is_active_sidebar( 'catchflames_header_right_sidebar' ) ) :
			dynamic_sidebar( 'catchflames_header_right_sidebar' );
		else : ?>
        	<?php if ( empty( $options[ 'disable_header_right_search' ] ) ) : ?>
                <aside class="widget widget_search">
                    <?php echo get_search_form(); ?>
                </aside>
            <?php endif; ?>
			<aside class="widget widget_catchflames_social_widget">
            	<?php catchflames_social_networks(); ?>
            </aside>

		<?php endif; ?>

	</div><!-- #sidebar-header-right -->

<?php endif; ?>