<?php
/**
 * Registering meta boxes
 *
 * All the definitions of meta boxes are listed below with comments.
 * Please read them CAREFULLY.
 *
 * You also should read the changelog to know what has been changed before updating.
 *
 * For more information, please visit:
 * @link http://www.deluxeblogtips.com/meta-box/
 */


add_filter( 'rwmb_meta_boxes', 'slant_register_meta_boxes' );

/**
 * Register meta boxes
 *
 * @return void
 */
function slant_register_meta_boxes( $meta_boxes )
{
	/**
	 * Prefix of meta keys (optional)
	 * Use underscore (_) at the beginning to make keys hidden
	 * Alt.: You also can make prefix empty to disable it
	 */
	// Better has an underscore as last sign
	$prefix = 'slant_';
	
	// Page meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_page_option_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Page and Home Section Options', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'page' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
		
			// Page Section
			array(
				'name' => __('Assign current page as', KP_THEME_NAME),
				'id'   => "{$prefix}check_page",
				'class'   => "{$prefix}check_page",
				'type' => 'select',
				'options' => array(
					'home'		=> __('Home Section', KP_THEME_NAME),
					'separate'		=> __('Separate Page', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'none',
				'desc' => __('Assign Current Page as Home Section to display in the Home Page Otherwise it will Open as Separate Link.', KP_THEME_NAME),
			),
			
			// Disable Title
			array(
				'name' => __('Disable Page Tilte', KP_THEME_NAME),
				'id'        => "{$prefix}disable_title",
				'class'        => "{$prefix}disable_title",
				'desc' => __("Don't show Page Title .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'checkbox',
				'std' => '',
			),
			// Disable Title
			array(
				'name' => __('Disable Page Container', KP_THEME_NAME),
				'id'        => "{$prefix}disable_container",
				'class'        => "{$prefix}disable_container",
				'desc' => __("For wide Sections Layout Disable your Page container .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'checkbox',
				'std' => '',
			),
			// Background
			array(
				'name' => __('Section Background', KP_THEME_NAME),
				'id'   => "{$prefix}section_bg",
				'class'   => "{$prefix}section_bg",
				'type' => 'select',
				'options' => array(
					'default'		=> __('Default', KP_THEME_NAME),
					'image'		=> __('Image', KP_THEME_NAME),
					'video'		=> __('Video', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'default',
				'desc' => __('Choose the section Background Type.', KP_THEME_NAME),
			),
			
			// Text Color
			array(
				'name' => __('Text Color', KP_THEME_NAME),
				'id'   => "{$prefix}text_color",
				'class'   => "{$prefix}text_color",
				'type' => 'select',
				'options' => array(
					'dark'		=> __('Dark', KP_THEME_NAME),
					'light'		=> __('Light', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'dark',
				'desc' => __('Select Text Color.', KP_THEME_NAME),
			),
			
			// Parallax
			array(
				'name' => __('Enable Parallax', KP_THEME_NAME),
				'id'        => "{$prefix}enable_parallax",
				'class'        => "{$prefix}enable_parallax",
				'desc' => __("Use Parallax Effect on Background Image .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'checkbox',
				'std' => '',
			),
						
			// Overlay
			array(
				'name' => __('Overlay Effect', KP_THEME_NAME),
				'id'   => "{$prefix}overlay_effect",
				'class'   => "{$prefix}overlay_effect",
				'type' => 'select',
				'options' => array(
					'none'		=> __('None', KP_THEME_NAME),
					'color'		=> __('Color Overlay', KP_THEME_NAME),
					'pattern'		=> __('Pattern Overlay', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'default',
				'desc' => __('Select Overlay Effect.', KP_THEME_NAME),
			),
			
			// Triangle
			array(
				'name' => __('Triangle Effect', KP_THEME_NAME),
				'id'   => "{$prefix}triangle_effect",
				'class'   => "{$prefix}triangle_effect",
				'type' => 'select',
				'options' => array(
					'none'		=> __('None', KP_THEME_NAME),
					'top'		=> __('Top', KP_THEME_NAME),
					'left'		=> __('Left', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'default',
				'desc' => __('Select Triangle Effect.', KP_THEME_NAME),
			),
			
			// Background Color
			array(
				'name' => __('Section Background Color', KP_THEME_NAME),
				'id'        => "{$prefix}bg_color",
				'class'        => "{$prefix}bg_color",
				'desc' => __("Select your section BG Color .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'color',
				'std' => '',
			),
						
			// Video ID
			array(
				'name' => __('Youtube Video ID', KP_THEME_NAME),
				'id'        => "{$prefix}bg_video_id",
				'class'        => "{$prefix}bg_video_id",
				'desc' => __("Enter your Youtube Video ID .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'text',
				'std' => '',
			),
			

		),

	);
	
		
	// Post meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_post_thumb_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Post Options', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'post' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
					
			// Gallery Upload
			array(
				'name'      => __('Gallery Images Upload', KP_THEME_NAME ),
				'id'        => "{$prefix}post_gallery",
				'class'    => "{$prefix}post_gallery",
				'desc'  => __( 'For Best Result The image should (1600px to 2000px)W & Min (800px)H.', KP_THEME_NAME ),
				'type'             => 'image_advanced',
				'max_file_uploads' => 8,
			),
			
			// Video Type
			array(
				'name' => __('Video Type', KP_THEME_NAME),
				'id'   => "{$prefix}post_video_type",
				'class'   => "{$prefix}post_video_type",
				'type' => 'select',
				'options' => array(
					'youtube'		=> __('Youtube', KP_THEME_NAME),
					'vimeo'		=> __('Vimeo', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'youtube',
				'desc' => __('Choose video type.', KP_THEME_NAME),
			),
						
			// Video ID
			array(
				'name' => __('Video ID', KP_THEME_NAME),
				'id'        => "{$prefix}post_video_id",
				'class'        => "{$prefix}post_video_id",
				'desc' => __("Enter your Video ID .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'text',
				'std' => '',
			),
			

		),

	);
	
	// Portfolio meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_portfolio_thumb_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Single Portfolio Option', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'portfolio' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
		
			// thumb Type
			array(
				'name' => __('Media Type', KP_THEME_NAME),
				'id'   => "{$prefix}thumb_type",
				'class'   => "{$prefix}thumb_type",
				'type' => 'select',
				'options' => array(
					'image'		=> __('Feature Image', KP_THEME_NAME),
					'gallery'		=> __('Gallery', KP_THEME_NAME),
					'video'		=> __('Video', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'image',
				'desc' => __('Choose the thumbnial type to display in the portfolio.', KP_THEME_NAME),
			),
			
			// Gallery Upload
			array(
				'name'      => __('Gallery Images Upload', KP_THEME_NAME ),
				'id'        => "{$prefix}thumb_gallery",
				'class'    => "{$prefix}thumb_gallery",
				'desc'  => __( 'For Best Result The image should (1600px to 2000px)W & Min (800px)H.', KP_THEME_NAME ),
				'type'             => 'image_advanced',
				'max_file_uploads' => 8,
			),
			
			// Video Type
			array(
				'name' => __('Video Type', KP_THEME_NAME),
				'id'   => "{$prefix}thumb_video_type",
				'class'   => "{$prefix}thumb_video_type",
				'type' => 'select',
				'options' => array(
					'youtube'		=> __('Youtube', KP_THEME_NAME),
					'vimeo'		=> __('Vimeo', KP_THEME_NAME),
				),
				'multiple' => false,
				'std'  => 'youtube',
				'desc' => __('Choose video type.', KP_THEME_NAME),
			),
						
			// Video ID
			array(
				'name' => __('Video ID', KP_THEME_NAME),
				'id'        => "{$prefix}thumb_video_id",
				'class'        => "{$prefix}thumb_video_id",
				'desc' => __("Enter your Video ID .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'text',
				'std' => '',
			),
			

		),

	);
	
	

	
	// Team meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_team_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Person Information', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'team' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
			// Position
			array(
				// Field name - Will be used as label
				'name'  => __( 'Job Title', KP_THEME_NAME ),
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}person_position",
				// Field description (optional)
				'desc'  => __( '', KP_THEME_NAME ),
				'type'  => 'text',
				// Default value (optional)
				'std'   => __( '', KP_THEME_NAME ),
				// CLONES: Add to make the field cloneable (i.e. have multiple value)
				'clone' => false,
			),
			// Facebook URL
			array(
				'name'  => __( 'Facebook', KP_THEME_NAME ),
				'id'    => "{$prefix}person_facebook",
				'desc'  => __( 'ex : http://www.facebook.com', KP_THEME_NAME ),
				'type'  => 'url',
				'std'   => '',
			),
			// Twitter URL
			array(
				'name'  => __( 'Twitter', KP_THEME_NAME ),
				'id'    => "{$prefix}person_twitter",
				'desc'  => __( 'ex : http://www.twitter.com', KP_THEME_NAME ),
				'type'  => 'url',
				'std'   => '',
			),
			// Linkedin URL
			array(
				'name'  => __( 'Linkedin', KP_THEME_NAME ),
				'id'    => "{$prefix}person_linkedin",
				'desc'  => __( 'ex : http://www.linkedin.com', KP_THEME_NAME ),
				'type'  => 'url',
				'std'   => '',
			),
			// Google URL
			array(
				'name'  => __( 'Google+', KP_THEME_NAME ),
				'id'    => "{$prefix}person_google",
				'desc'  => __( 'ex : http://plus.google.com', KP_THEME_NAME ),
				'type'  => 'url',
				'std'   => '',
			),
			
		),
	);
	
	
	
	// Testimonial meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_testimonial_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Person Information', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'testimonial' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
			// Position
			array(
				// Field name - Will be used as label
				'name'  => __( 'Job Title', KP_THEME_NAME ),
				// Field ID, i.e. the meta key
				'id'    => "{$prefix}testimonial_job_title",
				// Field description (optional)
				'desc'  => __( '', KP_THEME_NAME ),
				'type'  => 'text',
				// Default value (optional)
				'std'   => __( '', KP_THEME_NAME ),
				// CLONES: Add to make the field cloneable (i.e. have multiple value)
				'clone' => false,
			),
			
		),
	);
	
		
		// Skew Slider meta box
	$meta_boxes[] = array(
		// Meta box id, UNIQUE per meta box. Optional since 4.1.5
		'id' => 'slant_skew_slider_meta_box',

		// Meta box title - Will appear at the drag and drop handle bar. Required.
		'title' => __( 'Slide Option', KP_THEME_NAME ),

		// Post types, accept custom post types as well - DEFAULT is array('post'). Optional.
		'pages' => array( 'skew_slider' ),

		// Where the meta box appear: normal (default), advanced, side. Optional.
		'context' => 'normal',

		// Order of meta box: high (default), low. Optional.
		'priority' => 'high',

		// Auto save: true, false (default). Optional.
		'autosave' => true,

		// List of meta fields
		'fields' => array(
			// Image Upload
			array(
				'name'       => __( 'Slide Image', KP_THEME_NAME ),
				'id'        => "{$prefix}skew_slide_image",
				'class'    => "{$prefix}skew_slide_image",
				'desc'  => __( 'For Best Resolution Images should be 1200 width X 800 Height', KP_THEME_NAME ),
				'type'             => 'image_advanced',
				'max_file_uploads' => 1,
			),
			
			// Slide Descrption
			array(
				'name' => __('Descrption', KP_THEME_NAME),
				'id'        => "{$prefix}skew_slide_descrption",
				'class'        => "{$prefix}skew_slide_descrption",
				'desc' => __("Enter your Slide Descrption .", KP_THEME_NAME),
				'clone' => false,
				'type'  => 'text',
				'std' => '',
			),
			

		),

	);
	
	return $meta_boxes;
}


