<?php

$args = array(
		'class'=>'',
		'margin'=>'',
		'padding'=>'',
		'image'=>'',
		'link_url'=>'',		
		'featyretype'=>'',			
);

$html = "";

extract(shortcode_atts($args, $atts));

	if(is_numeric($image)) {
		$bauen_image = wp_get_attachment_url( $image );
		$bauen_title = get_the_title( $image );
	} else {
		$bauen_image = $image;
		$bauen_title = $image;
	}		
			

	$html .='<div class="sec-gallery '.esc_attr($class).'">';
	    if(is_numeric($image)) {
			if($featyretype == "st2"){	
				$html .='<div class="vid-area mb-30"';
			        if($margin != '') { $html .='style="margin:'.$margin.'!important;"';} 
	            $html .='>';
					$html .='<div class="vid-icon">';	
						$html .='<img src="'.esc_url($bauen_image).'" alt="'.esc_attr($bauen_title).'" /> <a href="'.esc_url($link_url).'" class="video-gallery-button vid"> <span class="video-gallery-polygon"> <i class="ti-control-play"></i> </span> </a>';	
					$html .='</div>';		
				$html .='</div>';
			} 
			else {				
				$html .='<div class="gallery-item"';
			        if($padding != '') { $html .='style="padding:'.$padding.';"';} 
	            $html .='>';
					$html .='<a href="'.esc_url($bauen_image).'" class="img-zoom">';
						$html .='<div class="gallery-box">';	
						    $html .='<div class="gallery-img"><img src="'.esc_url($bauen_image).'" title="'.esc_attr($bauen_title).'" alt="'.esc_attr($bauen_title).'" class="img-fluid mx-auto d-block"/></div>';	
						$html .='</div>';		
					$html .='</a>';
				$html .='</div>';								
			}	

		}
	$html .='</div>';

echo $html;