<?php
/**
 * MegaMenus Metabox
 *
 * @package All In One Custom Post
 * @since All In One Custom Post 7.0.0 
 */
if ( !defined( 'ABSPATH' ) ) exit;

return array( 
	'id'          => 'vr_megamenus',
	'types'       => array( 'vr_megamenus' ),
	'title'       => __( 'MegaMenu Option', PLUGIN_NAME ),
	'priority'    => 'high',
	'mode'        => WPALCHEMY_MODE_EXTRACT,
	'template'    => array(

		array(
			'type' 			=> 'radiobutton',
			'name' 			=> 'vr_megamenu_type',
			'label' 		=> __( 'Service Gallery Type', PLUGIN_NAME ),
			'description'	=> __( 'Select gallery  type ( picture/video/audio ).', PLUGIN_NAME ),
			'validation'	=> 'required',
			'items' 		=> array(
				array(
					'value' => 'post',
					'label' => __( 'Post Mega Menu', PLUGIN_NAME ),
				),
				array(
					'value' => 'custom',
					'label' => __( 'Custom Mega Menu', PLUGIN_NAME ),
				),
				/*
				array(
					'value' => 'widget',
					'label' => __( 'Widget Mega Menu', PLUGIN_NAME ),
				),
				*/
			),
			'default' => array( 
				'post',
			),
		),
		array(
			'type' 			=> 'select',
			'name' 			=> 'menu',
			'label' 		=> __( 'Root Menu', PLUGIN_NAME ),
			'description' 	=> __( 'Select menu root from primary menu.', PLUGIN_NAME ),
			'validation'	=> 'required',
			'items' 		=> array(
				'data' => array(
					array(
						'source' => 'function',
						'value'  => 'aio_bind_menu',
					 ),
				 ),
			 ),
		),
		array(
			'type' 			=> 'toggle',
			'name' 			=> 'sub',
			'label' 		=> __( 'Root Sub Menu', PLUGIN_NAME ),
			'description'	=> __( 'show root sub menu.', PLUGIN_NAME ),
			'default' 		=> '0',
		),

		//
		// megamenu type post
		//
		array( 
			'type'      	=> 'group',
			'repeating' 	=> false,
			'length'    	=> 1,
			'sortable'		=> true,
			'name'      	=> 'post',
			'title'     	=> __( 'Mega Menu Post', PLUGIN_NAME ),
			'dependency' 	=> array( 
				'field'    	=> 'vr_megamenu_type',
				'function' 	=> 'vr_megamenu_type_post',
			),
			'fields'    	=> array(
				array(
					'type' 			=> 'select',
					'name' 			=> 'post',
					'label' 		=> __( 'Menu Post', PLUGIN_NAME ),
					'description' 	=> __( 'select mega menu post.', PLUGIN_NAME ),
					'validation'	=> 'required',
					'default' 		=> 'blog',
					'items' 		=> array(
						array(
							'value' => 'post',
							'label' => __( 'Post / Blog', PLUGIN_NAME ),
						),
						array(
							'value' => 'vr_gallerys',
							'label' => __( 'Gallerys', PLUGIN_NAME ),
						),
						array(
							'value' => 'product',
							'label' => __( 'WooCommerce', PLUGIN_NAME ),
						),
					),
				),
				array(
					'name'      	=> 'category',
					'type'      	=> 'textbox',
					'label' 		=> __( 'Menu Post Category', PLUGIN_NAME ),
					'description'	=> __( 'add mega menu post category.', PLUGIN_NAME ),			
				),
			),
		),

		//
		// MegaMenu Type Custom
		//
		array(
			'type'      	=> 'group',
			'repeating' 	=> false,
			'length'    	=> 1,
			'sortable'		=> true,
			'name'      	=> 'custom',
			'title'     	=> __( 'Custom Content', PLUGIN_NAME ),
			'dependency' 	=> array( 
				'field'    	=> 'vr_megamenu_type',
				'function' 	=> 'vr_megamenu_type_custom',
			),
			'fields'    	=> array(
				array( 
					'name'      	=> 'column_1',
					'type'      	=> 'textarea',
					'label' 		=> __( 'MegaMenu Column 1 Content', PLUGIN_NAME ),
					'description'	=> __( 'add megamenu column 1 content.', PLUGIN_NAME ),
					'default'       => '<h3>Column 1</h3>',
					'validation'	=> 'required',
				),
				array( 
					'name'      	=> 'column_2',
					'type'      	=> 'textarea',
					'label' 		=> __( 'MegaMenu Column 2 Content', PLUGIN_NAME ),
					'description'	=> __( 'add megamenu column 2 content.', PLUGIN_NAME ),
					'default'       => '<h3>Column 2</h3>',
					'validation'	=> 'required',
				),
				array( 
					'name'      	=> 'column_3',
					'type'      	=> 'textarea',
					'label' 		=> __( 'MegaMenu Column 3 Content', PLUGIN_NAME ),
					'description'	=> __( 'add megamenu column 3 content.', PLUGIN_NAME ),
					'default'       => '<h3>Column 3</h3>',
					'validation'	=> 'required',
				),
				array( 
					'name'      	=> 'column_4',
					'type'      	=> 'textarea',
					'label' 		=> __( 'MegaMenu Column 4 Content', PLUGIN_NAME ),
					'description'	=> __( 'add megamenu column 4 content.', PLUGIN_NAME ),
					'default'       => '<h3>Column 4</h3>',
					'validation'	=> 'required',
				),
			),
		),

		//
		// MegaMenu Type Post
		//
		array(
			'type'      	=> 'group',
			'repeating' 	=> false,
			'length'    	=> 1,
			'sortable'		=> true,
			'name'      	=> 'widget',
			'title'     	=> __( 'Mega Menu Widget', PLUGIN_NAME ),
			'dependency' 	=> array(
				'field'    	=> 'vr_megamenu_type',
				'function' 	=> 'vr_megamenu_type_widget',
			),
			'fields'    	=> array(
				array(
					'type' 			=> 'select',
					'name' 			=> 'widget',
					'label' 		=> __( 'Sidebar', PLUGIN_NAME ),
					'description' 	=> __( 'Select sidebar .', PLUGIN_NAME ),
					'default' 		=> 'Footer Sidebar',
					'items' 		=> array(
						'data' => array(
							array(
								'source' => 'function',
								'value'  => 'aio_bind_sidebars',
							),
						),
					),
				),
			),
		),
	// end controls
	),
);

/*
 * EOF
 */