Example #1
0
 function show()
 {
     global $post;
     // Use nonce for verification
     echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
     echo '<table class="form-table cmb_metabox">';
     foreach ($this->_meta_box['fields'] as $field) {
         // Set up blank or default values for empty ones
         if (!isset($field['name'])) {
             $field['name'] = '';
         }
         if (!isset($field['desc'])) {
             $field['desc'] = '';
         }
         if (!isset($field['std'])) {
             $field['std'] = '';
         }
         if ('file' == $field['type'] && !isset($field['allow'])) {
             $field['allow'] = array('url', 'attachment');
         }
         if ('file' == $field['type'] && !isset($field['save_id'])) {
             $field['save_id'] = false;
         }
         if ('multicheck' == $field['type']) {
             $field['multiple'] = true;
         }
         $meta = get_post_meta($post->ID, $field['id'], 'multicheck' != $field['type']);
         echo '<tr>';
         if ($field['type'] == "title") {
             echo '<td colspan="2">';
         } else {
             if ($this->_meta_box['show_names'] == true) {
                 echo '<th style="width:18%"><label for="', $field['id'], '">', $field['name'], '</label></th>';
             }
             echo '<td>';
         }
         switch ($field['type']) {
             case 'text':
                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'icon':
                 echo '<input type="text" class="iconname" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /> <a href="#" class="button crum-icon-add" title="' . __('Add Icon', 'dfd') . '">' . __('Add Icon', 'dfd') . '</a>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'sidebar_select':
                 if (class_exists('SMK_Sidebar_Generator')) {
                     $the_sidebars = smk_get_all_sidebars();
                     if (is_array($the_sidebars)) {
                         $select_str = __('-- Select a sidebar --', 'dfd');
                         $the_sidebars = array_merge(array('' => $select_str), $the_sidebars);
                     }
                     if (empty($meta) && !empty($field['std'])) {
                         $meta = $field['std'];
                     }
                     echo '<select name="', $field['id'], '" id="', $field['id'], '">';
                     foreach ($the_sidebars as $key => $value) {
                         echo '<option value="', $key, '"', $meta == $key ? ' selected="selected"' : '', '>', $value, '</option>';
                     }
                     echo '</select>';
                     echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 } else {
                     _e('Please install SMK Sidebar Generator plugin in Apperance -> Install plugins', 'dfd');
                 }
                 break;
             case 'header_select':
                 $the_headers = dfd_headers_type();
                 if (is_array($the_headers)) {
                     $select_str = __('-- Select a header --', 'dfd');
                     array_unshift($the_headers, $select_str);
                 }
                 if (empty($meta) && !empty($field['std'])) {
                     $meta = $field['std'];
                 }
                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';
                 foreach ($the_headers as $key => $value) {
                     echo '<option value="', $key, '"', $meta == $key ? ' selected="selected"' : '', '>', $value, '</option>';
                 }
                 echo '</select>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'text_small':
                 echo '<input class="cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'text_medium':
                 echo '<input class="cmb_text_medium" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'text_date':
                 echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'text_date_timestamp':
                 echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date('m\\/d\\/Y', $meta) : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'text_datetime_timestamp':
                 echo '<input class="cmb_text_small cmb_datepicker" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date('m\\/d\\/Y', $meta) : $field['std'], '" />';
                 echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date('h:i A', $meta) : $field['std'], '" /><span class="cmb_metabox_description" >', $field['desc'], '</span>';
                 break;
             case 'text_time':
                 echo '<input class="cmb_timepicker text_time" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'text_money':
                 echo '$ <input class="cmb_text_money" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'colorpicker':
                 $meta = '' !== $meta ? $meta : $field['std'];
                 $hex_color = '(([a-fA-F0-9]){3}){1,2}$';
                 if (preg_match('/^' . $hex_color . '/i', $meta)) {
                     // Value is just 123abc, so prepend #.
                     $meta = '#' . $meta;
                 } elseif (!preg_match('/^#' . $hex_color . '/i', $meta)) {
                     // Value doesn't match #123abc, so sanitize to just #.
                     $meta = "#";
                 }
                 echo '<input class="cmb_colorpicker cmb_text_small" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" /><span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'textarea':
                 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'textarea_small':
                 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'textarea_code':
                 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="cmb_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'select':
                 if (empty($meta) && !empty($field['std'])) {
                     $meta = $field['std'];
                 }
                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';
                 foreach ($field['options'] as $option) {
                     echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
                 }
                 echo '</select>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'radio_inline':
                 if (empty($meta) && !empty($field['std'])) {
                     $meta = $field['std'];
                 }
                 echo '<div class="cmb_radio_inline">';
                 $i = 1;
                 foreach ($field['options'] as $option) {
                     echo '<div class="cmb_radio_inline_option"><input type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label for="', $field['id'], $i, '">', $option['name'], '</label></div>';
                     $i++;
                 }
                 echo '</div>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'radio':
                 if (empty($meta) && !empty($field['std'])) {
                     $meta = $field['std'];
                 }
                 echo '<ul>';
                 $i = 1;
                 foreach ($field['options'] as $option) {
                     echo '<li><input type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label for="', $field['id'], $i, '">', $option['name'] . '</label></li>';
                     $i++;
                 }
                 echo '</ul>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'checkbox':
                 echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
                 echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'multicheck':
                 echo '<ul>';
                 $i = 1;
                 foreach ($field['options'] as $value => $name) {
                     // Append `[]` to the name to get multiple values
                     // Use in_array() to check whether the current option should be checked
                     echo '<li><input type="checkbox" name="', $field['id'], '[]" id="', $field['id'], $i, '" value="', $value, '"', in_array($value, $meta) ? ' checked="checked"' : '', ' /><label for="', $field['id'], $i, '">', $name, '</label></li>';
                     $i++;
                 }
                 echo '</ul>';
                 echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'title':
                 echo '<h5 class="cmb_metabox_title">', $field['name'], '</h5>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'wysiwyg':
                 wp_editor($meta ? $meta : $field['std'], $field['id'], isset($field['options']) ? $field['options'] : array());
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'taxonomy_select':
                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';
                 $names = wp_get_object_terms($post->ID, $field['taxonomy']);
                 $terms = get_terms($field['taxonomy'], 'hide_empty=0');
                 foreach ($terms as $term) {
                     if (!is_wp_error($names) && !empty($names) && !strcmp($term->slug, $names[0]->slug)) {
                         echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>';
                     } else {
                         echo '<option value="' . $term->slug . '  ', $meta == $term->slug ? $meta : ' ', '  ">' . $term->name . '</option>';
                     }
                 }
                 echo '</select>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'taxonomy_radio':
                 $names = wp_get_object_terms($post->ID, $field['taxonomy']);
                 $terms = get_terms($field['taxonomy'], 'hide_empty=0');
                 echo '<ul>';
                 foreach ($terms as $term) {
                     if (!is_wp_error($names) && !empty($names) && !strcmp($term->slug, $names[0]->slug)) {
                         echo '<li><input type="radio" name="', $field['id'], '" value="' . $term->slug . '" checked>' . $term->name . '</li>';
                     } else {
                         echo '<li><input type="radio" name="', $field['id'], '" value="' . $term->slug . '  ', $meta == $term->slug ? $meta : ' ', '  ">' . $term->name . '</li>';
                     }
                 }
                 echo '</ul>';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 break;
             case 'taxonomy_multicheck':
                 echo '<ul>';
                 $names = wp_get_object_terms($post->ID, $field['taxonomy']);
                 $terms = get_terms($field['taxonomy'], 'hide_empty=0');
                 foreach ($terms as $term) {
                     echo '<li><input type="checkbox" name="', $field['id'], '[]" id="', $field['id'], '" value="', $term->name, '"';
                     foreach ($names as $name) {
                         if ($term->slug == $name->slug) {
                             echo ' checked="checked" ';
                         }
                     }
                     echo ' /><label>', $term->name, '</label></li>';
                 }
                 echo '</ul>';
                 echo '<span class="cmb_metabox_description">', $field['desc'], '</span>';
                 break;
             case 'file_list':
                 echo '<input class="cmb_upload_file" type="text" size="36" name="', $field['id'], '" value="" />';
                 echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 $args = array('post_type' => 'attachment', 'numberposts' => null, 'post_status' => null, 'post_parent' => $post->ID);
                 $attachments = get_posts($args);
                 if ($attachments) {
                     echo '<ul class="attach_list">';
                     foreach ($attachments as $attachment) {
                         echo '<li>' . wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
                         echo '<span>';
                         echo apply_filters('the_title', '&nbsp;' . $attachment->post_title);
                         echo '</span></li>';
                     }
                     echo '</ul>';
                 }
                 break;
             case 'file':
                 $input_type_url = "hidden";
                 if ('url' == $field['allow'] || is_array($field['allow']) && in_array('url', $field['allow'])) {
                     $input_type_url = "text";
                 }
                 echo '<input class="cmb_upload_file" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
                 echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
                 echo '<input class="cmb_upload_file_id" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta($post->ID, $field['id'] . "_id", true), '" />';
                 echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 echo '<div id="', $field['id'], '_status" class="cmb_media_status">';
                 if ($meta != '') {
                     $check_image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $meta);
                     if ($check_image) {
                         echo '<div class="img_status">';
                         echo '<img src="', $meta, '" alt="" />';
                         echo '<a href="#" class="cmb_remove_file_button" rel="', $field['id'], '">Remove Image</a>';
                         echo '</div>';
                     } else {
                         $parts = explode('/', $meta);
                         for ($i = 0; $i < count($parts); ++$i) {
                             $title = $parts[$i];
                         }
                         echo 'File: <strong>', $title, '</strong>&nbsp;&nbsp;&nbsp; (<a href="', $meta, '" target="_blank" rel="external">Download</a> / <a href="#" class="cmb_remove_file_button" rel="', $field['id'], '">Remove</a>)';
                     }
                 }
                 echo '</div>';
                 break;
             case 'oembed':
                 echo '<input class="cmb_oembed" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />', '<p class="cmb_metabox_description">', $field['desc'], '</p>';
                 echo '<p class="cmb-spinner spinner"></p>';
                 echo '<div id="', $field['id'], '_status" class="cmb_media_status ui-helper-clearfix embed_wrap">';
                 if ($meta != '') {
                     $check_embed = $GLOBALS['wp_embed']->run_shortcode('[embed]' . esc_url($meta) . '[/embed]');
                     if ($check_embed) {
                         echo '<div class="embed_status">';
                         echo $check_embed;
                         echo '<a href="#" class="cmb_remove_file_button" rel="', $field['id'], '">Remove Embed</a>';
                         echo '</div>';
                     } else {
                         echo 'URL is not a valid oEmbed URL.';
                     }
                 }
                 echo '</div>';
                 break;
             default:
                 do_action('cmb_render_' . $field['type'], $field, $meta);
         }
         echo '</td>', '</tr>';
     }
     echo '</table>';
 }
