<?php
/*******************************************************************************************

Registers Testimonial Post Type

********************************************************************************************/
$labels = array(
	'name' => _x('Testimonial', 'post type general name', 'site5framework'),
    'singular_name' => _x('Testimonial', 'post type singular name', 'site5framework'),
    'add_new' => _x('Add New', 'testimonial', 'site5framework'),
    'add_new_item' => __('Add New Testimonial', 'site5framework'),
    'edit_item' => __('Edit Testimonial', 'site5framework'),
    'new_item' => __('New Testimonial', 'site5framework'),
    'view_item' => __('View Testimonial', 'site5framework'),
    'search_items' => __('Search Testimonial', 'site5framework'),
    'not_found' =>  __('No Testimonial found', 'site5framework'),
    'not_found_in_trash' => __('No Testimonial found in Trash', 'site5framework'),
    'parent_item_colon' => ''
  );

register_post_type('testimonial', array(
     'labels' => $labels,
     'singular_label' => __('testimonial'),
     'public' => true,
     'show_ui' => true, // UI in admin panel
     '_builtin' => false, // It's a custom post type, not built in!
     '_edit_link' => 'post.php?post=%d',
     'capability_type' => 'post',
     'hierarchical' => false,
     'rewrite' => array("slug" => "testimonial"), // Permalinks format
     'supports' => array('title','thumbnail')
));


/*******************************************************************************************

Registers Service Post Type

********************************************************************************************/
$labels = array(
	'name' => _x('Service', 'post type general name', 'site5framework'),
    'singular_name' => _x('Service', 'post type singular name', 'site5framework'),
    'add_new' => _x('Add New', 'service', 'site5framework'),
    'add_new_item' => __('Add New Service', 'site5framework'),
    'edit_item' => __('Edit Service', 'site5framework'),
    'new_item' => __('New Service', 'site5framework'),
    'view_item' => __('View Service', 'site5framework'),
    'search_items' => __('Search Service', 'site5framework'),
    'not_found' =>  __('No Service found', 'site5framework'),
    'not_found_in_trash' => __('No Service found in Trash', 'site5framework'),
    'parent_item_colon' => ''
  );

register_post_type('service', array(
     'labels' => $labels,
     'singular_label' => __('service'),
     'public' => true,
     'show_ui' => true, // UI in admin panel
     '_builtin' => false, // It's a custom post type, not built in!
     '_edit_link' => 'post.php?post=%d',
     'capability_type' => 'post',
     'hierarchical' => false,
     'rewrite' => array("slug" => "service"), // Permalinks format
     'supports' => array('title','editor','thumbnail')
));


//  Add Columns to Portfolio Edit Screen
function portfolio_edit_columns($portfolio_columns){
	$portfolio_columns = array(
		"cb" 				=> "<input type=\"checkbox\" />",
		"title" 			=> __('Title', 'site5framework'),
		"portfolio-tags" 	=> __('Tags', 'site5framework'),
		"author" 			=> __('Author', 'site5framework'),
		"comments" 			=> __('Comments', 'site5framework'),
		"date" 				=> __('Date', 'site5framework'),
	);
	$portfolio_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
	return $portfolio_columns;
}



// Styling for the custom post type icon
add_action( 'admin_head', 'wpt_work_icons' );

function wpt_work_icons() {
    ?>
    <style type="text/css" media="screen">
        #menu-posts-work .wp-menu-image {
            background: url(<?php echo get_template_directory_uri(); ?>/admin/images/portfolio-icon.png) no-repeat 6px 6px !important;
        }
		#menu-posts-work:hover .wp-menu-image, #menu-posts-work.wp-has-current-submenu .wp-menu-image {
            background-position:6px -16px !important;
        }
		#icon-edit.icon32-posts-work {background: url(<?php echo get_template_directory_uri(); ?>/admin/images/portfolio-32x32.png) no-repeat;}
    </style>

<?php
}

// Styling for the custom post type icon
add_action( 'admin_head', 'wpt_slider_icons' );

function wpt_slider_icons() {
    ?>
    <style type="text/css" media="screen">
        #menu-posts-slider .wp-menu-image {
            background: url(<?php echo get_template_directory_uri(); ?>/admin/images/slider-icon.png) no-repeat 6px 6px !important;
        }
		#menu-posts-slider:hover .wp-menu-image, #menu-posts-slider.wp-has-current-submenu .wp-menu-image {
            background-position:6px -16px !important;
        }
		#icon-edit.icon32-posts-slider {background: url(<?php echo get_template_directory_uri(); ?>/admin/images/slider-32x32.png) no-repeat;}
    </style>
<?php }
?>