<?php
/**
 * Initialize the custom Meta Boxes.
 */
add_action( 'admin_init', 'custom_meta_boxes' );

/**
 * Meta Boxes.
 *
 * @return    void
 * @since     2.0
 */
function custom_meta_boxes() {

  $pageheader_meta_box = array(
    'id'          => 'pageheader_meta_box',
    'title'       => esc_html__( 'Parameters for "Default page with a header image" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'id'          => 'uni_default_page_header_bg',
        'label'       => '',
        'std'         => '',
        'type'        => 'upload',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => 'ot-upload-attachment-id',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_default_page_header_title_color',
        'label'       => esc_html__( 'Colour of page header title', 'asana' ),
        'desc'        => esc_html__( 'Default is "white". You can choose another colour for this text.', 'asana' ),
        'std'         => '#ffffff',
        'type'        => 'colorpicker',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      )
    )
  );

  $about_meta_box = array(
    'id'          => 'about_meta_box',
    'title'       => esc_html__( 'Parameters for "About" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'id'          => 'uni_about_page_header_bg',
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Page header image on About page" for this page.', 'asana' ),
        'std'         => '',
        'type'        => 'upload',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => 'ot-upload-attachment-id',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Page header title (H1)', 'asana' ),
        'id'          => 'uni_about_page_header_title',
        'type'        => 'text',
        'desc'        => esc_html__( 'This option overrides global option "Page header title on About page" for this page.', 'asana' ),
        'std'         => ''
      ),
      array(
        'id'          => 'uni_about_page_header_title_color',
        'label'       => esc_html__( 'Colour of page header title', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Colour of page header title on About page" for this page. Default is "white". You can choose another colour for this text.', 'asana' ),
        'std'         => '#ffffff',
        'type'        => 'colorpicker',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( '"Meet our team"', 'asana' ),
        'id'          => 'tab_team_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable "meet our team" block?', 'asana' ),
        'id'          => 'uni_meet_team_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Show or hide "meet our team" block', 'asana' ),
        'std'         => 'on'
      ),
      array(
        'label'       => esc_html__( 'Title for "meet our team" block', 'asana' ),
        'id'          => 'uni_meet_team_title',
        'type'        => 'text',
        'desc'        => esc_html__( 'Add title for "meet our team" block', 'asana' ),
        'std'         => 'meet our team'
      ),
      array(
        'id'          => 'uni_meet_team_members',
        'label'       => __( 'Choose users to be displayed on this page', 'asana' ),
        'desc'        => esc_html__( 'This block displays all users with "instructor" role by default. You can choose to display only certain users.', 'asana' ),
        'std'         => '',
        'type'        => 'uni-users-type-checkbox',
        'section'     => 'option_types',
        'post_type'   => 'instructor',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Center blocks with users?', 'asana' ),
        'id'          => 'uni_meet_team_center_users_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Can be useful if you want to display the number of users that is not a multiple of 5. In this case, the blocks with users will be centered instead of floating on the left of the page.', 'asana' ),
        'std'         => 'off'
      ),
      array(
        'label'       => esc_html__( 'Values section', 'asana' ),
        'id'          => 'tab_values_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable Values section on "About" page?', 'asana' ),
        'id'          => 'uni_about_values_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Show or hide Values section', 'asana' ),
        'std'         => 'on'
      ),
      array(
        'label'       => esc_html__( 'Title for Values section on "About" page', 'asana' ),
        'id'          => 'uni_about_values_title',
        'type'        => 'text',
        'desc'        => esc_html__( 'Add title for Values section. Default is "our values"', 'asana' ),
        'std'         => 'our values'
      ),
      array(
        'id'          => 'uni_about_values_posts',
        'label'       => __( 'Choose values (cpt) to be displayed on this page', 'asana' ),
        'desc'        => esc_html__( 'This block displays all values by default. You can choose to display only certain posts from cpt "Values".', 'asana' ),
        'std'         => '',
        'type'        => 'custom-post-type-checkbox',
        'section'     => 'option_types',
        'rows'        => '',
        'post_type'   => 'uni_value',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Instagram block', 'asana' ),
        'id'          => 'tab_instagram_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable Instagram block?', 'asana' ),
        'id'          => 'uni_instagram_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Show or hide Instagram block', 'asana' ),
        'std'         => 'on'
      )
    )
  );

  $contact_meta_box = array(
    'id'          => 'contact_meta_box',
    'title'       => esc_html__( 'Parameters for "Contact" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => '',
        'id'          => 'contact_textblock',
        'type'        => 'textblock',
        'desc'        => sprintf (esc_html__( 'Global options for this page is also located on <a href="%s">theme options page</a>. But here you can override global options on per page basis.', 'asana' ), trailingslashit(home_url()).'wp-admin/themes.php?page=ot-theme-options#section_contact' ),
        'operator'    => 'and',
        'condition'   => ''
      ),
      array(
        'id'          => 'uni_contact_page_header_bg',
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Page header image on Contact page" for this page.', 'asana' ),
        'std'         => '',
        'type'        => 'upload',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => 'ot-upload-attachment-id',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Page header title (H1)', 'asana' ),
        'id'          => 'uni_contact_page_header_title',
        'type'        => 'text',
        'desc'        => esc_html__( 'This option overrides global option "Page header title on Contact page" for this page.', 'asana' ),
        'std'         => ''
      ),
      array(
        'id'          => 'uni_contact_page_header_title_color',
        'label'       => esc_html__( 'Colour of page header title', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Colour of page header title on Contact page" for this page. Default is "white". You can choose another colour for this text.', 'asana' ),
        'std'         => '#ffffff',
        'type'        => 'colorpicker',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Contact page gallery', 'asana' ),
        'id'          => 'uni_gallery',
        'type'        => 'gallery',
        'desc'        => esc_html__( 'Images for a gallery (a little slider near the block with an address).', 'asana' ),
        'condition'   => ''
      ),
      array(
        'id'          => 'uni_contact_address',
        'label'       => esc_html__( 'Address to be displayed on this page', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Address on Contact page". You may use html tags: <code>br, em, strong, a</code>.', 'asana' ),
        'std'         => '',
        'type'        => 'text',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_contact_phone',
        'label'       => esc_html__( 'Phone number to be displayed on this page', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Phone number on Contact page". You may use html tags: <code>br, em, strong, a</code>.', 'asana' ),
        'std'         => '',
        'type'        => 'text',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_contact_email',
        'label'       => esc_html__( 'Email to be displayed on the "Contact Us" page', 'asana' ),
        'desc'        => esc_html__( 'Also an information submitted via contact form will be sent to this email address. This option overrides global option "Email for Contact page".', 'asana' ),
        'std'         => '',
        'type'        => 'text',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Map settings', 'asana' ),
        'id'          => 'tab_map_settings',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable map?', 'asana' ),
        'id'          => 'uni_map_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Show or hide map on this page.', 'asana' ),
        'std'         => 'on'
      ),
      array(
        'id'          => 'uni_contact_coordinates',
        'label'       => esc_html__( 'Google map coordinates for this page', 'asana' ),
        'desc'        => esc_html__( 'For example: "41.404182,2.199451". This option overrides global option "Google map coordinates"', 'asana' ),
        'std'         => '',
        'type'        => 'text',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_contact_zoom',
        'label'       => esc_html__( 'Google map zoom for this page', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Google map zoom"', 'asana' ),
        'std'         => '14',
        'type'        => 'select',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and',
        'choices'     => array(
          array(
            'value'       => '6',
            'label'       => '6',
            'src'         => ''
          ),
          array(
            'value'       => '7',
            'label'       => '7',
            'src'         => ''
          ),
          array(
            'value'       => '8',
            'label'       => '8',
            'src'         => ''
          ),
          array(
            'value'       => '9',
            'label'       => '9',
            'src'         => ''
          ),
          array(
            'value'       => '10',
            'label'       => '10',
            'src'         => ''
          ),
          array(
            'value'       => '11',
            'label'       => '11',
            'src'         => ''
          ),
          array(
            'value'       => '12',
            'label'       => '12',
            'src'         => ''
          ),
          array(
            'value'       => '13',
            'label'       => '13',
            'src'         => ''
          ),
          array(
            'value'       => '14',
            'label'       => '14',
            'src'         => ''
          ),
          array(
            'value'       => '15',
            'label'       => '15',
            'src'         => ''
          ),
          array(
            'value'       => '16',
            'label'       => '16',
            'src'         => ''
          ),
          array(
            'value'       => '17',
            'label'       => '17',
            'src'         => ''
          ),
        )
      ),
      array(
        'id'          => 'uni_marker_colour',
        'label'       => __( 'A colour for marker on this page', 'asana' ),
        'desc'        => __( 'Choose a colour for the map marker on this page. Default is "#000000" (black)', 'asana' ),
        'std'         => '',
        'type'        => 'colorpicker',
        'section'     => 'option_types',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Contact form settings', 'asana' ),
        'id'          => 'tab_form_settings',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable contact form?', 'asana' ),
        'id'          => 'uni_form_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'Show or hide contact form', 'asana' ),
        'std'         => 'on'
      ),
      array(
        'id'          => 'uni_contact_page_form_seven_id',
        'label'       => esc_html__( 'CF7 form ID for Contact page', 'asana' ),
        'desc'        => esc_html__( 'Also you can utilise Contact Form 7 form instead of built-in form. Just activate your Contact Form 7 plugin and define here the ID of the form. This option overrides global option "CF7 form ID for Contact page".', 'asana' ),
        'std'         => '',
        'type'        => 'text',
        'section'     => 'contact',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Title (H3) before contact form', 'asana' ),
        'id'          => 'uni_contact_form_title',
        'type'        => 'textarea',
        'desc'        => esc_html__('You may use html tags: <code>br, em, strong, a</code>.', 'asana'),
        'std'         => esc_html__('Say Hello', 'asana')
      ),
      array(
        'label'       => esc_html__( 'Subtitle before contact form', 'asana' ),
        'id'          => 'uni_contact_form_subtitle',
        'type'        => 'textarea',
        'desc'        => esc_html__('You may use html tags: <code>br, em, strong, a</code>.', 'asana'),
        'std'         => esc_html__('We love to meet people and talk about possibilities', 'asana')
      ),
    )
  );

  $classes_meta_box = array(
    'id'          => 'classes_meta_box',
    'title'       => esc_html__( 'Parameters for "Classes" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => '',
        'id'          => 'classes_textblock',
        'type'        => 'textblock',
        'desc'        => esc_html__( 'This page is designed to showcase your classes schedule (or for similar events). You may add page header image simply by adding featured image to this page. You should use shortcode like [uni-calendar id="X"] where X is the ID of your calendar. Attention: you must enable plugin Uni Events Calendars Manager to be able to create calendars and events for them!', 'asana' ),
        'operator'    => 'and',
        'condition'   => ''
      ),
    )
  );

  $events_meta_box = array(
    'id'          => 'events_meta_box',
    'title'       => esc_html__( 'Parameters for "Events" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => '',
        'id'          => 'events_textblock',
        'type'        => 'textblock',
        'desc'        => sprintf (esc_html__( 'This page is designed to display your events. Events are just like blog posts, but themed) Also you can add page headers image for this page on <a href="%s">theme options page</a>.', 'asana' ), trailingslashit(home_url()).'wp-admin/themes.php?page=ot-theme-options#section_shop' ),
        'operator'    => 'and',
        'condition'   => ''
      ),
      array(
        'id'          => 'uni_events_page_header_bg',
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Page header image on Events page" for this page.', 'asana' ),
        'std'         => '',
        'type'        => 'upload',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => 'ot-upload-attachment-id',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Page header title (H1)', 'asana' ),
        'id'          => 'uni_events_page_header_title',
        'type'        => 'text',
        'desc'        => esc_html__( 'This option overrides global option "Page header title on Events page" for this page.', 'asana' ),
        'std'         => esc_html__( 'follow our events', 'asana' )
      ),
      array(
        'id'          => 'uni_events_page_header_title_color',
        'label'       => esc_html__( 'Colour of page header title', 'asana' ),
        'desc'        => esc_html__( 'This option overrides global option "Colour of page header title on Events page" for this page. Default is "white". You can choose another colour for this text.', 'asana' ),
        'std'         => '#ffffff',
        'type'        => 'colorpicker',
        'section'     => 'headers',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Show/hide list of categories.', 'asana' ),
        'id'          => 'events_display_list_cats',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'You can decide whether to show or not on this page a small and nice dropdown-like list of all categories of events.', 'asana' ),
        'std'         => 'on'
      ),
      array(
        'id'          => 'events_categories',
        'label'       => esc_html__( 'Display events from categories:', 'asana' ),
        'desc'        => esc_html__( 'Use this option if you want to show events from certain categories only. If you don\'t choose any category, than all events will be shown on the page.', 'asana' ),
        'std'         => '',
        'type'        => 'taxonomy-checkbox',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => 'uni_event_cat',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
    )
  );

  $slider_meta_box = array(
    'id'          => 'slider_meta_box',
    'title'       => esc_html__( 'Parameters for Home Page Slide', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'uni_home_slides' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'URI for "learn more" button', 'asana' ),
        'id'          => 'uni_slide_uri',
        'type'        => 'text',
        'desc'        => esc_html__( 'If you don\'t define an URI for this button, it won\'t be shown for this slider', 'asana' )
      ),
      array(
        'label'       => esc_html__( 'Label for "learn more" button', 'asana' ),
        'id'          => 'uni_slide_label',
        'type'        => 'text',
        'std'         => 'learn more',
        'desc'        => ''
      ),
      array(
        'id'          => 'uni_button_a_colour',
        'label'       => esc_html__( 'Colour for label of "learn more" button', 'asana' ),
        'desc'        => '',
        'std'         => '#ffffff',
        'type'        => 'colorpicker',
        'section'     => 'tab_colours',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_button_a_bg',
        'label'       => esc_html__( 'Background colour for "learn more" button', 'asana' ),
        'desc'        => '',
        'std'         => '#168cb9',
        'type'        => 'colorpicker',
        'section'     => 'tab_colours',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_button_a_bg_hover',
        'label'       => esc_html__( 'Background colour of hovered state for "learn more" button', 'asana' ),
        'desc'        => '',
        'std'         => '#1b9fd2',
        'type'        => 'colorpicker',
        'section'     => 'tab_colours',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      )
    )
  );

  $event_meta_box = array(
    'id'          => 'event_meta_box',
    'title'       => esc_html__( 'Parameters for Event', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'uni_event' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'id'          => 'uni_event_page_header_image',
        'type'        => 'gallery',
        'desc'        => esc_html__( 'Add image to page header. Nevertheless you can add more then one image, only the first one will be used!', 'asana' ),
        'condition'   => ''
      ),
      array(
        'id'          => 'uni_event_date',
        'label'       => esc_html__( 'Date of the event', 'asana' ),
        'desc'        => esc_html__( 'Add the date of the event', 'asana' ),
        'std'         => '',
        'type'        => 'date-picker',
        'section'     => 'tab_add_info',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_event_time_start',
        'label'       => esc_html__( 'Start time of the event', 'asana' ),
        'desc'        => esc_html__( 'Add the start time of the event', 'asana' ),
        'std'         => '',
        'type'        => 'time-picker',
        'section'     => 'tab_add_info',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'uni_event_time_end',
        'label'       => esc_html__( 'End time of the event', 'asana' ),
        'desc'        => esc_html__( 'Add the end time of the event', 'asana' ),
        'std'         => '',
        'type'        => 'time-picker',
        'section'     => 'tab_add_info',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Address of the event', 'asana' ),
        'id'          => 'uni_event_address',
        'type'        => 'text',
        'desc'        => esc_html__( 'Add the address of the event', 'asana' )
      ),
      array(
        'label'       => esc_html__( 'Coordinates for the map', 'asana' ),
        'id'          => 'uni_event_coord',
        'type'        => 'text',
        'desc'        => esc_html__( 'Add the coordinates of the event. Example: "41.404182,2.199451"', 'asana' )
      ),
      array(
        'label'       => esc_html__( 'Zoom', 'asana' ),
        'id'          => 'uni_event_zoom',
        'type'        => 'text',
        'desc'        => esc_html__( 'Define zoom level. Example: "12"', 'asana' )
      ),
      array(
        'label'       => esc_html__( 'Price of a ticket', 'asana' ),
        'id'          => 'uni_event_price',
        'type'        => 'text',
        'desc'        => esc_html__( 'Add price for ticket for the event. Examples: "$10" or "Free of charge"', 'asana' )
      ),
      array(
        'label'       => esc_html__( 'Enable/disable "join event" functionality for this event only!', 'asana' ),
        'id'          => 'uni_local_events_join_on',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'This option allows you to override "join event" global option.', 'asana' ),
        'std'         => 'off'
      ),
      array(
        'label'       => esc_html__( 'Custom text for the "join event" button and title for modal window connected with this button', 'asana' ),
        'id'          => 'uni_local_events_button_text',
        'type'        => 'text',
        'desc'        => esc_html__( 'Default is "Join event"', 'asana' ),
        'std'         => esc_html__( 'Join event', 'asana' )
      ),
      array(
        'id'          => 'uni_local_events_page',
        'label'       => esc_html__( 'Events page', 'asana' ),
        'desc'        => esc_html__( 'This option allows you to override "Events page" global option. An URI to the page chosen here will be added to the link on this page only.', 'asana' ),
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => 'page',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
    )
  );

  $wishlist_meta_box = array(
    'id'          => 'wishlist_meta_box',
    'title'       => esc_html__( 'Parameters for Wishlist', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'id'          => 'uni_wishlist_page_header_image',
        'type'        => 'gallery',
        'desc'        => esc_html__( 'Add image to page header. Nevertheless you can add more then one image, only the first one will be used!', 'asana' ),
        'condition'   => ''
      )
    )
  );

  $bridallist_meta_box = array(
    'id'          => 'bridallist_meta_box',
    'title'       => esc_html__( 'Parameters for Bridal list', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Page header image', 'asana' ),
        'id'          => 'uni_bridallist_page_header_image',
        'type'        => 'gallery',
        'desc'        => esc_html__( 'Add image to page header. Nevertheless you can add more then one image, only the first one will be used!', 'asana' ),
        'condition'   => ''
      )
    )
  );

  $price_meta_box = array(
    'id'          => 'price_meta_box',
    'title'       => esc_html__( 'Parameters for Price', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'uni_price' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'Additional info', 'asana' ),
        'id'          => 'tab_add_info',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Price value', 'asana' ),
        'id'          => 'uni_price_val',
        'type'        => 'text',
        'desc'        => ''
      ),
      array(
        'label'       => esc_html__( 'Currency sign', 'asana' ),
        'id'          => 'uni_currency',
        'type'        => 'text',
        'desc'        => ''
      ),
      array(
        'label'       => esc_html__( 'for... ?', 'asana' ),
        'id'          => 'uni_period',
        'type'        => 'text',
        'desc'        => esc_html__('for example: "for 7 days", "for 1 year" etc.', 'asana')
      ),
      array(
        'label'       => esc_html__( 'Custom text for "Order Now" button', 'asana' ),
        'id'          => 'uni_order_button_text',
        'type'        => 'text',
        'desc'        => ''
      ),
      array(
        'label'       => esc_html__( 'Enable/Disable external URI for "Order Now" button', 'asana' ),
        'id'          => 'uni_order_button_ext_url_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'By default "Order Now" button opens a modal window with a simple ordering form. It sends information only, no payments. However, you can enable external URI for this button if you want, for instance, redirect your clients to PayPal or similar. Please, don\'t forget to add the URI, otherwise you won\'t see this button at all!', 'asana' ),
        'std'         => 'off'
      ),
      array(
        'label'       => esc_html__( 'Custom URI for "Order Now" button', 'asana' ),
        'id'          => 'uni_order_button_uri',
        'type'        => 'text',
        'desc'        => '',
        'condition'   => 'uni_order_button_ext_url_enable:is(on)'
      )
    )
  );

