<?php
/*-----------------------------------------------------------------------------------*/
/*	List Posts Config
/*-----------------------------------------------------------------------------------*/


//allow possibility to overite/extend the shortcode parameters from the theme, 
// if you want to to change the default behaviour for list-posts shortcode, you need to create a function 
// in your theme/plugin called 'cosmo_set_list_posts_shortcode', the function should return an array in hte same form as the one bellow

if(function_exists('cosmo_set_list_posts_shortcode')){
    $cosmo_shortcodes['list-posts'] = cosmo_set_list_posts_shortcode();
}else{



    $cosmo_shortcodes['list-posts'] = array(
        'no_preview' => true,
        'params' => array(


            'post_type' => array(
                'type' => 'select',
                'label' => __('Post type', 'textdomain'),
                'desc' => __('Select the post type you want to be displayed', 'textdomain'),
                'options' => cosmo_get_post_types()
            ),
            'taxonomy' => array(
                'type' => 'select',
                'label' => __('Taxonomy', 'textdomain'),
                'desc' => __('Select All to retrieve all the posts, or you can select a taxonomy beloging to a post type selected above.', 'textdomain'),
                'options' =>  array( ''=>__('All','textdomain'), 'category'=>'category', 'post_tag' => 'post_tag') // by default we show onlt taxonomies for the 'post' type
            ),
            'term_name' => array(
                'std' => '',
                'type' => 'text',
                'label' => __('Term name ', 'textdomain'),
                'desc' => __('If taxonomy parameter is not set to All, then you should set here the name of the term from which you want to retrieve the posts. For example if "category" is selected as taxonomy, you can type here "uncategorized" to get posts from that category.', 'textdomain'),

            ),
            'view_type' => array(
                'type' => 'select',
                'label' => __('View type', 'textdomain'),
                'desc' => '',
                'options' => cosmo_get_view_types(),
                'action' => "actionSelect( '#cosmo_view_type' , { 'cosmo-list-view' : '.number-columns' } , 'hs_' );" // we want to show/hide the row with class '.number-columns' when the selected value is changed
            ),
            'number_columns' => array(
                'type' => 'select',
                'label' => __('Number of columns', 'textdomain'),
                'desc' => '',
                'class' => ' number-columns ', // additional class to settings row, this class is used to show/hide this settings depending on view type value
                'hide_default' => true,        // we want to hide this option by default, because we need it only for grid and thumb view, and by default we have list view
                'options' => array(
                    '2'=>2,
                    '3'=>3,
                    '4'=>4
                )
            ),
            'post_in' => array(
                'std' => '',
                'type' => 'text',
                'label' => __('Post in', 'textdomain'),
                'desc' => 'Add your post ids. If you added post ids to this field, categories will be ignored. Example: 41,22'
            ),
            'number_posts' => array(
                'std' => '',
                'type' => 'text',
                'label' => __('Number of posts', 'textdomain'),
                'desc' => ''
            ),

            'pagination' => array(
                'type' => 'select',
                'label' => __('Paginationn', 'textdomain'),
                'desc' => '',
                'options' => array(
                    'none'=>__('None', 'textdomain'),
                    'pagination'=>__('Enable pagination', 'textdomain')
                )
            ),

            'orderby' => array(
                'type' => 'select',
                'label' => __('Order by', 'textdomain'),
                'options' => cosmo_get_order_by_options(),
                'desc' => ''
            ),
            'order' => array(
                'type' => 'select',
                'label' => __('Order', 'textdomain'),
                'desc' => '',
                'options' => array(
                    'DESC'=>__('Descending','textdomain'),
                    'ASC'=>__('Ascending','textdomain')
                )
            ),


        ),
        'shortcode' => '[flo_list_posts
							post_type="{{post_type}}" 
							taxonomy="{{taxonomy}}" 
							term_name="{{term_name}}" 
							view_type="{{view_type}}" 
							number_columns="{{number_columns}}" 
							number_posts="{{number_posts}}" 
							orderby="{{orderby}}" 
							order="{{order}}"
							post_in="{{post_in}}"
	 						pagination="{{pagination}}"
							]
						[/flo_list_posts]',
        'popup_title' => __('Insert List Posts Shortcode', 'textdomain')
    );
}
/*-----------------------------------------------------------------------------------*/
/*	Image & text  -  this shorcode wil allow to have an image and some text description. 
/*  The image can be on hte left or right side
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['image_text'] = array(
    'no_preview' => true,
    'params' => array(
        'image_url' => array(
            'std' => '',
            'type' => 'image',
            'label' => __('Image', 'textdomain'),
            'desc' => ''
        ),
        'img_position' => array(
            'type' => 'select',
            'label' => __('Image alignement', 'textdomain'),
            'desc' => __('Select the Image alignement, on the left or on the right', 'textdomain'),
            'options' => array(
                'left' => __('Left', 'textdomain'),
                'right' => __('Right', 'textdomain')
            )
        ),
        'img_width' => array(
            'std' => '50',
            'type' => 'text',
            'label' => __('Image width (in %)', 'textdomain'),
            'desc' => 'Set the image container width, by deault it is 50, which means 50%. The remaining width will be use for the text.'
        ),
        'content' => array(
            'std' => '',
            'type' => 'textarea',
            'label' => __('Description', 'textdomain'),
            'desc' => ''
        )


    ),
    'shortcode' => '[flo_image_text image_url="{{image_url}}" img_position="{{img_position}}" img_width="{{img_width}}"  ] {{content}} [/flo_image_text]',
    'popup_title' => __('Insert Image&Text Shortcode', 'textdomain')
);
/*-----------------------------------------------------------------------------------*/
/*	Team shortcode
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['team_member'] = array(
    'no_preview' => true,
    'params' => array(
        'image_url' => array(
            'std' => '',
            'type' => 'image',
            'label' => __('Image', 'textdomain'),
            'desc' => ''
        ),
        'name' => array(
            'std' => '',
            'type' => 'text',
            'label' => __('Name', 'textdomain'),
            'desc' => ''
        ),
        'job' => array(
            'std' => '',
            'type' => 'text',
            'label' => __('Job position', 'textdomain'),
            'desc' => ''
        ),
        'description' => array(
            'std' => '',
            'type' => 'textarea',
            'label' => __('Description', 'textdomain'),
            'desc' => ''
        ),
        'social' => array(
            'std' => '',
            'type' => 'textarea',
            'label' => __('Social media', 'textdomain'),
            'desc' => __('Enter any social media links with a comma separated list. e.g. Facebook,http://facebook.com <br/> Twitter,http://twitter.com. <br/>Each profile account should be in a new line, and do not use any spaces between social service name and its link.', 'textdomain')
        )

    ),
    'shortcode' => '[flo_team_member image_url="{{image_url}}" name="{{name}}" job="{{job}}" description="{{description}}" social="{{social}}"  ]',
    'popup_title' => __('Insert Team Member Shortcode', 'textdomain')
);

/*-----------------------------------------------------------------------------------*/
/*	Box shortcode
/*-----------------------------------------------------------------------------------*/

