<?php
/************ FEATURED BLOCK****************/
function alc_fblock($atts, $content=NULL){
    extract(shortcode_atts(array(
		'type'=>'',
		'color'=>'',
        'anim'=>'',
		'title'=>'',
		'icon'=>'',
		'image'=>'',
		'link'=>'',
		'linkcaption' => '',
		'class'=>''
    ), $atts));
	$anim = empty($anim) ? '' : "animation $anim";
	$out='';
	$photo = wp_get_attachment_image_src($image, 'full');
	if($type==1){
	$out.='<div class="features-post  '.$anim.' '.$class.'">
			<img src="'.$photo[0].'" alt="'.$title.'">
			<h4 style="color:'.$color.'">'.$title.'</h4>
			<p style="color:'.$color.'">'.do_shortcode($content).'</p>
			<a href="'.$link.'" class="link-icon" style="background:'.$color.'">'.$linkcaption.'</a>
		  </div>';
	}elseif($type==2){
		$out.='<div class="services-section2 '.$anim.' '.$class.'">
					<div class="services-post">
							<span><i class="fa '.$icon.'"></i></span>
							<h2 style="color:'.$color.'">'.$title.'</h2>
							<p style="color:'.$color.'">'.do_shortcode($content).'</p>
							<a href="'.$link.'" style="color:'.$color.'; border-color:'.$color.'">'.$linkcaption.'</a>
						</div>
			   </div>';
	}elseif($type==3) {
		$out.='<div class="fblock3-main '.$anim.' '.$class.'"><div class="fblock3-short ">
				<span><i class="fa '.$icon.'"></i></span>
				<h3>'.$title.'</h3>									
			  </div></div>';
	}
    return $out;
}
add_shortcode('fblock', 'alc_fblock');
vc_map( array(
   "name" => __("Unik featured block", "unik"),
   "base" => "fblock",
   "class" => "",
   "icon" => "icon-wpb-my_fblock",
   'admin_enqueue_css' => array(get_template_directory_uri().'/vc_templates/shortcodes.css'),
   "category" => __('Content', "unik"),
   "params" => array(
       array(
         "type" => "dropdown",
         "class" => "",
         "heading" => __("Animation", "unik"),
         "param_name" => "anim",
         "value" => array( "None"=>"", "bounce"=>"bounce", "flash"=>"flash", "pulse"=>"pulse", "shake"=>"shake", "swing"=>"swing", "tada"=>"tada", "wobble"=>"wobble", "bounceIn"=>"bounceIn", "bounceInDown"=>"bounceInDown", "bounceInLeft"=>"bounceInLeft", "bounceInRight"=>"bounceInRight", "bounceInUp"=>"bounceInUp", "bounceOut"=>"bounceOut", "bounceOutDown"=>"bounceOutDown", "bounceOutLeft"=>"bounceOutLeft", "bounceOutRight"=>"bounceOutRight", "bounceOutUp"=>"bounceOutUp", "fadeIn"=>"fadeIn", "fadeInDown"=>"fadeInDown", "fadeInDownBig"=>"fadeInDownBig", "fadeInLeft"=>"fadeInLeft", "fadeInLeftBig"=>"fadeInLeftBig", "fadeInRight"=>"fadeInRight", "fadeInRightBig"=>"fadeInRightBig", "fadeInUp"=>"fadeInUp", "fadeInUpBig"=>"fadeInUpBig", "fadeOut"=>"fadeOut", "fadeOutDown"=>"fadeOutDown", "fadeOutDownBig"=>"fadeOutDownBig", "fadeOutLeft"=>"fadeOutLeft", "fadeOutLeftBig"=>"fadeOutLeftBig", "fadeOutRight"=>"fadeOutRight", "fadeOutRightBig"=>"fadeOutRightBig", "fadeOutUp"=>"fadeOutUp", "fadeOutUpBig"=>"fadeOutUpBig", "flip"=>"flip", "flipInX"=>"flipInX", "flipInY"=>"flipInY", "flipOutX"=>"flipOutX", "flipOutY"=>"flipOutY", "lightSpeedIn"=>"lightSpeedIn", "lightSpeedOut"=>"lightSpeedOut", "rotateIn"=>"rotateIn", "rotateInDownLeft"=>"rotateInDownLeft", "rotateInDownRight"=>"rotateInDownRight", "rotateInUpLeft"=>"rotateInUpLeft", "rotateInUpRight"=>"rotateInUpRight", "rotateOut"=>"rotateOut", "rotateOutDownLeft"=>"rotateOutDownLeft", "rotateOutDownRight"=>"rotateOutDownRight", "rotateOutUpLeft"=>"rotateOutUpLeft", "rotateOutUpRight"=>"rotateOutUpRight",  "hinge"=>"hinge", "rollIn"=>"rollIn", "rollOut"=>"rollOut", "zoomIn"=>"zoomIn","zoomInDown"=>"zoomInDown", "zoomInLeft"=>"zoomInLeft","zoomInRight"=>"zoomInRight","zoomInUp"=>"zoomInUp","zoomOut"=>"zoomOut", "zoomOutLeft"=>"zoomOutLeft", "zoomOutRight"=>"zoomOutRight","zoomOutUp"=>"zoomOutUp"),
         "description" => __(" Animation.", "unik")
      ),
        array(
         "type" => "dropdown",
         
         "class" => "",
         "heading" => __("Type", "unik"),
         "param_name" => "type",
         "value"=>array("Default"=>"1", "Service"=>"2", "Alternative"=>"3")
      ),
	   array(
            "type" => "colorpicker",
            "class" => "",
            "heading" => __("Custom color"),
            "param_name" => "color",
            "value" => ''
         ),
      array(
         "type" => "textfield",
		  "holder"=>"div",
         "class" => "",
         "heading" => __("Block title", "unik"),
         "param_name" => "title"
      ),
      array(
         "type" => "textfield",
         
         "class" => "",
         "heading" => __("Block icon", "unik"),
         "param_name" => "icon",
         "description" => __(' For Service and Alternative Type', "unik")
	 ),
        array(
         "type" => "attach_image",
         "class" => "",
         "heading" => __("Photo ", "unik"),
         "param_name" => "image",
         "description" => __(' For Default Type', "unik")
      ),
	   array(
         "type" => "textfield",
         "class" => "",
         "heading" => __("Block Link", "unik"),
         "param_name" => "link"
      ),
	   array(
         "type" => "textfield",
         "class" => "",
         "heading" => __("Block link Caption", "unik"),
         "param_name" => "linkcaption"
      ),
        array(
         "type" => "textarea_html",
         
         "class" => "",
         "heading" => __("Content", "unik"),
         "param_name" => "content"
      ),
       array(
         "type" => "textfield",
         "class" => "",
         "heading" => __("Extra class", "unik"),
         "param_name" => "class",
         "description" => __(' Extra class name', "unik")
      )
   )
) );
/*********************************************/
?>