$prices_meta_box = array(
    'id'          => 'prices_meta_box',
    'title'       => esc_html__( 'Parameters for "Prices" page', 'asana' ),
    'desc'        => '',
    'pages'       => array( 'page' ),
    'context'     => 'normal',
    'priority'    => 'high',
    'fields'      => array(
      array(
        'label'       => esc_html__( 'CPT "Price"', 'asana' ),
        'id'          => 'tab_prices',
        'type'        => 'tab'
      ),
      array(
        'id'          => 'uni_prices_posts',
        'label'       => esc_html__( 'Posts "Price"', 'asana' ),
        'desc'        => esc_html__( 'Choose posts from CPT "Price" to be displayed on this page or all the posts of CPT "Price" will be shown here.', 'asana' ),
        'std'         => '',
        'type'        => 'custom-post-type-checkbox',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => 'uni_price',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'label'       => esc_html__( 'Enable/disable displaying of "Orer Now" button for items', 'asana' ),
        'id'          => 'uni_ordernow_btn_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'You can enable or disable displaying of "Order Now" button for all the items displayed on the page.', 'asana' ),
        'std'         => 'off'
      ),
      array(
        'label'       => esc_html__( 'CPT "Product"', 'asana' ),
        'id'          => 'tab_products',
        'type'        => 'tab'
      ),
      array(
        'label'       => esc_html__( 'Enable/disable support of WooCommerce Subscriptions extension', 'asana' ),
        'id'          => 'uni_subscriptions_enable',
        'type'        => 'on-off',
        'desc'        => esc_html__( 'You can enable the support of WooCommerce Subscriptions extension if you plan to use it (not bundled with the theme; you have to buy it separately if you want it!). So, instead of using built-in custom post type Prices you can decide to display "subscription" type products here. Choose desired products of this type to display here or all the products of this type will be shown instead. Sorting: recent posts first. Notice: "Order Now" buttons will be linked to single pages of these products.', 'asana' ),
        'std'         => 'off'
      ),
      array(
        'id'          => 'uni_subscription_products',
        'label'       => esc_html__( 'Products-subscriptions', 'asana' ),
        'desc'        => esc_html__( 'Choose product-subscriptions which you want to display on this page. Notice: all your products are displayed here, not only subscriptions! So, you have to know on your own what product type is for a particular product. Also, I would recommend to make this product hidden in all catalogs (it is a built in option of WC and it is located near "Publish" button on single product edit page).', 'asana' ),
        'std'         => '',
        'type'        => 'custom-post-type-checkbox',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => 'product',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      )
    )
  );

  /**
   * Register our meta boxes using the
   * ot_register_meta_box() function.
   */
  if ( function_exists( 'ot_register_meta_box' ) )
    ot_register_meta_box( $pageheader_meta_box );
    ot_register_meta_box( $about_meta_box );
    ot_register_meta_box( $contact_meta_box );
    ot_register_meta_box( $classes_meta_box );
    ot_register_meta_box( $events_meta_box );
    ot_register_meta_box( $slider_meta_box );
    ot_register_meta_box( $event_meta_box );
    ot_register_meta_box( $wishlist_meta_box );
    ot_register_meta_box( $bridallist_meta_box );
    ot_register_meta_box( $price_meta_box );
    ot_register_meta_box( $prices_meta_box );
}