<?php
/*
 * Element Tz Portfolio Grid
 * */

function interiart_get_events_data() {
        $posts = get_posts( array(
            'posts_per_page'   => -1,
            'post_type'        => 'portfolio',
        ));
        $result = array();
        foreach ( $posts as $post )	{
                $result[] = array(
                    'value' => $post->ID,
                    'label' => $post->post_title,
                );
        }
        return $result;
}

$tzportfolio_cat = array();
$cate_portfolio = get_categories(array('taxonomy'=>'portfolio-category'));

foreach ($cate_portfolio as $cat){
    $tzportfolio_cat[$cat->name] = $cat->term_id;
}

vc_map( array(
    "name"          => esc_html__("View Portfolio", "tz-interiart"),
    "icon"          => "icon-element",
    "base"          => "tz-view-portfolio",
    "weight"        => 11,
    "description"   => "",
    "class"         => "tzElement_extended",
    "category"      => esc_html__("Built for Templaza", "tz-interiart"),
    "params"        => array(
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Portfolio Type", "tz-interiart"),
            "param_name"    => "tz_type",
            "value"         => array(
                esc_html__("Grid", "tz-interiart") => 'grid',
                esc_html__("Grid Special", "tz-interiart") => 'grid-special',
                esc_html__("Carousel Slider", "tz-interiart") => "carousel",
                esc_html__("Carousel Slider Special", "tz-interiart") => "carousel-special",
                esc_html__("Carousel Slider Center", "tz-interiart") => "carousel-center",
                esc_html__("Slick Slider", "tz-interiart") => 'slick',
                esc_html__("Slick Slider Special", "tz-interiart") => 'slick-special',
                esc_html__("Column", "tz-interiart") => 'column',
            ),

            "description"   => "",
        ),
        array(
            "type" => "textfield",
            "holder" => "div",
            "class" => "",
            "admin_label" => true,
            "heading" => esc_html__("Section Title", "tz-interiart"),
            "param_name" => "tz_title",
            "dependency"    => array('element' => 'tz_type', 'value' => array('column')),
            "value" => "",
        ),
        array(
            "type" => "textarea",
            "class" => "",
            "admin_label" => true,
            "heading" => esc_html__("Description", "tz-interiart"),
            "param_name" => "tz_description",
            "dependency"    => array('element' => 'tz_type', 'value' => array('column')),
            "value" => "",
        ),
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Style", "tz-interiart"),
            "param_name"    => "tz_style",
            "value"         => array(
                esc_html__("default", "tz-interiart") => 'default',
                esc_html__("Modern", "tz-interiart") => 'modern'),
            "description"   => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special')),
        ),
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => false,
            "heading"       => esc_html__("Color Type", "tz-interiart"),
            "param_name"    => "tz_color_type",
            "value"         => array(
                esc_html__("Light", "tz-interiart") => 'light',
                esc_html__("Dark", "tz-interiart") => "dark"),
            "description"   => "",
            "dependency" => Array('element' => 'tz_filter_option', 'value' => 'show')
        ),
        array(
            "type" => "checkbox",
            "class" => "",
            "admin_label" => true,
            "heading" =>  esc_html__("Portfolio Categories", "tz-interiart"),
            "param_name" => "tz_category",
            "value" => $tzportfolio_cat,
            "description" => esc_html__("Select category portfolio.", "tz-interiart"),
            "dependency" => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special', 'carousel-center','column')),
        ),
        array(
            "type" => "colorpicker",
            "class" => "",
            "admin_label" => true,
            "heading" =>  esc_html__("Portfolio title color", "tz-interiart"),
            "param_name" => "tz_title_color",
            "value" =>'',
            "dependency" => array('element' => 'tz_type', 'value' => array('carousel-center')),
        ),
        array(
            'type'          => 'autocomplete',
            'heading'       => __( 'Include Portfolio', 'tz-interiart' ),
            'param_name'    => 'tz_include_portfolio',
            'admin_label'   =>  true,
            'description'   => __( 'Add Portfolio by title.', 'tz-interiart' ),
            'settings'      => array(
                'multiple'  => true,
                'sortable'  => true,
                'groups'    => true,
                'values'    => interiart_get_events_data()
            ),
            "dependency"    => array('element' => 'tz_type', 'value' => array('carousel-special')),
        ),
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Show Or Hide Filter", "tz-interiart"),
            "param_name"    => "tz_filter_option",
            "value"         => array(
                esc_html__("Choose option", "tz-interiart")  => '',
                esc_html__("Show", "tz-interiart")           => 'show',
                esc_html__("Hide", "tz-interiart")           => "hide"),
            "description"   => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special')),
        ),
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Filter Type", "tz-interiart"),
            "param_name"    => "tz_filter_type",
            "value"         => array(
                esc_html__("Choose filter type", "tz-interiart") => '',
                esc_html__("Portfolio Category", "tz-interiart") => 'portfolio-category',
                esc_html__("Portfolio Tags", "tz-interiart") => "portfolio-tags"),
            "description"   => "",
            "dependency" => Array('element' => 'tz_filter_option', 'value' => 'show')
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Limit", "tz-interiart"),
            "param_name"    => "tz_limit",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special','carousel-center','column')),
        ),
        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Order by", "tz-interiart"),
            "param_name"    => "tz_orderby",
            "value"         => array(
                esc_html__("Date", "tz-interiart") => 'date',
                esc_html__("ID", "tz-interiart") => "id",
                esc_html__("Title", "tz-interiart") => "title"),
            "description"   => "",
            "dependency" => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel', 'carousel-center','slick','slick-special')),
        ),

        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Order", "tz-interiart"),
            "param_name"    => "tz_order",
            "value"         => array(
                esc_html__("Descending", "tz-interiart") => 'desc',
                esc_html__("Ascending", "tz-interiart") => "asc"),
            "description"   => "",
            "dependency" => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special','carousel-center')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Number Column Of Desktop", "tz-interiart"),
            "param_name"    => "tz_col_desktop",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Number Column Of Tablet Portrait", "tz-interiart"),
            "param_name"    => "tz_col_tabletportrait",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Number Column Of Mobile Landscape", "tz-interiart"),
            "param_name"    => "tz_col_mobilelandscape",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Number column of Mobile", "tz-interiart"),
            "param_name"    => "tz_col_mobile",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special')),
        ),

        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Show Or Hide Button", "tz-interiart"),
            "param_name"    => "tz_button_option",
            "value"         => array(
                esc_html__("Choose option", "tz-interiart") => '',
                esc_html__("Show", "tz-interiart") => 'show',
                esc_html__("Hide", "tz-interiart") => "hide"),
            "description"   => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special','carousel','slick','slick-special','carousel-center')),
        ),

        array(
            "type"          => "dropdown",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Button Link Option", "tz-interiart"),
            "param_name"    => "tz_button_link_option",
            "value"         => array(
                esc_html__("Load more on page", "tz-interiart") => 'loadmore',
                esc_html__("Custom Link", "tz-interiart") => "custom"),
            "description"   => "",
            "dependency"    => array('element' => 'tz_button_option', 'value' => array('show')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Custom Link", "tz-interiart"),
            "param_name"    => "tz_custom_link",
            "value"         => "",
            "dependency"    => array('element' => 'tz_button_link_option', 'value' => array('custom')),
        ),

        array(
            "type"          => "textfield",
            "class"         => "",
            "admin_label"   => true,
            "heading"       => esc_html__("Height Item", "tz-interiart"),
            "param_name"    => "tz_height_item",
            "value"         => "",
            "dependency"    => array('element' => 'tz_type', 'value' => array('grid','grid-special')),
        ),
        array(
            "type" => "dropdown",
            "class" => "",
            "admin_label" => false,
            "heading"       => esc_html__("Option Readmore", "tz-interiart"),
            "param_name"    => "tz_option_readmore",
            "description"   => esc_html__("You can choose show or hide button readmore.", "tz-interiart"),
            "dependency"    => array('element' => 'tz_type', 'value' => array('column')),
            "value"         => array(
                esc_html__("Show", "tz-interiart") => 'show',
                esc_html__("Hide", "tz-interiart") => 'hide')
        ),

        array(
            "type" => "textfield",
            "class" => "",
            "admin_label" => false,
            "heading" => esc_html__("Readmore Text", "tz-interiart"),
            "param_name" => "tz_readmore_text",
            "value" => "",
            "dependency" => Array('element' => "tz_option_readmore", 'value' => array('show')),
        ),

        array(
            "type" => "textfield",
            "class" => "",
            "admin_label" => false,
            "heading" => esc_html__("Readmore Link", "tz-interiart"),
            "param_name" => "tz_readmore_link",
            "value" => "",
            "dependency" => Array('element' => "tz_option_readmore", 'value' => array('show')),
        ),
        array(
            "type" => "dropdown",
            "class" => "",
            "admin_label" => true,
            "heading"       => esc_html__("Css Animation", "tz-interiart"),
            "param_name"    => "tz_css_animation",
            "description"   => "",
            "value"         => array(
                esc_html__("No animation", "tz-interiart")           => '',
                esc_html__("Top to bottom", "tz-interiart")          => 'top-to-bottom',
                esc_html__("Bottom to top", "tz-interiart")          => 'bottom-to-top',
                esc_html__("Left to right", "tz-interiart")          => 'left-to-right',
                esc_html__("Right to left", "tz-interiart")          => 'right-to-left',
                esc_html__("Appear from center", "tz-interiart")     => 'appear'),
        ),
        array(
            'type' => 'css_editor',
            'heading' => esc_html__('CSS box', 'tz-interiart'),
            'param_name' => 'css',
            'group' => esc_html__('Design Options', 'tz-interiart'),
        ),
    )
));

?>