<?php

	defined( 'ABSPATH' ) or die( 'Keep Silent' );

	$current_page_template = basename( get_page_template_slug() );

	$background_type_class = "title-background-image";
	$title_background      = "";

	if ( velvet_option( 'title-background-type' ) == TRUE ) :
		$title_background = 'background-image: url(' . esc_url( velvet_title_image( 'http://placehold.it/1140x260' ) ) . '); background-size: cover;';
	else :
		$title_background      = 'background-color: ' . velvet_option( 'title-background-color', FALSE, '#555353' );
		$background_type_class = "title-background-color";
	endif;

	if ( is_page() and ! in_array( $current_page_template, velvet_home_page_templates() ) ) : ?>
		<div class="page-title-section <?php echo esc_attr( $background_type_class ); ?>"
		     style="<?php echo esc_attr( $title_background ); ?>">
			<div class="row">
				<div class="col-md-12">
					<div class="custom-page-header">
						<div class="page-header">
							<h1><?php echo velvet_title_text(); ?></h1>
						</div> <!-- .page-header -->
					</div> <!-- .custom-page-header -->
				</div> <!-- .col-## -->
			</div> <!-- .row -->
		</div> <!-- .page-header-wrapper -->
		<div class="breadcrumb-wrap">
			<div class="row">
				<div class="col-sm-10 col-xs-12">
					<?php velvet_breadcrumbs(); ?>
				</div>
				<div class="hidden-xs col-sm-2">
					<div class="social-menu-wrap dropdown pull-right">
						<button class="dropdown-toggle" type="button" id="socialMenu" data-toggle="dropdown"
						        aria-haspopup="true" aria-expanded="true"><i class="zmdi zmdi-share"></i>
						</button>
						<ul class="dropdown-menu social-menu rounded small icon-white" aria-labelledby="socialMenu">
							<?php if ( velvet_option( 'rss-link', FALSE, TRUE ) ) : ?>
								<li>
									<a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"
									   target="_blank"><i class="fa fa-rss"></i></a>
								</li>
							<?php endif; ?>

							<?php if ( velvet_option( 'facebook-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'facebook-link' ) ); ?>"
								       target="_blank"><i class="fa fa-facebook"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'twitter-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'twitter-link' ) ); ?>"
								       target="_blank"><i class="fa fa-twitter"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'google-plus-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'google-plus-link' ) ); ?>"
								       target="_blank"><i class="fa fa-google-plus"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'youtube-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'youtube-link' ) ); ?>"
								       target="_blank"><i class="fa fa-youtube"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'skype-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'skype-link' ) ); ?>"
								       target="_blank"><i class="fa fa-skype"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'pinterest-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'pinterest-link' ) ); ?>"
								       target="_blank"><i class="fa fa-pinterest"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'flickr-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'flickr-link' ) ); ?>"
								       target="_blank"><i class="fa fa-flickr"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'linkedin-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'linkedin-link' ) ); ?>"
								       target="_blank"><i class="fa fa-linkedin"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'vimeo-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'vimeo-link' ) ); ?>"
								       target="_blank"><i class="fa fa-vimeo-square"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'instagram-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'instagram-link' ) ); ?>"
								       target="_blank"><i class="fa fa-instagram"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'dribbble-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'dribbble-link' ) ); ?>"
								       target="_blank"><i class="fa fa-dribbble"></i></a></li>
							<?php endif; ?>

							<?php if ( velvet_option( 'tumblr-link' ) ) : ?>
								<li><a href="<?php echo esc_url( velvet_option( 'tumblr-link' ) ); ?>"
								       target="_blank"><i class="fa fa-tumblr"></i></a></li>
							<?php endif; ?>
						</ul>
						<!-- .social-section -->
					</div>
				</div>
			</div>
		</div>
	<?php endif; ?>

<?php if ( ! is_page() ) : ?>
	<div class="page-title-section <?php echo esc_attr( $background_type_class ); ?>"
	     style="<?php echo esc_attr( $title_background ); ?>">
		<div class="row">
			<div class="col-md-12">
				<div class="custom-page-header">
					<div class="page-header">
						<h1><?php echo wp_kses( velvet_title_text(), array(
								'strong' => array(),
								'span'   => array()
							) ); ?></h1>
					</div><!-- .page-header -->
				</div><!-- .custom-page-header -->
			</div><!-- .col-## -->
		</div><!-- .row -->
	</div> <!-- .page-header-wrapper -->
	<div class="breadcrumb-wrap">
		<div class="row">
			<div class="col-sm-10 col-xs-12">
				<?php velvet_breadcrumbs(); ?>
			</div>
			<div class="hidden-xs col-sm-2">
				<div class="social-menu-wrap dropdown pull-right">
					<button class="dropdown-toggle" type="button" id="socialMenu" data-toggle="dropdown"
					        aria-haspopup="true" aria-expanded="true"><i class="zmdi zmdi-share"></i>
					</button>
					<ul class="dropdown-menu social-menu rounded small icon-white" aria-labelledby="socialMenu">
						<?php if ( velvet_option( 'rss-link', FALSE, TRUE ) ) : ?>
							<li>
								<a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"
								   target="_blank"><i class="fa fa-rss"></i></a>
							</li>
						<?php endif; ?>

						<?php if ( velvet_option( 'facebook-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'facebook-link' ) ); ?>"
							       target="_blank"><i class="fa fa-facebook"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'twitter-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'twitter-link' ) ); ?>"
							       target="_blank"><i class="fa fa-twitter"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'google-plus-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'google-plus-link' ) ); ?>"
							       target="_blank"><i class="fa fa-google-plus"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'youtube-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'youtube-link' ) ); ?>"
							       target="_blank"><i class="fa fa-youtube"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'skype-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'skype-link' ) ); ?>"
							       target="_blank"><i class="fa fa-skype"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'pinterest-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'pinterest-link' ) ); ?>"
							       target="_blank"><i class="fa fa-pinterest"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'flickr-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'flickr-link' ) ); ?>"
							       target="_blank"><i class="fa fa-flickr"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'linkedin-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'linkedin-link' ) ); ?>"
							       target="_blank"><i class="fa fa-linkedin"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'vimeo-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'vimeo-link' ) ); ?>"
							       target="_blank"><i class="fa fa-vimeo-square"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'instagram-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'instagram-link' ) ); ?>"
							       target="_blank"><i class="fa fa-instagram"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'dribbble-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'dribbble-link' ) ); ?>"
							       target="_blank"><i class="fa fa-dribbble"></i></a></li>
						<?php endif; ?>

						<?php if ( velvet_option( 'tumblr-link' ) ) : ?>
							<li><a href="<?php echo esc_url( velvet_option( 'tumblr-link' ) ); ?>"
							       target="_blank"><i class="fa fa-tumblr"></i></a></li>
						<?php endif; ?>
					</ul>
					<!-- .social-section -->
				</div>
			</div>
		</div>
	</div>
<?php endif;