<?php
/**
 * Page metabox
 *
 */

add_filter( 'cmb_meta_boxes', 'cmb_page_metaboxes' );
/**
 * Define the metabox and field configurations.
 *
 * @param  array $meta_boxes
 * @return array
 */
function cmb_page_metaboxes( array $meta_boxes ) {

	// Start with an underscore to hide fields from custom fields list
	$prefix = 'md_';

	//Slider Settings
	//======================================================================================================================
	$meta_boxes[] = array(
		'id'         => $prefix.'meta_box_page_portfolio_settings',
		'title'      => __("Portfolio Settings","framework"),
		'pages'      => array( 'page', ), // Post type
		'context'    => 'normal',
		'priority'   => 'default',
		'show_names' => true, // Show field names on the left
		'fields'     => array(
			array(
				'name' => __('Number of column','framework'),
				'id'	=> $prefix.'portfolio_number_of_column',
				'type'	=> 'select',
				'options' => array(
					array( 'name' => __('3 columns', 'framework'), 'value' => '3', ),
					array( 'name' => __('4 columns', 'framework'), 'value' => '4', ),
					
				),
				'std' => '3'
			),
			array( 
				'name'	=> __('Layout Style','framework'),
				'desc' => '',
				'id'	=> $prefix.'portfolio_layout_style',
				'type'	=> 'select',
				'options' => array(
					array( 'name' => __('Fit Rows', 'framework'), 'value' => 'fitRows', ),
					array( 'name' => __('Masonry', 'framework'), 'value' => 'masonry', ),
					
				),
				'std' => 'fitRows'
			),
			
			array(
				'name'	=> __('Items per page','framework'),
				'desc' => '',
				'id'   => $prefix . 'portfolio_items_per_page',
				'type' => 'text_small',
				'std' => '12'
			),
			array( 
				'name'	=> __('Portfolio Type','framework'),
				'desc' => __('Select Project type you\'d like to display (if no type selected, display all)','framework'),
				'id'	=> $prefix.'portfolio_cat',
				'taxonomy'	=>	'portfolio-type',
				'type'	=> 'taxonomy_multicheck',
				'std'	=> ''
			),
			array( 
				'name'	=> __('Order','framework'),
				'desc' => '',
				'id'	=> $prefix.'portfolio_order',
				'type'	=> 'select',
				
				'options' => array(
					array( 'name' => __('Descending', 'framework'), 'value' => 'DESC', ),
					array( 'name' => __('Ascending', 'framework'), 'value' => 'ASC', ),
					
				),
				'std' => 'DESC'
			),
			array( 
				'name'	=> __('Order by','framework'),
				'desc' => '',
				'id'	=> $prefix.'portfolio_order_by',
				'type'	=> 'select',
				'options' => array(
					array( 'name' => __('Menu Order', 'framework'), 'value' => 'menu_order', ),
					array( 'name' => __('Title', 'framework'), 'value' => 'title', ),
					array( 'name' => __('Date', 'framework'), 'value' => 'date', ),
					array( 'name' => __('Date Modified', 'framework'), 'value' => 'modified', ),
					array( 'name' => __('ID', 'framework'), 'value' => 'ID', ),	
					array( 'name' => __('Random', 'framework'), 'value' => 'rand', ),	
					array( 'name' => __('Comment count', 'framework'), 'value' => 'comment_count', ),	
				),
				'std' => 'modified'
			),
		),
	);
	// Add other metaboxes as needed

	return $meta_boxes;
}