Example #2
0
function dfd_get_header_style_option()
{
    global $post;
    $headers_avail = array_keys(dfd_headers_type());
    if (isset($_POST['header_type']) && !empty($_POST['header_type'])) {
        if (in_array($_POST['header_type'], $headers_avail)) {
            return $_POST['header_type'];
        }
    }
    if (!empty($post) && is_object($post)) {
        $page_id = $post->ID;
        $selected_header = get_post_meta($page_id, 'dfd_headers_header_style', true);
        if ($selected_header && in_array($selected_header, $headers_avail)) {
            return $selected_header;
        }
    }
    $layouts = array('pages', 'archive', 'single', 'search', '404');
    switch (true) {
        case is_404():
            $layout = '404';
            break;
        case is_search():
            $layout = 'search';
            break;
        case is_single():
            $layout = 'single';
            break;
        case is_archive():
            $layout = 'archive';
            break;
        case is_page():
            $layout = 'pages';
            break;
        default:
            $layout = false;
    }
    if (!$layout || !in_array($layout, $layouts)) {
        $layout = $layouts[0];
    }
    if (!DfdThemeSettings::get("{$layout}_head_type") || !in_array(DfdThemeSettings::get("{$layout}_head_type"), $headers_avail)) {
        return false;
    }
    return DfdThemeSettings::get("{$layout}_head_type");
}
Example #3
0
function setup_framework_options($get_sections = false)
{
    $args = array();
    // Setting dev mode to true allows you to view the class settings/info in the panel.
    // Default: true
    $args['dev_mode'] = false;
    // Set the icon for the dev mode tab.
    // If $args['icon_type'] = 'image', this should be the path to the icon.
    $args['icon_type'] = 'iconfont';
    // Default: info-sign
    //$args['dev_mode_icon'] = 'info-sign';
    // Set the class for the dev mode tab icon.
    // This is ignored unless $args['icon_type'] = 'iconfont'
    // Default: null
    $args['dev_mode_icon_class'] = 'icon-large';
    // If you want to use Google Webfonts, you MUST define the api key.
    //$args['google_api_key'] = 'xxxx';
    // Define the starting tab for the option panel.
    // Default: '0';
    //$args['last_tab'] = '0';
    // Define the option panel stylesheet. Options are 'standard', 'custom', and 'none'
    // If only minor tweaks are needed, set to 'custom' and override the necessary styles through the included custom.css stylesheet.
    // If replacing the stylesheet, set to 'none' and don't forget to enqueue another stylesheet!
    // Default: 'standard'
    //$args['admin_stylesheet'] = 'standard';
    // Add HTML before the form.
    /*
     $args['intro_text'] = __('<p>This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.</p>', 'dfd');
    
     // Add content after the form.
     $args['footer_text'] = __('<p>This text is displayed below the options panel. It isn\'t required, but more info is always better! The footer_text field accepts all HTML.</p>', 'dfd');
    
     // Set footer/credit line.
     //$args['footer_credit'] = __('<p>This text is displayed in the options panel footer across from the WordPress version (where it normally says \'Thank you for creating with WordPress\'). This field accepts all HTML.</p>', 'dfd');
    
     // Setup custom links in the footer for share icons
     $args['share_icons']['twitter'] = array(
     'link' => 'http://twitter.com/ghost1227',
     'title' => __('Follow me on Twitter', 'dfd'),
     'img' => Redux_OPTIONS_URL . 'img/social/Twitter.png'
     );
     $args['share_icons']['linked_in'] = array(
     'link' => 'http://www.linkedin.com/profile/view?id=52559281',
     'title' => __('Find me on LinkedIn', 'dfd'),
     'img' => Redux_OPTIONS_URL . 'img/social/LinkedIn.png'
     );
    */
    // Enable the import/export feature.
    // Default: true
    $args['show_import_export'] = true;
    // Set the icon for the import/export tab.
    // If $args['icon_type'] = 'image', this should be the path to the icon.
    $args['import_icon_type'] = 'iconfont';
    // Default: refresh
    $args['import_icon'] = 'refresh';
    // Set the class for the import/export tab icon.
    // This is ignored unless $args['icon_type'] = 'iconfont'
    // Default: null
    $args['import_icon_class'] = 'icon-large';
    // Set a custom option name. Don't forget to replace spaces with underscores!
    $args['opt_name'] = DFD_THEME_SETTINGS_NAME;
    // Set a custom menu icon.
    //$args['menu_icon'] = '';
    // Set a custom title for the options page.
    // Default: Options
    $args['menu_title'] = __('Options', 'dfd');
    // Set a custom page title for the options page.
    // Default: Options
    $args['page_title'] = __('Options', 'dfd');
    // Set a custom page slug for options page (wp-admin/themes.php?page=***).
    // Default: redux_options
    $args['page_slug'] = 'redux_options';
    // Set a custom page capability.
    // Default: manage_options
    //$args['page_cap'] = 'manage_options';
    // Set the menu type. Set to "menu" for a top level menu, or "submenu" to add below an existing item.
    // Default: menu
    //$args['page_type'] = 'submenu';
    // Set the parent menu.
    // Default: themes.php
    // A list of available parent menus is available at http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
    //$args['page_parent'] = 'options-general.php';
    // Set a custom page location. This allows you to place your menu where you want in the menu order.
    // Must be unique or it will override other items!
    // Default: null
    //$args['page_position'] = null;
    // Set a custom page icon class (used to override the page icon next to heading)
    //$args['page_icon'] = 'icon-themes';
    // Set the icon type. Set to "iconfont" for Font Awesome, or "image" for traditional.
    // Redux no longer ships with standard icons!
    // Default: iconfont
    //$args['icon_type'] = 'image';
    //$args['dev_mode_icon_type'] = 'image';
    //$args['import_icon_type'] == 'image';
    // Disable the panel sections showing as submenu items.
    // Default: true
    //$args['allow_sub_menu'] = false;
    $assets_folder = get_template_directory_uri() . '/assets/';
    // Set ANY custom page help tabs, displayed using the new help tab API. Tabs are shown in order of definition.
    /* $args['help_tabs'][] = array(
    	  'id' => 'redux-opts-1',
    	  'title' => __('Theme Information 1', 'dfd'),
    	  'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'dfd')
    	  );
    	  $args['help_tabs'][] = array(
    	  'id' => 'redux-opts-2',
    	  'title' => __('Theme Information 2', 'dfd'),
    	  'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'dfd')
    	  );
    
    	  // Set the help sidebar for the options page.
    	  $args['help_sidebar'] = __('<p>This is the sidebar content, HTML is allowed.</p>', 'dfd');
    	 */
    $sections = array();
    $sections[] = array('icon_type' => 'image', 'icon' => Redux_OPTIONS_URL . 'img/home.png', 'icon_class' => 'icon-large', 'title' => __('Getting Started', 'dfd'), 'desc' => __('<p class="description">This is the description field for this section. HTML is allowed</p>', 'dfd'), 'fields' => array(array('id' => 'font_awesome_info', 'type' => 'raw_html', 'html' => '<h3 style="text-align: center; border-bottom: none;">Welcome to the Options panel of the Kadabra theme!</h3>
				<h4 style="text-align: center; font-size: 1.3em;">What does this mean to you?</h4>
				<p>From here on you will be able to regulate the main options of all the elements of the theme. </p>
				<p>Theme documentation you will find in the archive with the theme I the "Documentation" folder. </p>
				<p>If you have some questions on the theme, you can send them to our PM on <a href="http://themeforest.net/user/DFDevelopment">Themeforest.net</a>, you can send us email directly to <a href="mailto:dynamicframeworks@gmail.com">dynamicframeworks@gmail.com</a>, or you can post your questions on our <a href="http://support.dfd.name">Support Forum</a>.</p>'), array('id' => 'import_demo_data', 'type' => 'raw_html', 'html' => !$get_sections && is_plugin_active('sb-import/sb-import.php') ? '<br /><br /><br /><h4 style="text-align: center; font-size: 1.3em;">Import Demo Data</h4>' . '<p style="text-align: center; color: red">If you click on this button, all current settings and posts will be removed!</p>' . '<p style="text-align: center;"><a onclick="return confirm(\'Continue import demo content?\')" href="admin.php?page=sb-import&action=import&_nonce=' . wp_create_nonce('sb_import_nonce') . '" class="button button-primary">' . __('Import demo content', 'dfd') . '</a></p>' : '')));
    $sections[] = array('title' => __('Main Options', 'dfd'), 'desc' => __('<p class="description">Main options of site</p>', 'dfd'), 'icon' => 'globe', 'fields' => array(array('id' => 'scroll_animation', 'type' => 'button_set', 'title' => __('Page scroll animation', 'dfd'), 'desc' => __('Enable or disable page scroll animation', 'dfd'), 'options' => array('on' => 'On', 'off' => 'Off'), 'std' => 'on'), array('id' => 'custom_favicon', 'type' => 'upload', 'title' => __('Favicon', 'dfd'), 'desc' => __('Select a 16px X 16px image from the file location on your computer and upload it as a favicon of your site', 'dfd')), array('id' => 'custom_logo_image', 'type' => 'upload', 'title' => __('Header Logotype image', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a header logotype', 'dfd'), 'std' => $assets_folder . 'img/logo.png'), array('id' => 'custom_retina_logo_image', 'type' => 'upload', 'title' => __('Header Logotype image for retina', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a header logotype', 'dfd'), 'std' => $assets_folder . 'img/logo_retina.png'), array('id' => 'custom_logo_image_second', 'type' => 'upload', 'title' => __('Header Logotype second image', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a header logotype. If this logo wasn\'t uploaded will be displayed first logo.', 'dfd'), 'std' => $assets_folder . 'img/logo_second.png'), array('id' => 'custom_retina_logo_image_second', 'type' => 'upload', 'title' => __('Header Logotype second image for retina', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a header logotype. If this logo wasn\'t uploaded will be displayed first logo.', 'dfd'), 'std' => $assets_folder . 'img/logo_retina.png'), array('id' => 'site_preloader_enabled', 'type' => 'button_set', 'title' => __('Site Preloader', 'dfd'), 'desc' => __('Enable or disable site preloader counter', 'dfd'), 'options' => array('1' => 'On', '0' => 'Off'), 'std' => '1'), array('id' => 'site_preloader_logo_1', 'type' => 'upload', 'title' => __('Site Preloader Logotype image 1', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a preloader logotype 1', 'dfd'), 'std' => $assets_folder . 'img/logo_preloader_1.png'), array('id' => 'site_preloader_logo_2', 'type' => 'upload', 'title' => __('Site Preloader Logotype image 2', 'dfd'), 'desc' => __('Select an image from the file location on your computer and upload it as a preloader logotype 2', 'dfd'), 'std' => $assets_folder . 'img/logo_preloader_2.png'), array('id' => 'wpml_lang_show', 'type' => 'button_set', 'title' => __('WPML language switcher', 'dfd'), 'desc' => __('WPML plugin must be installed. It is not packed with theme. You can find it here: http://wpml.org/', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '0'), array('id' => 'show_search_form', 'type' => 'button_set', 'title' => __('Show search form in header', 'dfd'), 'desc' => '', 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'custom_js', 'type' => 'textarea', 'title' => __('Custom JS', 'dfd'), 'desc' => __('Generate your tracking code at Google Analytics Service and insert it here.', 'dfd')), array('id' => 'custom_css', 'type' => 'textarea', 'title' => __('Custom CSS', 'dfd'), 'desc' => __('You may add any other styles for your theme to this field.', 'dfd')), array('id' => 'show_body_back_to_top', 'type' => 'button_set', 'title' => __('Show "To top" button', 'dfd'), 'desc' => __('', 'dfd'), 'options' => array('no' => __('No', 'dfd'), 'left' => __('Left', 'dfd'), 'right' => __('Right', 'dfd')), 'std' => 'right'), array('id' => 'shop_title', 'type' => 'text', 'title' => __('Shop Title', 'dfd'), 'std' => 'Shop')));
    $sections[] = array('title' => __('Social accounts', 'dfd'), 'desc' => __('<p class="description">Type links for social accounts</p>', 'dfd'), 'icon' => 'user', 'fields' => array(array('id' => 'fb_link', 'type' => 'text', 'title' => __('Facebook link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://facebook.com'), array('id' => 'fb_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '1'), array('id' => 'tw_link', 'type' => 'text', 'title' => __('Twitter link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://twitter.com'), array('id' => 'tw_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '1'), array('id' => 'in_link', 'type' => 'text', 'title' => __('Instagram link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://instagram.com'), array('id' => 'in_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'vi_link', 'type' => 'text', 'title' => __('Vimeo link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://vimeo.com'), array('id' => 'vi_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'lf_link', 'type' => 'text', 'title' => __('Last FM link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://lastfm.com'), array('id' => 'lf_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'vk_link', 'type' => 'text', 'title' => __('Vkontakte link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://vk.com'), array('id' => 'vk_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '1'), array('id' => 'yt_link', 'type' => 'text', 'title' => __('YouTube link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://youtube.com'), array('id' => 'yt_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'de_link', 'type' => 'text', 'title' => __('Deviantart link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'https://deviantart.com/'), array('id' => 'de_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'li_link', 'type' => 'text', 'title' => __('LinkedIN link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://linkedin.com'), array('id' => 'li_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '1'), array('id' => 'gp_link', 'type' => 'text', 'title' => __('Google + link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'https://accounts.google.com/'), array('id' => 'gp_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '1'), array('id' => 'pi_link', 'type' => 'text', 'title' => __('Picasa link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://picasa.com'), array('id' => 'pi_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'pt_link', 'type' => 'text', 'title' => __('Pinterest link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://pinterest.com'), array('id' => 'pt_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'wp_link', 'type' => 'text', 'title' => __('Wordpress link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://wordpress.com'), array('id' => 'wp_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'db_link', 'type' => 'text', 'title' => __('Dropbox link', 'dfd'), 'desc' => __('Paste link to your account', 'dfd'), 'std' => 'http://dropbox.com'), array('id' => 'db_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0'), array('id' => 'rss_link', 'type' => 'text', 'title' => __('RSS', 'dfd'), 'desc' => __('Paste alternative link to Rss', 'dfd'), 'std' => ''), array('id' => 'rss_show', 'type' => 'checkbox', 'title' => __('Show in footer', 'dfd'), 'sub_desc' => __('If checked - will be display in header of theme ', 'dfd'), 'std' => '0')));
    $sections[] = array('title' => __('Posts list options', 'dfd'), 'desc' => __('<p class="description">Parameters for posts and archives (social share etc)</p>', 'dfd'), 'icon' => 'folder-open-alt', 'fields' => array(array('id' => 'info_msc', 'type' => 'info', 'desc' => __('<h3 class="description">Inner post page options</h3>', 'dfd')), array('id' => 'post_share_button', 'type' => 'button_set', 'title' => __('Social share buttons', 'dfd'), 'desc' => __('With this option you may activate or deactivate social share buttons. and date on inner post page', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'custom_share_code', 'type' => 'textarea', 'title' => __('Custom share code', 'dfd'), 'desc' => __('You may add any other social share buttons to this field.', 'dfd')), array('id' => 'autor_box_disp', 'type' => 'button_set', 'title' => __('Author Info', 'dfd'), 'desc' => __('This option enables you to insert information about the author of the post.', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'thumb_inner_disp', 'type' => 'button_set', 'title' => __('Thumbnail on inner page', 'dfd'), 'desc' => __('Display featured image on single post', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '0'), array('id' => 'info_msc', 'type' => 'info', 'desc' => __('<h3 class="description">Archive page options</h3>', 'dfd')), array('id' => 'thumb_image_crop', 'type' => 'button_set', 'title' => __('Crop thumbnails', 'dfd'), 'desc' => __('Post thumbnails image crop', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'post_thumbnails_width', 'type' => 'text', 'title' => __('Post thumbnail width (in px)', 'dfd'), 'validate' => 'numeric', 'std' => '900'), array('id' => 'post_thumbnails_height', 'type' => 'text', 'title' => __('Post  thumbnail height (in px)', 'dfd'), 'validate' => 'numeric', 'std' => '400'), array('id' => 'post_header', 'type' => 'button_set', 'title' => __('Post info', 'dfd'), 'desc' => __('It is information about the post (time and date of creation, author, comments on the post).', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1')));
    $sections[] = array('title' => __('Portfolio Options', 'dfd'), 'icon' => 'camera', 'fields' => array(array('id' => 'portfolio_page_select', 'type' => 'pages_select', 'title' => __('Portfolio page', 'dfd'), 'desc' => __('Please select main portfolio page (for proper urls)', 'dfd'), 'args' => array()), array('id' => 'folio_sorting', 'type' => 'button_set', 'title' => __('Panel for items sorting ', 'dfd'), 'sub_desc' => __('Display panel for portfolio isotope items sorting by category', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'portfolio_single_style', 'type' => 'button_set', 'title' => __('Portfolio text location', 'dfd'), 'sub_desc' => __('Select text layout on inner page', 'dfd'), 'options' => array('left' => 'To the right', 'full' => 'Full width'), 'std' => 'left'), array('id' => 'portfolio_single_slider', 'type' => 'button_set', 'title' => __('Portfolio image display', 'dfd'), 'sub_desc' => __('Display attached images of inner portfolio page as:', 'dfd'), 'options' => array('slider' => 'Slider', 'full' => 'Items'), 'std' => 'slider'), array('id' => 'recent_items_disp', 'type' => 'button_set', 'title' => __('Display block under single item', 'dfd'), 'sub_desc' => __('Block with recent items', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'block_single_folio_item', 'type' => 'textarea', 'title' => __('Block shortcode', 'dfd'), 'desc' => '', 'sub_desc' => __('By default here is displayed Block with recent items [mvb_recent_works  main_title="Recent projects"][/mvb_recent_works]', 'dfd'), 'std' => '[mvb_recent_works  main_title="Recent projects"][/mvb_recent_works]')));
    $sections[] = array('title' => __('Styling Options', 'dfd'), 'desc' => __('<p class="description">Style parameters of body and footer</p>', 'dfd'), 'icon' => 'cogs', 'fields' => array(array('id' => 'info_msc', 'type' => 'info', 'desc' => __('<h3 class="description">Main site colors setup</h3>', 'dfd')), array('id' => 'main_site_color', 'type' => 'color', 'title' => __('Main site color', 'dfd'), 'desc' => __('Color of buttons, tabs, links, etc.  For example: #ff5f60', 'dfd'), 'std' => ''), array('id' => 'secondary_site_color', 'type' => 'color', 'title' => __('Second site color', 'dfd'), 'desc' => __('Color of inactive elements or borders.  For example: #e5e5e5', 'dfd'), 'std' => ''), array('id' => 'third_site_color', 'type' => 'color', 'title' => __('Third site color', 'dfd'), 'desc' => __('Color of inactive elements or borders.  For example: #e5e5e5', 'dfd'), 'std' => ''), array('id' => 'font_site_color', 'type' => 'color', 'title' => __('Color of text', 'dfd'), 'desc' => __('Main text color. For example: #545454', 'dfd'), 'std' => ''), array('id' => 'link_site_color', 'type' => 'color', 'title' => __('Color of link', 'dfd'), 'desc' => __('Main link color. For example: #545454', 'dfd'), 'std' => ''), array('id' => 'header_background_color', 'type' => 'color', 'title' => __('Header default background color', 'dfd'), 'std' => ''), array('id' => 'fixed_header_background_color', 'type' => 'color', 'title' => __('Fixed Header background color', 'dfd'), 'std' => ''), array('id' => 'fixed_header_background_opacity', 'type' => 'text', 'title' => __('Fixed Header background opacity ', 'dfd'), 'std' => '', 'desc' => __('Insert value from 0% to 100%. Default: <b>95%</b>', 'dfd')), array('id' => 'news_page_slider_background_hover', 'type' => 'color', 'title' => __('News Page Slider background on hover', 'dfd'), 'std' => ''), array('id' => 'news_page_slider_opacity_hover', 'type' => 'text', 'title' => __('News Page Slider opacity on hover ', 'dfd'), 'std' => '', 'desc' => __('Insert value from 0% to 100%. Default: <b>95%</b>', 'dfd')), array('id' => 'read_more_color', 'type' => 'color', 'title' => __('Read More text color', 'dfd'), 'std' => ''), array('id' => 'button_bg_color', 'type' => 'color', 'title' => __('Default button color', 'dfd'), 'std' => ''), array('id' => 'info_sth', 'type' => 'info', 'desc' => __('<h3 class="description">Page title background options</h3>', 'dfd')), array('id' => 'stan_header', 'type' => 'button_set', 'title' => __('Page title background', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'stan_header_color', 'type' => 'color', 'title' => __('Default background color for header', 'dfd'), 'std' => '#ff7362'), array('id' => 'stan_header_image', 'type' => 'upload', 'title' => __('Default background image for header', 'dfd'), 'desc' => __('Upload your own background image or pattern.', 'dfd'), 'std' => $assets_folder . 'img/page-header-default.gif'), array('id' => 'stan_header_fixed', 'type' => 'button_set', 'title' => __('Fix image position', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'info_sth', 'type' => 'info', 'desc' => __('<h3 class="description">Body styling options</h3>', 'dfd')), array('id' => 'site_boxed', 'type' => 'button_set', 'title' => __('Body layout', 'dfd'), 'options' => array('0' => 'Full width', '1' => 'Boxed'), 'std' => '0'), array('id' => 'header_layout', 'type' => 'button_set', 'title' => __('Header Layout', 'dfd'), 'options' => dfd_header_layouts(), 'std' => 'boxed'), array('id' => 'info_bxd', 'type' => 'info', 'desc' => __('<h4 class="description">body site options</h4>', 'dfd')), array('id' => 'wrapper_bg_color', 'type' => 'color', 'title' => __('Content background color', 'dfd'), 'desc' => __('Select background color.', 'dfd'), 'std' => ''), array('id' => 'wrapper_bg_image', 'type' => 'upload', 'title' => __('Content background image', 'dfd'), 'desc' => __('Upload your own background image or pattern.', 'dfd')), array('id' => 'wrapper_custom_repeat', 'type' => 'select', 'title' => __('Content bg image repeat', 'dfd'), 'desc' => __('Select type background image repeat', 'dfd'), 'options' => array('repeat-y' => 'vertically', 'repeat-x' => 'horizontally', 'no-repeat' => 'no-repeat', 'repeat' => 'both vertically and horizontally'), 'std' => 'repeat'), array('id' => 'info_bxd', 'type' => 'info', 'desc' => __('<h4 class="description">Boxed site options</h4>', 'dfd')), array('id' => 'body_bg_color', 'type' => 'color', 'title' => __('Body background color', 'dfd'), 'desc' => __('Select background color.', 'dfd'), 'std' => ''), array('id' => 'body_bg_image', 'type' => 'upload', 'title' => __('Custom background image', 'dfd'), 'desc' => __('Upload your own background image or pattern.', 'dfd')), array('id' => 'body_custom_repeat', 'type' => 'select', 'title' => __('Background image repeat', 'dfd'), 'desc' => __('Select type background image repeat', 'dfd'), 'options' => array('repeat-y' => 'vertically', 'repeat-x' => 'horizontally', 'no-repeat' => 'no-repeat', 'repeat' => 'both vertically and horizontally'), 'std' => ''), array('id' => 'body_bg_fixed', 'type' => 'button_set', 'title' => __('Fixed body background', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '0'), array('id' => 'info_foot', 'type' => 'info', 'desc' => __('<h3 class="description">Footer section options</h3>', 'dfd')), array('id' => 'footer_bg_color', 'type' => 'color', 'title' => __('Footer background color', 'dfd'), 'desc' => __('Select footer background color. ', 'dfd'), 'std' => ''), array('id' => 'footer_font_color', 'type' => 'color', 'title' => __('Footer font color', 'dfd'), 'desc' => __('Select footer font color.', 'dfd'), 'std' => ''), array('id' => 'footer_bg_image', 'type' => 'upload', 'title' => __('Custom footer background image', 'dfd'), 'desc' => __('Upload your own footer background image or pattern.', 'dfd')), array('id' => 'footer_custom_repeat', 'type' => 'select', 'title' => __('Footer background image repeat', 'dfd'), 'desc' => __('Select type background image repeat', 'dfd'), 'options' => array('repeat-y' => 'vertically', 'repeat-x' => 'horizontally', 'no-repeat' => 'no-repeat', 'repeat' => 'both vertically and horizontally'), 'std' => ''), array('id' => 'info_sub_foot', 'type' => 'info', 'desc' => __('<h3 class="description">Sub footer section options</h3>', 'dfd')), array('id' => 'sub_footer_bg_color', 'type' => 'color', 'title' => __('Sub footer background color', 'dfd'), 'desc' => __('Select sub footer background color. ', 'dfd'), 'std' => '#31343b'), array('id' => 'sub_footer_font_color', 'type' => 'color', 'title' => __('Sub footer font color', 'dfd'), 'desc' => __('Select sub footer font color.', 'dfd'), 'std' => ''), array('id' => 'sub_footer_bg_image', 'type' => 'upload', 'title' => __('Custom sub footer background image', 'dfd'), 'desc' => __('Upload your own footer background image or pattern.', 'dfd')), array('id' => 'sub_footer_custom_repeat', 'type' => 'select', 'title' => __('Sub footer background image repeat', 'dfd'), 'desc' => __('Select type background image repeat', 'dfd'), 'options' => array('repeat' => 'both vertically and horizontally', 'repeat-y' => 'vertically', 'repeat-x' => 'horizontally', 'no-repeat' => 'no-repeat'), 'std' => 'repeat')));
    $sections[] = array('title' => __('Contact page options', 'dfd'), 'desc' => __('<p class="description">Contact page options</p>', 'dfd'), 'icon' => 'map-marker', 'fields' => array(array('id' => 'custom_form_shortcode', 'type' => 'text', 'title' => __('Custom Form Shortcode', 'dfd'), 'desc' => __('You can paste your shorcode custom form', 'dfd'), 'std' => ''), array('id' => 'cont_m_disp', 'type' => 'button_set', 'title' => __('Display map on contacts page?', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '1'), array('id' => 'cont_m_height', 'type' => 'text', 'title' => __('Height of Google Map (in px)', 'dfd'), 'std' => ''), array('id' => 'cont_m_zoom', 'type' => 'text', 'title' => __('Zoom Level', 'dfd'), 'std' => '14'), array('id' => 'map_address', 'type' => 'multi_text', 'title' => __('Address on Google Map ', 'dfd'), 'desc' => __('Fill in your address to be shown on Google map.', 'dfd'), 'std' => 'London, Downing street, 10')));
    $sections[] = array('icon' => 'wrench', 'title' => __('Layouts Settings', 'dfd'), 'desc' => __('<p class="description">Configure layouts of different pages</p>', 'dfd'), 'fields' => array(array('id' => 'pages_layout', 'type' => 'radio_img', 'title' => __('Single pages layout', 'dfd'), 'sub_desc' => __('Select one type of layout for single pages', 'dfd'), 'options' => dfd_page_layouts(), 'std' => '1col-fixed'), array('id' => 'pages_head_type', 'type' => 'select', 'title' => __('Single pages header', 'dfd'), 'options' => dfd_headers_type(), 'std' => '1'), array('id' => 'archive_layout', 'type' => 'radio_img', 'title' => __('Archive Pages Layout', 'dfd'), 'sub_desc' => __('Select one type of layout for archive pages', 'dfd'), 'options' => dfd_page_layouts(), 'std' => '2c-l-fixed'), array('id' => 'archive_head_type', 'type' => 'select', 'title' => __('Archive Pages header', 'dfd'), 'options' => dfd_headers_type(), 'std' => '1'), array('id' => 'single_layout', 'type' => 'radio_img', 'title' => __('Single posts layout', 'dfd'), 'sub_desc' => __('Select one type of layout for single posts', 'dfd'), 'options' => dfd_page_layouts(), 'std' => '2c-l-fixed'), array('id' => 'single_head_type', 'type' => 'select', 'title' => __('Single posts header', 'dfd'), 'options' => dfd_headers_type(), 'std' => '1'), array('id' => 'search_layout', 'type' => 'radio_img', 'title' => __('Search results layout', 'dfd'), 'sub_desc' => __('Select one type of layout for search results', 'dfd'), 'options' => dfd_page_layouts(), 'std' => '2c-l-fixed'), array('id' => 'search_head_type', 'type' => 'select', 'title' => __('Search results header', 'dfd'), 'options' => dfd_headers_type(), 'std' => '1'), array('id' => '404_layout', 'type' => 'radio_img', 'title' => __('404 Page Layout', 'dfd'), 'sub_desc' => __('Select one of layouts for 404 page', 'dfd'), 'options' => dfd_page_layouts(), 'std' => '2c-l-fixed'), array('id' => '404_head_type', 'type' => 'select', 'title' => __('404 Page header', 'dfd'), 'options' => dfd_headers_type(), 'std' => '1')));
    $sections[] = array('title' => __('Twitter panel options', 'dfd'), 'desc' => __('<p class="description">More information about api keys and how to get it you can find in that tutorial <a href="http://dfd.name/twitter-settings">http://dfd.name/twitter-settings/</a></p>', 'dfd'), 'icon' => 'twitter', 'fields' => array(array('id' => 't_panel_padding', 'type' => 'button_set', 'title' => __('Section padding', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '0'), array('id' => 't_panel_bg_color', 'type' => 'color', 'title' => __('Background color for twitter panel', 'dfd'), 'std' => '#20bce3'), array('id' => 't_panel_bg_image', 'type' => 'upload', 'title' => __('Background image for twitter panel', 'dfd'), 'desc' => __('Upload your own background image or pattern.', 'dfd'), 'std' => $assets_folder . 'pic/twitter-row-bg.jpg'), array('id' => 'footer_tw_disp', 'type' => 'button_set', 'title' => __('Display twitter statuses before footer', 'dfd'), 'options' => array('1' => __('On', 'dfd'), '0' => __('Off', 'dfd')), 'std' => '0'), array('id' => 'cachetime', 'type' => 'text', 'title' => __('Cache Tweets in every:', 'dfd'), 'sub_desc' => __('In minutes', 'dfd'), 'std' => '1'), array('id' => 'numb_lat_tw', 'type' => 'text', 'title' => __('Number of latest tweets display:', 'dfd'), 'std' => '10'), array('id' => 'username', 'type' => 'text', 'title' => __('Username:'******'dfd'), 'std' => 'Envato'), array('id' => 'twiiter_consumer', 'type' => 'text', 'title' => __('Consumer key:', 'dfd'), 'std' => ''), array('id' => 'twiiter_con_s', 'type' => 'text', 'title' => __('Consumer secret:', 'dfd'), 'std' => ''), array('id' => 'twiiter_acc_t', 'type' => 'text', 'title' => __('Access token:', 'dfd'), 'std' => ''), array('id' => 'twiiter_acc_t_s', 'type' => 'text', 'title' => __('Access token secret:', 'dfd'), 'std' => '')));
    $sections[] = array('title' => __('Footer section options', 'dfd'), 'desc' => __('<p class="description">Footer section options</p>', 'dfd'), 'icon' => 'tasks', 'fields' => array(array('id' => 'logo_footer', 'type' => 'upload', 'title' => __('Logotype in footer', 'dfd'), 'desc' => __('Will be displayed before copyright text', 'dfd'), 'std' => ''), array('id' => 'copyright_footer', 'type' => 'text', 'title' => __('Show copyright', 'dfd'), 'desc' => __('Fill in the copyright text.', 'dfd'), 'validate' => 'html', 'std' => '&copy; 2014 <a href="http://dev.dfd.name/">Dynamic Frameworks Development</a>'), array('id' => 'social_counters_code', 'type' => 'textarea', 'title' => __('Social Counters code', 'dfd'), 'desc' => __('This code will be displayed before &lt;/body&gt;', 'dfd'), 'std' => '')));
    $envato_toolkit_has_update = get_option('envato-toolkit-has-update');
    $envato_toolkit_last_errors = get_option('envato-toolkit-last-errors');
    $sections[] = array('title' => __('Theme Update', 'dfd'), 'icon' => 'cogs', 'fields' => array(array('id' => 'themeforest_username', 'type' => 'text', 'title' => __('ThemeForest Username', 'dfd'), 'std' => ''), array('id' => 'themeforest_api_key', 'type' => 'text', 'title' => __('Secret API Key', 'dfd'), 'std' => ''), array('id' => 'dfd_upgrde_theme', 'type' => 'raw_html', 'html' => !$get_sections && !empty($envato_toolkit_has_update) && empty($envato_toolkit_last_errors) ? '<p style="text-align: center;">' . '<a onclick="return confirm(\'Start theme upgrade?\')" href="' . add_query_arg(array('_nonce' => wp_create_nonce('sb_theme_upgrade'), 'upgrade_theme' => 1)) . '" class="button button-primary">' . __('Upgrade theme', 'dfd') . '</a></p>' : '')));
    if ($get_sections === true) {
        return $sections;
    }
    $tabs = array();
    if (function_exists('wp_get_theme')) {
        $theme_data = wp_get_theme();
        $item_uri = $theme_data->get('ThemeURI');
        $description = $theme_data->get('Description');
        $author = $theme_data->get('Author');
        $author_uri = $theme_data->get('AuthorURI');
        $version = $theme_data->get('Version');
        $tags = $theme_data->get('Tags');
    } else {
        $theme_data = get_theme_data(trailingslashit(get_stylesheet_directory()) . 'style.css');
        $item_uri = $theme_data['URI'];
        $description = $theme_data['Description'];
        $author = $theme_data['Author'];
        $author_uri = $theme_data['AuthorURI'];
        $version = $theme_data['Version'];
        $tags = $theme_data['Tags'];
    }
    $item_info = '<div class="redux-opts-section-desc">';
    $item_info .= '<p class="redux-opts-item-data description item-uri">' . __('<strong>Theme URL:</strong> ', 'dfd') . '<a href="' . $item_uri . '" target="_blank">' . $item_uri . '</a></p>';
    $item_info .= '<p class="redux-opts-item-data description item-author">' . __('<strong>Author:</strong> ', 'dfd') . ($author_uri ? '<a href="' . $author_uri . '" target="_blank">' . $author . '</a>' : $author) . '</p>';
    $item_info .= '<p class="redux-opts-item-data description item-version">' . __('<strong>Version:</strong> ', 'dfd') . $version . '</p>';
    $item_info .= '<p class="redux-opts-item-data description item-description">' . $description . '</p>';
    $item_info .= '<p class="redux-opts-item-data description item-tags">' . __('<strong>Tags:</strong> ', 'dfd') . implode(', ', $tags) . '</p>';
    $item_info .= '</div>';
    $tabs['item_info'] = array('icon' => 'info-sign', 'icon_class' => 'icon-large', 'title' => __('Theme Information', 'dfd'), 'content' => $item_info);
    if (file_exists(trailingslashit(dirname(__FILE__)) . 'README.html')) {
        $tabs['docs'] = array('icon' => 'book', 'icon_class' => 'icon-large', 'title' => __('Documentation', 'dfd'), 'content' => nl2br(file_get_contents(trailingslashit(dirname(__FILE__)) . 'README.html')));
    }
    global $Redux_Options;
    $Redux_Options = new Redux_Options($sections, $args, $tabs);
}