if(function_exists('cosmo_set_box_shortcode')){
    $cosmo_shortcodes['box'] = cosmo_set_box_shortcode();
}else{
    $cosmo_shortcodes['box'] = array(
        'no_preview' => true,
        'params' => array(

            'box_bg_color' => array(
                'std' => '#fff',
                'type' => 'colorpicker',
                'label' => __('Background color', 'textdomain'),
                'desc' => ''
            ),
            'box_text_color' => array(
                'std' => '#000',
                'type' => 'colorpicker',
                'label' => __('Text color', 'textdomain'),
                'desc' => ''
            ),


        ),
        'shortcode' => '[flo_box box_bg_color="{{box_bg_color}}" box_text_color="{{box_text_color}}" ]'.__('Add your content here','textdomain').'[/flo_box]',
        'popup_title' => __('Insert Box Shortcode', 'textdomain')
    );
}

/*-----------------------------------------------------------------------------------*/
/*	CONTACT FORM shortcode
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['contact_form'] = array(
    'no_preview' => true,
    'params' => array(

        'email' => array(
            'std' => '',
            'type' => 'text',
            'label' => __('Email', 'textdomain'),
            'desc' => __('Add here the email address where the messages will be sent.', 'textdomain')
        ),


    ),
    'shortcode' => '[flo_contact_form  email={{email}} ]',
    'popup_title' => __('Insert Contact Form Shortcode', 'textdomain')
);
/*-----------------------------------------------------------------------------------*/
/*	Button Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['button'] = array(
    'no_preview' => true,
    'params' => array(
        'url' => array(
            'std' => '',
            'type' => 'text',
            'label' => __('Button URL', 'textdomain'),
            'desc' => __('Add the button\'s url eg http://example.com', 'textdomain')
        ),
        'style' => array(
            'type' => 'select',
            'label' => __('Button Style', 'textdomain'),
            'desc' => __('Select the button\'s style, ie the button\'s colour', 'textdomain'),
            'options' => array(
                'grey' => 'Grey',
                'black' => 'Black',
                'green' => 'Green',
                'light-blue' => 'Light Blue',
                'blue' => 'Blue',
                'red' => 'Red',
                'orange' => 'Orange',
                'purple' => 'Purple'
            )
        ),
        'size' => array(
            'type' => 'select',
            'label' => __('Button Size', 'textdomain'),
            'desc' => __('Select the button\'s size', 'textdomain'),
            'options' => array(
                'small' => 'Small',
                'medium' => 'Medium',
                'large' => 'Large'
            )
        ),
        'type' => array(
            'type' => 'select',
            'label' => __('Button Type', 'textdomain'),
            'desc' => __('Select the button\'s type', 'textdomain'),
            'options' => array(
                'round' => 'Round',
                'square' => 'Square'
            )
        ),
        'target' => array(
            'type' => 'select',
            'label' => __('Button Target', 'textdomain'),
            'desc' => __('_self = open in same window. _blank = open in new window', 'textdomain'),
            'options' => array(
                '_self' => '_self',
                '_blank' => '_blank'
            )
        ),
        'content' => array(
            'std' => 'Button Text',
            'type' => 'text',
            'label' => __('Button\'s Text', 'textdomain'),
            'desc' => __('Add the button\'s text', 'textdomain'),
        )
    ),
    'shortcode' => '[flo_button url="{{url}}" style="{{style}}" size="{{size}}" type="{{type}}" target="{{target}}"] {{content}} [/flo_button]',
    'popup_title' => __('Insert Button Shortcode', 'textdomain')
);

/*-----------------------------------------------------------------------------------*/
/*	Alert Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['alert'] = array(
    'no_preview' => true,
    'params' => array(
        'style' => array(
            'type' => 'select',
            'label' => __('Alert Style', 'textdomain'),
            'desc' => __('Select the alert\'s style, ie the alert colour', 'textdomain'),
            'options' => array(
                'white' => 'White',
                'grey' => 'Grey',
                'red' => 'Red',
                'yellow' => 'Yellow',
                'green' => 'Green'
            )
        ),
        'content' => array(
            'std' => 'Your Alert!',
            'type' => 'textarea',
            'label' => __('Alert Text', 'textdomain'),
            'desc' => __('Add the alert\'s text', 'textdomain'),
        )

    ),
    'shortcode' => '[flo_alert style="{{style}}"] {{content}} [/flo_alert]',
    'popup_title' => __('Insert Alert Shortcode', 'textdomain')
);

/*-----------------------------------------------------------------------------------*/
/*	Toggle Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['toggle'] = array(
    'no_preview' => true,
    'params' => array(
        'title' => array(
            'type' => 'text',
            'label' => __('Toggle Content Title', 'textdomain'),
            'desc' => __('Add the title that will go above the toggle content', 'textdomain'),
            'std' => 'Title'
        ),
        'content' => array(
            'std' => 'Content',
            'type' => 'textarea',
            'label' => __('Toggle Content', 'textdomain'),
            'desc' => __('Add the toggle content. Will accept HTML', 'textdomain'),
        ),
        'state' => array(
            'type' => 'select',
            'label' => __('Toggle State', 'textdomain'),
            'desc' => __('Select the state of the toggle on page load', 'textdomain'),
            'options' => array(
                'open' => 'Open',
                'closed' => 'Closed'
            )
        ),

    ),
    'shortcode' => '[flo_toggle title="{{title}}" state="{{state}}"] {{content}} [/flo_toggle]',
    'popup_title' => __('Insert Toggle Content Shortcode', 'textdomain')
);

/*-----------------------------------------------------------------------------------*/
/*	Tabs Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['tabs'] = array(
    'params' => array(),
    'no_preview' => true,
    'shortcode' => '[flo_tabs] {{child_shortcode}}  [/flo_tabs]',
    'popup_title' => __('Insert Tab Shortcode', 'textdomain'),

    'child_shortcode' => array(
        'params' => array(
            'title' => array(
                'std' => 'Title',
                'type' => 'text',
                'label' => __('Tab Title', 'textdomain'),
                'desc' => __('Title of the tab', 'textdomain'),
            ),
            'content' => array(
                'std' => 'Tab Content',
                'type' => 'textarea',
                'label' => __('Tab Content', 'textdomain'),
                'desc' => __('Add the tabs content', 'textdomain')
            )
        ),
        'shortcode' => '[flo_tab title="{{title}}"] {{content}} [/flo_tab]',
        'clone_button' => __('Add Tab', 'textdomain')
    )
);

/*-----------------------------------------------------------------------------------*/
/*	Columns Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['columns'] = array(
    'params' => array(),
    'shortcode' => ' {{child_shortcode}} ', // as there is no wrapper shortcode
    'popup_title' => __('Insert Columns Shortcode', 'textdomain'),
    'no_preview' => true,

    // child shortcode is clonable & sortable
    'child_shortcode' => array(
        'params' => array(
            'column' => array(
                'type' => 'select',
                'label' => __('Column Type', 'textdomain'),
                'desc' => __('Select the type, ie width of the column.', 'textdomain'),
                'options' => array(
                    'flo_one_third' => 'One Third',
                    'flo_one_third_last' => 'One Third Last',
                    'flo_two_third' => 'Two Thirds',
                    'flo_two_third_last' => 'Two Thirds Last',
                    'flo_one_half' => 'One Half',
                    'flo_one_half_last' => 'One Half Last',
                    'flo_one_fourth' => 'One Fourth',
                    'flo_one_fourth_last' => 'One Fourth Last',
                    'flo_three_fourth' => 'Three Fourth',
                    'flo_three_fourth_last' => 'Three Fourth Last',
                    'flo_one_fifth' => 'One Fifth',
                    'flo_one_fifth_last' => 'One Fifth Last',
                    'flo_two_fifth' => 'Two Fifth',
                    'flo_two_fifth_last' => 'Two Fifth Last',
                    'flo_three_fifth' => 'Three Fifth',
                    'flo_three_fifth_last' => 'Three Fifth Last',
                    'flo_four_fifth' => 'Four Fifth',
                    'flo_four_fifth_last' => 'Four Fifth Last',
                    'flo_one_sixth' => 'One Sixth',
                    'flo_one_sixth_last' => 'One Sixth Last',
                    'flo_five_sixth' => 'Five Sixth',
                    'flo_five_sixth_last' => 'Five Sixth Last'
                )
            ),
            'content' => array(
                'std' => '',
                'type' => 'textarea',
                'label' => __('Column Content', 'textdomain'),
                'desc' => __('Add the column content.', 'textdomain'),
            ),

            'padding' => array(
                'std' => '20px 20px 20px 20px',
                'type' => 'text',
                'label' => __('Padding', 'textdomain'),
                'desc' => __('The padding used inside the box, by default 20px. The values are for top, right, bottom, and left padding.', 'textdomain'),

            ),
            'class' => array(
                'std' => '',
                'type' => 'text',
                'label' => __('Class', 'textdomain'),
                'desc' => __('Custom css class. You can add it if you want to add custom css style to this column.', 'textdomain'),

            ),
        ),
        'shortcode' => '[{{column}} padding="{{padding}}" class="{{class}}" ] {{content}} [/{{column}}] ',
        'clone_button' => __('Add Column', 'textdomain')
    )
);

/*-----------------------------------------------------------------------------------*/
/*  Video Config
/*-----------------------------------------------------------------------------------*/

$cosmo_shortcodes['video'] = array(
    'no_preview' => true,
    'params' => array(
        'content' => array(
            'std' => '',
            'type' => 'textarea',
            'label' => __('Video URL', 'textdomain'),
            'desc' => __('Add the URL to the video you want to embed (YouTube, Vimeo, Dailymotion and Vine are supported)', 'textdomain'),
        )
        
    ),
    'shortcode' => '[flo_video] {{content}} [/flo_video]',
    'popup_title' => __('Insert Video Shortcode', 'textdomain')
);

?>