<?php
class WPBakeryShortCode_Av_Biglist extends WPBakeryShortCodesContainer{
protected function content($atts, $content=NULL){
    extract(shortcode_atts(array(
		'anim'=>'',
		'class'=>''
	), $atts));
	$GLOBALS['flistitem_count'] = 0;
	$anim = empty($anim) ? '' : "animation $anim";
	do_shortcode( $content );
	if( is_array( $GLOBALS['flistitems'] ) ){
		foreach( $GLOBALS['flistitems'] as $flistitem ){
				$flistitems[] = '<li>
									<a href="'.$flistitem['link'].'"><i class="fa '.$flistitem['icon'].'"></i></a>
									<h3>'.$flistitem['title'].'</h3>
									<p>'.do_shortcode($flistitem['itemcontent']).'</p>
								 </li>';

		}
		$return = '<ul  class="feature-list '.$anim.' '.$class.'">'.implode( "\n", $flistitems ).'</ul>';
		unset($GLOBALS['flistitems']);
	}
	return $return;	
}
}
add_shortcode('av_biglist', 'alc_biglist');
/*******************************************/
class WPBakeryShortCode_Av_Biglist_Item extends WPBakeryShortCode {
    protected function content( $atts, $content = null){
	extract(shortcode_atts(array(
			'link' => '',
			'title'=>'',
			'icon'=>'',
			'itemcontent'=>''
		
	), $atts));
	$x = $GLOBALS['flistitem_count'];
	$GLOBALS['flistitems'][$x] = array('link'=>$link, 'title'=>$title, 'icon'=>$icon,  'itemcontent' =>  $itemcontent );
	
	$GLOBALS['flistitem_count']++;
	}
}
add_shortcode('av_biglist_item', 'alc_biglist_item');
/**********************************************************/
vc_map( array(
	"name" => __("Unik Feature List", "unik"),
	"show_settings_on_create" => true,
	'is_container' => true,
	"content_element" => true,
	"as_parent" => array('only' => 'av_biglist_item'),
	"base" => "av_biglist",
	"class" => "",
	"icon" => "icon-wpb-my_biglist",
	'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" => "textfield",
         "class" => "",
         "heading" => __("Extra class", "unik"),
         "param_name" => "class"
      ),
   ),
	"js_view" => 'VcColumnView'
) );
/**********************************************************/
vc_map( array(
	'name' => __( 'List Item', 'unik' ),
	'base' => 'av_biglist_item',
	"icon" => "icon-wpb-ui-accordion",
	"as_child" => array('only' => 'av_biglist'),
	'content_element' => true,
	'params' => array(
		
		array(
		 "type" => "textfield",
		  "holder"=>'div',
		  "heading" => __("Title", "unik"),
		  "param_name" => "title"
		 ),
		
		
		array(
		 "type" => "textfield",
		  "class" => "",
		  "heading" => __("Icon", "unik"),
		  "param_name" => "icon",
		  "description" => __(' <small>Choose your icon from <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="blank">this list</a>.</small>', "unik")
		 ),
		 array(
         "type" => "textfield",
         "class" => "",
         "heading" => __("Item Link", "unik"),
         "param_name" => "link"
      ),
		 array(
         "type" => "textarea",
         "class" => "",
         "heading" => __("Item Content", "unik"),
         "param_name" => "itemcontent"
      ),
		)
	))
?>