<?php

namespace Dispatch\Config;

use Dispatch\PostTypes\News as News;
use Dispatch\PostTypes\Updates as Updates;
use Dispatch\PostTypes\Maps as Maps;
use Dispatch\PostTypes\Community as Community;
use Dispatch\PostTypes\Media as Media;
use Dispatch\PostTypes\FAQ as FAQ;
use Dispatch\PostTypes\Gallery as Gallery;

class CustomTaxonomies {

    public function __construct() {
    }

    public static function register_news_types() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'News Types', 'taxonomy general name', 'mediatypes' ),
                'singular_name'     => _x( 'News Type', 'taxonomy singular name', 'mediatypes' ),
                'search_items'      => __( 'Search News Types', 'mediatypes' ),
                'all_items'         => __( 'All News Types', 'mediatypes' ),
                'parent_item'       => __( 'Parent News Type', 'mediatypes' ),
                'parent_item_colon' => __( 'Parent News Type:', 'mediatypes' ),
                'edit_item'         => __( 'Edit News Type', 'mediatypes' ),
                'update_item'       => __( 'Update News Type', 'mediatypes' ),
                'add_new_item'      => __( 'Add New News Type', 'mediatypes' ),
                'new_item_name'     => __( 'New News Type Name', 'mediatypes' ),
                'menu_name'         => __( 'News Types', 'mediatypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => false,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'news-types', array( News::this_post_type() ), $args );
        });

    }

    public static function register_media_types() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'Media Types', 'taxonomy general name', 'mediatypes' ),
                'singular_name'     => _x( 'Media Type', 'taxonomy singular name', 'mediatypes' ),
                'search_items'      => __( 'Search Media Types', 'mediatypes' ),
                'all_items'         => __( 'All Media Types', 'mediatypes' ),
                'parent_item'       => __( 'Parent Media Type', 'mediatypes' ),
                'parent_item_colon' => __( 'Parent Media Type:', 'mediatypes' ),
                'edit_item'         => __( 'Edit Media Type', 'mediatypes' ),
                'update_item'       => __( 'Update Media Type', 'mediatypes' ),
                'add_new_item'      => __( 'Add New Media Type', 'mediatypes' ),
                'new_item_name'     => __( 'New Media Type Name', 'mediatypes' ),
                'menu_name'         => __( 'Media Types', 'mediatypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => false,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'media-types', array( Media::this_post_type() ), $args );
        });

    }

    public static function register_map_types() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'Map Types', 'taxonomy general name', 'maptypes' ),
                'singular_name'     => _x( 'Map Type', 'taxonomy singular name', 'maptypes' ),
                'search_items'      => __( 'Search Map Types', 'maptypes' ),
                'all_items'         => __( 'All Map Types', 'maptypes' ),
                'parent_item'       => __( 'Parent Map Type', 'maptypes' ),
                'parent_item_colon' => __( 'Parent Map Type:', 'maptypes' ),
                'edit_item'         => __( 'Edit Map Type', 'maptypes' ),
                'update_item'       => __( 'Update Map Type', 'maptypes' ),
                'add_new_item'      => __( 'Add New Map Type', 'maptypes' ),
                'new_item_name'     => __( 'New Map Type Name', 'maptypes' ),
                'menu_name'         => __( 'Map Types', 'maptypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => true,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'map-types', array( Maps::this_post_type() ), $args );
        });

    }

    public static function register_faq_types() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'FAQ Types', 'taxonomy general name', 'faqtypes' ),
                'singular_name'     => _x( 'FAQ Type', 'taxonomy singular name', 'faqtypes' ),
                'search_items'      => __( 'Search FAQ Types', 'faqtypes' ),
                'all_items'         => __( 'All FAQ Types', 'faqtypes' ),
                'parent_item'       => __( 'Parent FAQ Type', 'faqtypes' ),
                'parent_item_colon' => __( 'Parent FAQ Type:', 'faqtypes' ),
                'edit_item'         => __( 'Edit FAQ Type', 'faqtypes' ),
                'update_item'       => __( 'Update FAQ Type', 'faqtypes' ),
                'add_new_item'      => __( 'Add New FAQ Type', 'faqtypes' ),
                'new_item_name'     => __( 'New FAQ Type Name', 'faqtypes' ),
                'menu_name'         => __( 'FAQ Types', 'faqtypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => true,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'faq-types', array( FAQ::this_post_type() ), $args );
        });

    }

    public static function register_gallery_types() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'Gallery Types', 'taxonomy general name', 'gallerytypes' ),
                'singular_name'     => _x( 'Gallery Type', 'taxonomy singular name', 'gallerytypes' ),
                'search_items'      => __( 'Search Gallery Types', 'gallerytypes' ),
                'all_items'         => __( 'All Gallery Types', 'gallerytypes' ),
                'parent_item'       => __( 'Parent Gallery Type', 'gallerytypes' ),
                'parent_item_colon' => __( 'Parent Gallery Type:', 'gallerytypes' ),
                'edit_item'         => __( 'Edit Gallery Type', 'gallerytypes' ),
                'update_item'       => __( 'Update Gallery Type', 'gallerytypes' ),
                'add_new_item'      => __( 'Add New Gallery Type', 'gallerytypes' ),
                'new_item_name'     => __( 'New Gallery Type Name', 'gallerytypes' ),
                'menu_name'         => __( 'Gallery Types', 'gallerytypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => true,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'gallery-types', array( Gallery::this_post_type() ), $args );
        });

    }


    public static function register_gallery_dates() {

        add_action( 'init', function() {
            $labels = array(
                'name'              => _x( 'Gallery Dates', 'taxonomy general name', 'gallerytypes' ),
                'singular_name'     => _x( 'Gallery Dates', 'taxonomy singular name', 'gallerytypes' ),
                'search_items'      => __( 'Search Gallery Dates', 'gallerytypes' ),
                'all_items'         => __( 'All Gallery Dates', 'gallerytypes' ),
                'parent_item'       => __( 'Parent Gallery Date', 'gallerytypes' ),
                'parent_item_colon' => __( 'Parent Gallery Date:', 'gallerytypes' ),
                'edit_item'         => __( 'Edit Gallery Date', 'gallerytypes' ),
                'update_item'       => __( 'Update Gallery Date', 'gallerytypes' ),
                'add_new_item'      => __( 'Add New Gallery Date', 'gallerytypes' ),
                'new_item_name'     => __( 'New Gallery Date Name', 'gallerytypes' ),
                'menu_name'         => __( 'Gallery Dates', 'gallerytypes' ),
            );

            $args = array(
                'hierarchical'      => true,
                'public'            => true,
                'labels'            => $labels,
                'show_ui'           => true,
                'show_admin_column' => false,
                'query_var'         => true,
                'show_in_nav_menus' => false
            );

            register_taxonomy( 'gallery-dates', array( Gallery::this_post_type() ), $args );
        });

    }

}
