<?php
$nofollow_1 = isset( $settings->button_1_link_nofollow ) && 'yes' === $settings->button_1_link_nofollow ? ' rel="nofollow"' : '';
$target_1   = isset( $settings->button_1_link_target ) ? ' target="' . esc_attr( $settings->button_1_link_target ) . '"' : '';
$nofollow_2 = isset( $settings->button_2_link_nofollow ) && 'yes' === $settings->button_2_link_nofollow ? ' rel="nofollow"' : '';
$target_2   = isset( $settings->button_2_link_target ) ? ' target="' . esc_attr( $settings->button_2_link_target ) . '"' : '';
$attr1      = '';
$attr2      = '';
$alt1      = '';
$alt2      = '';
if ( isset( $settings->enable_title_attr_1 ) && 'yes' === $settings->enable_title_attr_1 && ! empty( $settings->title_attr_1 ) ) {
	$attr1  = ' title="' . esc_attr( $settings->title_attr_1 ) . '"';
	$alt1    = ' alt="' . esc_attr( $settings->title_attr_1 ) . '"';
}
if ( isset( $settings->enable_title_attr_2 ) && 'yes' === $settings->enable_title_attr_2 && ! empty( $settings->title_attr_2 ) ) {
	$attr2  = ' title="' . esc_attr( $settings->title_attr_2 ) . '"';
	$alt2   = ' alt="' . esc_attr( $settings->title_attr_2 ) . '"';
}
?>
<div class="pp-dual-button-content clearfix">
	<div class="pp-dual-button-inner">
		<div class="pp-dual-button-1 pp-dual-button pp-button-effect-<?php echo esc_attr( $settings->button_1_effect ); ?>">
			<a href="<?php echo esc_url( do_shortcode( $settings->button_1_link ) ); ?>" class="pp-button <?php echo esc_attr( $settings->button_1_css_class ); ?>" role="button"<?php echo $target_1; ?><?php echo $nofollow_1; ?><?php echo $attr1; ?> onclick="">
				<?php if ( 'left' === $settings->button_1_icon_aligment ) { ?>
					<?php if ( 'font_icon' === $settings->button_icon_select_1 && isset( $settings->button_font_icon_1 ) && ! empty( $settings->button_font_icon_1 ) ) { ?>
						<span class="pp-font-icon <?php echo esc_attr( $settings->button_font_icon_1 ); ?>"></span>
					<?php } ?>
					<?php if ( 'custom_icon' === $settings->button_icon_select_1 && isset( $settings->button_custom_icon_1 ) && ! empty( $settings->button_custom_icon_1 ) ) { ?>
						<img class="pp-custom-icon" src="<?php echo esc_url( $settings->button_custom_icon_1_src ); ?>"<?php echo ! empty( $alt1 ) ? $al1 : ''; ?> />
					<?php } ?>
				<?php } ?>
				<span class="pp-button-1-text"><?php echo $settings->button_1_title; ?></span>
				<?php if ( 'right' === $settings->button_1_icon_aligment ) { ?>
					<?php if ( 'font_icon' === $settings->button_icon_select_1 && isset( $settings->button_font_icon_1 ) && ! empty( $settings->button_font_icon_1 ) ) { ?>
						<span class="pp-font-icon <?php echo esc_attr( $settings->button_font_icon_1 ); ?>"></span>
					<?php } ?>
					<?php if ( 'custom_icon' === $settings->button_icon_select_1 && isset( $settings->button_custom_icon_1 ) && ! empty( $settings->button_custom_icon_1 ) ) { ?>
						<img class="pp-custom-icon" src="<?php echo esc_url( $settings->button_custom_icon_1_src ); ?>"<?php echo ! empty( $alt1 ) ? $alt1 : ''; ?> />
					<?php } ?>
				<?php } ?>
			</a>
		</div>
		<div class="pp-dual-button-2 pp-dual-button pp-button-effect-<?php echo $settings->button_2_effect; ?>">
			<a href="<?php echo esc_url( do_shortcode( $settings->button_2_link ) ); ?>" class="pp-button <?php echo esc_attr( $settings->button_2_css_class ); ?>" role="button"<?php echo $target_2; ?><?php echo $nofollow_2; ?><?php echo $attr2; ?> onclick="">
				<?php if ( 'left' === $settings->button_2_icon_aligment ) { ?>
					<?php if ( 'font_icon' === $settings->button_icon_select_2 && isset( $settings->button_font_icon_2 ) && ! empty( $settings->button_font_icon_2 ) ) { ?>
						<span class="pp-font-icon <?php echo esc_attr( $settings->button_font_icon_2 ); ?>"></span>
					<?php } ?>
					<?php if ( 'custom_icon' === $settings->button_icon_select_2 && isset( $settings->button_custom_icon_2 ) && ! empty( $settings->button_custom_icon_2 ) ) { ?>
						<img class="pp-custom-icon" src="<?php echo esc_url( $settings->button_custom_icon_2_src ); ?>"<?php echo ! empty( $alt2 ) ? $alt2 : ''; ?> />
					<?php } ?>
				<?php } ?>
				<span class="pp-button-2-text"><?php echo $settings->button_2_title; ?></span>
				<?php if ( 'right' === $settings->button_2_icon_aligment ) { ?>
					<?php if ( 'font_icon' === $settings->button_icon_select_2 && isset( $settings->button_font_icon_2 ) && ! empty( $settings->button_font_icon_2 ) ) { ?>
						<span class="pp-font-icon <?php echo esc_attr( $settings->button_font_icon_2 ); ?>"></span>
					<?php } ?>
					<?php if ( 'custom_icon' === $settings->button_icon_select_2 && isset( $settings->button_custom_icon_2 ) && ! empty( $settings->button_custom_icon_2 ) ) { ?>
						<img class="pp-custom-icon" src="<?php echo esc_url( $settings->button_custom_icon_2_src ); ?>" />
					<?php } ?>
				<?php } ?>
			</a>
		</div>
	</div>
</div>
