<?php

/**
 * Initialize the custom theme options.
 */
add_action('admin_init', 'xs_theme_options');

/**
 * Build the custom settings & update OptionTree.
 */
function xs_theme_options() {

    /* OptionTree is not loaded yet */
    /*
      if

      (! function_exists('ot_settings_id' ) ) {
      return false;
      }
     */



    /**
     * Get a copy of the saved settings array.
     */
    $saved_settings = get_option('theme_options', array());

    /**
     * Custom settings array that will 

      eventually be
     * passes to the OptionTree Settings API Class.
     */
    $custom_settings = array(
        'contextual_help' => array(
            'sidebar' => ''
        ),
        'sections' => array(
            array(
                'id' => 'general',
                'title' => __('General', 'xs')
            ),
            array(
                'id' => 'theme_style',
                'title' => __('Theme Style', 'xs')
            ),
            array(
                'id' => 'theme_slider',
                'title' => __('Slider', 'xs')
            ),
//            array(
//                'id' => 'typhography',
//                'title' => __('Typography', 'xs')
//            ),
            array(
                'id' => 'event_section',
                'title' => __('Event', 'xs')
            ),
            
            array(
                'id' => 'additional_section',
                'title' => __('Form', 'xs')
            ),
            array(
                'id' => 'blog_section',
                'title' => __('Blog', 'xs')
            ),
            array(
                'id' => 'get_direction',
                'title' => __('Get Direction', 'xs')
            ),
            array(
                'id' => 'footer_section',
                'title' => __('Footer', 'xs')
            ),
            array(
                'id' => 'seo_section',
                'title' => __('SEO Meta', 'xs')
            ),
            array(
                'id' => 'advanced_section',
                'title' => __('Custom code', 'xs')
            )
        ),
        'settings' => array(
            
            array(
                'id' => 'logo___favicon',
                'label' => __('Logo &amp; Favicon', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'site_logo',
                'label' => __('Site Logo', 'xs'),
                'desc' => __('The maximum width of the logo should be 200px and the maximum height of the logo should be 50px.', 'xs'),
                'std' => esc_url(get_template_directory_uri() . '/theme-assets/img/brand.png'),
                'type' => 'upload',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'favicon',
                'label' => __('Favicon', 'xs'),
                'desc' => __('The dimension for the image must be 16x16 pixels or 32x32 pixels, using either 8-bit or 24-bit colors and the format must be one of PNG (a W3C standard), GIF, or ICO.', 'xs'),
                'std' => esc_url(get_template_directory_uri() . '/theme-assets/img/icons/favicon.ico'),
                'type' => 'upload',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'apple_touch_icon_72',
                'label' => __('Apple Touch Icon IPad', 'xs'),
                'desc' => __('72 x 72 pixel for IPad. Recommended format must be one of PNG, GIF, or JPG.', 'xs'),
                'std' => esc_url(get_template_directory_uri() . '/theme-assets/img/icons/apple-touch-icon-72x72.png'),
                'type' => 'upload',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'apple_touch_icon_114',
                'label' => __('Apple Touch Icon IPhone ( Retina )', 'xs'),
                'desc' => __('114 x 114 pixel for high-resolution iPhone and iPod touch. Recommended format must be one of PNG, GIF, or JPG.', 'xs'),
                'std' => esc_url(get_template_directory_uri() . '/theme-assets/img/icons/apple-touch-icon-114x114.png'),
                'type' => 'upload',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'apple_touch_icon_144',
                'label' => __('Apple Touch Icon IPad ( Retina )', 'xs'),
                'desc' => __('144 x 144 pixel for high-resolution iPad. Recommended format must be one of PNG, GIF, or JPG.', 'xs'),
                'std' => esc_url(get_template_directory_uri() . '/theme-assets/img/icons/apple-touch-icon.png'),
                'type' => 'upload',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            
            array(
                'id' => 'color___background',
                'label' => __('Color &amp; Background', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'main_color',
                'label' => __('Main Color', 'xs'),
                'desc' => __('This is global main color for your template. You can choose whatever color you like, and "OnEvent" will do the rest.', 'xs'),
                'std' => '#ff6d40',
                'type' => 'colorpicker',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),

            array(
                'id' => 'main_template_style',
                'label' => __('Template Background Style', 'xs'),
                'desc' => 'OnEvent comes with two dirrefent styled template: one with solid color background and other one stands with background slider. Please select one for options according to your choice.',
                'std' => 'color',
                'type' => 'radio-image',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and',
                'choices' => array(
                    array(
                        'value' => 'color',
                        'label' => __('Color Background', 'xs'),
                        'src' => esc_url(get_template_directory_uri()) . '/theme-assets/img/bg1.png'
                    ),
                    array(
                        'value' => 'image',
                        'label' => __('Slider Background', 'xs'),
                        'src' => esc_url(get_template_directory_uri()) . '/theme-assets/img/bg2.png'
                    )
                )
            ),
            array(
                'id' => 'main_bg_color',
                'label' => __('Background Color', 'xs'),
                'desc' => __('This is the main background color for your template.', 'xs'),
                'std' => '#e6e6e6',
                'type' => 'colorpicker',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'main_template_style:is(color)',
                'operator' => 'and'
            ),
            array(
                'id' => 'textblock909',
                'label' => __('textblock', 'xs'),
                'desc' => __('Please check the following options for page background slider.', 'xs'),
                'std' => '',
                'type' => 'theme_style',
                'section' => 'general',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'border-top',
                'condition' => 'main_template_style:is(image)',
                'operator' => 'and'
            ),
            array(
                'id' => 'animation_pause',
                'label' => __('Pause Duration', 'xs'),
                'desc' => __('Select interval between two fadeing ( changing backgrounds ) animations in "ms".', 'xs'),
                'std' => '7000',
                'type' => 'numeric-slider',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '1000,7000,100',
                'class' => '',
                'condition' => 'main_template_style:is(image)',
                'operator' => 'and'
            ),
            array(
                'id' => 'fading_speed',
                'label' => __('Fading Speed', 'xs'),
                'desc' => __('Select Fading speed (ms)', 'xs'),
                'std' => '1000',
                'type' => 'numeric-slider',
                'section' => 'theme_style',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '200,1500,100',
                'class' => '',
                'condition' => 'main_template_style:is(image)',
                'operator' => 'and'
            ),

            
            array(
                'id' => 'main___slider',
                'label' => __('Main Slider', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'theme_slider',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'main_slider',
                'label' => __('Slider Images', 'xs'),
                'desc' => __('Upload your slider images here, you can use external image source too.', 'xs'),
                'std' => array(
                    array(
                        'title' => 'slide1',
                        'img_src' => esc_url(get_template_directory_uri() . '/theme-assets/img/slider/slide1.jpg')
                    ),
                    array(
                        'title' => 'slide2',
                        'img_src' => esc_url(get_template_directory_uri() . '/theme-assets/img/slider/slide2.jpg')
                    ),
                    array(
                        'title' => 'slide3',
                        'img_src' => esc_url(get_template_directory_uri() . '/theme-assets/img/slider/slide3.jpg')
                    )
                ),
                'type' => 'list-item',
                'section' => 'theme_slider',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and',
                'settings' => array(
                    array(
                        'id' => 'img_src',
                        'label' => __('Image Source', 'xs'),
                        'desc' => '',
                        'std' => '',
                        'type' => 'upload',
                        'rows' => '',
                        'post_type' => '',
                        'taxonomy' => '',
                        'min_max_step' => '',
                        'class' => '',
                        'condition' => '',
                        'operator' => 'and'
                    )
                )
            ),
            
            
            
            array(
                'id' => 'event___title',
                'label' => __('Event Settings', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title no-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'textblvk',
                'label' => __('text block', 'xs'),
                'desc' => __('OnEvent is a responsive landing page template, designed for special events. You can display all the necessary information regarding your event using this template\'s available sections. Please check other available options or documentation for further information.Please select you event time and date bellow. The main countdown will perform according to this field.', 'xs'),
                'std' => '',
                'type' => 'textblock',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'event_date_time',
                'label' => __('Select event date &amp; time', 'xs'),
                'desc' => '',
                'std' => '2016-06-16 00:00',
                'type' => 'date-time-picker',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'event_slogan',
                'label' => __('Event Title', 'xs'),
                'desc' => '',
                'std' => 'BIGGEST EVENT OF THE YEAR',
                'type' => 'text',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'event_title',
                'label' => __('Event Place', 'xs'),
                'desc' => '',
                'std' => 'San Francisco Convention Center',
                'type' => 'text',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'event_sub_title',
                'label' => __('Sub-Title', 'xs'),
                'desc' => '',
                'std' => '123 Street, San Fransisco, USA',
                'type' => 'text',
                'section' => 'event_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'blog_title',
                'label' => __('Blog', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'blog_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title no-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'blog_page_title',
                'label' => __('Blog Page Title', 'xs'),
                'desc' => '',
                'std' => 'EVENT BLOG',
                'type' => 'text',
                'section' => 'blog_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'blog_page_sub_title',
                'label' => __('Blog Page Sub-Title', 'xs'),
                'desc' => '',
                'std' => 'Our news, updates and information sharing platform',
                'type' => 'text',
                'section' => 'blog_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
//            array(
//                'id' => 'blog_custom_css',
//                'label' => __('Custom CSS', 'xs'),
//                'desc' => __('Custom CSS that will appear within "Header" tag of blog posts.', 'xs'),
//                'std' => '',
//                'type' => 'textarea-simple',
//                'section' => 'blog_section',
//                'rows' => '6',
//                'post_type' => '',
//                'taxonomy' => '',
//                'min_max_step' => '',
//                'class' => '',
//                'condition' => '',
//                'operator' => 'and'
//            ),
//            array(
//                'id' => 'blog_custom_js',
//                'label' => __('Custom JS', 'xs'),
//                'desc' => __('Custom Javascript that will appear within "Footer" of blog posts.', 'xs'),
//                'std' => '
//jQuery(document).ready(function(){
//  "use strict";
//  // here your script
//
//});',
//                'type' => 'textarea-simple',
//                'section' => 'blog_section',
//                'rows' => '6',
//                'post_type' => '',
//                'taxonomy' => '',
//                'min_max_step' => '',
//                'class' => '',
//                'condition' => '',
//                'operator' => 'and'
//            ),
            array(
                'id' => 'footer_title',
                'label' => __('Footer', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'footer_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title no-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'copyright_text',
                'label' => __('Copyright Text', 'xs'),
                'desc' => '',
                'std' => 'OnEvent (c)2014 . All Rights Reserved.',
                'type' => 'text',
                'section' => 'footer_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'footer_slogan',
                'label' => __('Footer slogan', 'xs'),
                'desc' => '',
                'std' => 'Landing Page Template Designed & Developed By: <a href="#">Saptarang</a>',
                'type' => 'text',
                'section' => 'footer_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'social_title',
                'label' => __('Social Links', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'footer_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'social_link',
                'label' => __('Add Social Link', 'xs'),
                'desc' => __('Add your social links here. Feel free to add multiple.', 'xs'),
                'std' => '',
                'type' => 'list-item',
                'section' => 'footer_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and',
                'settings' => array(
                    array(
                        'id' => 'icon',
                        'label' => __('Icon', 'xs'),
                        'desc' => '',
                        'std' => '',
                        'type' => 'select',
                        'rows' => '',
                        'post_type' => '',
                        'taxonomy' => '',
                        'min_max_step' => '',
                        'class' => '',
                        'condition' => '',
                        'operator' => 'and',
                        'choices' => array(
                            array(
                                'value' => 'behance',
                                'label' => __('Behance', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'dribbble',
                                'label' => __('Dribbble', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'deviantart',
                                'label' => __('Deviantart', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'linkedin',
                                'label' => __('Linkedin', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'facebook',
                                'label' => __('Facebook', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'twitter',
                                'label' => __('Twitter', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'flickr',
                                'label' => __('Flickr', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'google-plus',
                                'label' => __('Google+', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'soundcloud',
                                'label' => __('Soundcloud', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'pinterest',
                                'label' => __('Pinterest', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'rss',
                                'label' => __('RSS', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'skype',
                                'label' => __('Skype', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'vimeo-square',
                                'label' => __('Vimeo', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'youtube',
                                'label' => __('Youtube', 'xs'),
                                'src' => ''
                            ),
                            array(
                                'value' => 'instagram',
                                'label' => __('Instagram', 'xs'),
                                'src' => ''
                            )
                        )
                    ),
                    array(
                        'id' => 'link',
                        'label' => __('Link', 'xs'),
                        'desc' => __('Input your social link. (Dont forget to include <i>http://</i> or <i>https://</i>)', 'xs'),
                        'std' => '',
                        'type' => 'text',
                        'rows' => '',
                        'post_type' => '',
                        'taxonomy' => '',
                        'min_max_step' => '',
                        'class' => '',
                        'condition' => '',
                        'operator' => 'and'
                    )
                )
            ),
            array(
                'id' => 'seo_title',
                'label' => __('SEO', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'seo_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title no-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'seo_keywords',
                'label' => __('SEO Keywords', 'xs'),
                'desc' => __('To make your site more SEO friendly, OnEvent enables you to add your selected keywords for your contents.', 'xs'),
                'std' => '',
                'type' => 'textarea-simple',
                'section' => 'seo_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'seo_desc',
                'label' => __('SEO Description', 'xs'),
                'desc' => __('Write down your meta description below, though you can change each page, post meta description and keywords accordoing to your need.', 'xs'),
                'std' => '',
                'type' => 'textarea-simple',
                'section' => 'seo_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_form_tab',
                'label' => __('Register Form', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'tab',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_form_title',
                'label' => __('Register Form', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_button_text',
                'label' => __('Register Button Text', 'xs'),
                'desc' => '',
                'std' => 'Register',
                'type' => 'text',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'link_only_register_button',
                'label' => __('Link Only Register Button', 'xs'),
                'desc' => '',
                'std' => 'off',
                'type' => 'on-off',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_link',
                'label' => __('Register Link', 'xs'),
                'desc' => __('Don\'t forget to include <i>http://</i> or <i>https://</i>', 'xs'),
                'std' => '',
                'type' => 'text',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(on)',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_success_box_color',
                'label' => __('Success Box Color', 'xs'),
                'desc' => '',
                'std' => '#f9ffef',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_success_box_border_color',
                'label' => __('Success Box Border Color', 'xs'),
                'desc' => '',
                'std' => '#bede8f',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_success_box_border_style',
                'label' => __('Success Box Border Style', 'xs'),
                'desc' => '',
                'std' => 'solid',
                'type' => 'select',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and',
                'choices' => array(
                    array(
                        'value' => 'solid',
                        'label' => __('Solid', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'dotted',
                        'label' => __('Dotted', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'dashed',
                        'label' => __('Dashed', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'double',
                        'label' => __('Double', 'xs'),
                        'src' => ''
                    )
                )
            ),
            array(
                'id' => 'register_text_color',
                'label' => __('Text Color', 'xs'),
                'desc' => '',
                'std' => '#7a994c',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_submit_message',
                'label' => __('Submit Message', 'xs'),
                'desc' => '',
                'std' => 'Your form has been submitted successfully.',
                'type' => 'text',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and'
            ),
            array(
                'id' => 'register_success_peragraph',
                'label' => __('Success Peragraph', 'xs'),
                'desc' => '',
                'std' => 'We\'ll respond to your message within 24 hours. <br> Please call <b>123.456.789</b> for any urgent queries. Thank You!',
                'type' => 'textarea-simple',
                'section' => 'additional_section',
                'rows' => '4',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => 'link_only_register_button:is(off)',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_tab',
                'label' => __('Subscribe Form', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'tab',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_title',
                'label' => __('Subscribe Form', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_success_box_color',
                'label' => __('Success Box Color', 'xs'),
                'desc' => '',
                'std' => '#f9ffef',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_success_box_border_style',
                'label' => __('Success Box Border Style', 'xs'),
                'desc' => '',
                'std' => 'solid',
                'type' => 'select',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and',
                'choices' => array(
                    array(
                        'value' => 'solid',
                        'label' => __('Solid', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'dotted',
                        'label' => __('Dotted', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'dashed',
                        'label' => __('Dashed', 'xs'),
                        'src' => ''
                    ),
                    array(
                        'value' => 'double',
                        'label' => __('Double', 'xs'),
                        'src' => ''
                    )
                )
            ),
            array(
                'id' => 'subscription_success_box_border_color',
                'label' => __('Success Box Border Color', 'xs'),
                'desc' => '',
                'std' => '#bede8f',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_text_color',
                'label' => __('Text Color', 'xs'),
                'desc' => '',
                'std' => '#7a994c',
                'type' => 'colorpicker',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'subscription_success_message',
                'label' => __('Success Message', 'xs'),
                'desc' => '',
                'std' => 'You have subscribed successfully.',
                'type' => 'text',
                'section' => 'additional_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            
            
            array(
                'id' => 'get_direction_title',
                'label' => __('Get Direction', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'address',
                'label' => __('Address', 'xs'),
                'desc' => '',
                'std' => '123 Main Street San<br />Francisco, CA 94105, USA',
                'type' => 'textarea',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'phone_number',
                'label' => __('Phone Number', 'xs'),
                'desc' => '',
                'std' => '310.55.1213',
                'type' => 'text',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'email',
                'label' => __('Email', 'xs'),
                'desc' => '',
                'std' => 'info@yourdomain.com',
                'type' => 'text',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'textblock99',
                'label' => __('textblock', 'xs'),
                'desc' => __('Enter geo location of your event below. You can find your geo location from <a href="' . esc_url('mygeoposition.com/') . '" title="Get My Geo Location">here</a>', 'xs'),
                'std' => '',
                'type' => 'textblock',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'border-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'latitude',
                'label' => __('Latitude', 'xs'),
                'desc' => 'Destination Location',
                'std' => '37.791649',
                'type' => 'text',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'longitude',
                'label' => __('Longitude', 'xs'),
                'desc' => 'Destination Location',
                'std' => '-122.394395',
                'type' => 'text',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'destination_from',
                'label' => __('Default Visitor\'s Location', 'xs'),
                'desc' => 'Destination From',
                'std' => '50 California Street',
                'type' => 'text',
                'section' => 'get_direction',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'advanced_title',
                'label' => __('Advanced Settings', 'xs'),
                'desc' => '',
                'std' => '',
                'type' => 'title-only',
                'section' => 'advanced_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => 'ot-title no-top',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'google_analytic',
                'label' => __('Google Analytic', 'xs'),
                'desc' => __('Put your Google Analytic Code here. It\'ll help you track your visitor real time. For additional information, please check <a href="' . esc_url('www.google.com/analytics/web/') . '">here</a>', 'xs'),
                'std' => '',
                'type' => 'textarea-simple',
                'section' => 'advanced_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'custom_js',
                'label' => __('Custom JS', 'xs'),
                'desc' => __('Custom Javascript that will go in the footer.', 'xs'),
                'std' => '
jQuery(document).ready(function(){
  "use strict";
  // here your script
});',
                'type' => 'textarea-simple',
                'section' => 'advanced_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            ),
            array(
                'id' => 'custom_css',
                'label' => __('Custom CSS', 'xs'),
                'desc' => __('OnEvent allows you to add your custom css code. Simply put your code here and it will be added within header tag.', 'xs'),
                'std' => '',
                'type' => 'textarea-simple',
                'section' => 'advanced_section',
                'rows' => '',
                'post_type' => '',
                'taxonomy' => '',
                'min_max_step' => '',
                'class' => '',
                'condition' => '',
                'operator' => 'and'
            )
        )
    );

    /* allow settings to be filtered before saving */
    $custom_settings = apply_filters('theme_options' . '_args', $custom_settings);

    /* settings are not the same update the DB */


    if ($saved_settings !== $custom_settings) {
        update_option('theme_options', $custom_settings);
    }

    /* Lets OptionTree know the UI Builder is being overridden */

    global $ot_has_custom_theme_options;
    $ot_has_custom_theme_options = true;
}
