<?php
/************ Content Box****************/
class WPBakeryShortCode_Contentbox extends WPBakeryShortCodesContainer{
	protected function content($atts, $content=NULL){
	extract(shortcode_atts(array(
		   'anim'=>'',
		   'class'=>'',
		   'boxbg'=>'',
		   'boxbgcolor' => ''
	   ), $atts));	
	   do_shortcode ($content);
	   $anim = empty($anim) ? '' : "animation $anim";
	   $image = wp_get_attachment_image_src($boxbg, 'full');
	   $boxbg = (isset($boxbg) && $boxbg!=='') ? ' background-image:url('.$image[0].') !important;' : '';
	   $boxbgcolor = (isset($boxbgcolor) && $boxbgcolor!=='') ? ' background-color:'.$boxbgcolor.' !important;' : '';
	   $out = '<div class="box-section  '.$anim.' '.$class.'" style="'.$boxbg.$boxbgcolor.'">'.do_shortcode ($content).'</div>';
	   return $out;
	}
}
add_shortcode('contentbox', 'alc_contentbox');
/**********************************************************/
vc_map( array(
   "name" => __("Unik Content box", "unik"),
   "base" => "contentbox",
   "class" => "",
   "icon" => "icon-wpb-my_well",
   "is_container" => true,
   "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" => "attach_image",
         "class" => "",
         "heading" => __("Background image", "unik"),
         "param_name" => "boxbg"
      ),
		array(
            "type" => "colorpicker",
            "class" => "",
            "heading" => __("Background custom color", "unik"),
            "param_name" => "boxbgcolor",
            "value" => ''
         ),
	  
        array(
         "type" => "textfield",
         "class" => "",
         "heading" => __("Extra class", "unik"),
         "param_name" => "class"
      ),
   ),
	"js_view" => 'VcColumnView'
) );
?>