Ejemplo n.º 1
0
function us_register_sidebars()
{
    $config = us_config('sidebars');
    foreach ($config as $sidebar) {
        register_sidebar($sidebar);
    }
}
Ejemplo n.º 2
0
 protected function __construct()
 {
     global $us_template_directory, $us_stylesheet_directory;
     $this->config = us_config('shortcodes');
     // TODO Figure out all the mess about paragraphs
     add_filter('the_content', array($this, 'paragraph_fix'));
     add_filter('the_content', array($this, 'a_to_img_magnific_pupup'));
     // Make sure that priority makes the class init after Visual Composer
     add_action('init', array($this, 'init'), 20);
     $this->_template_directory = $us_template_directory;
     $this->_stylesheet_directory = $us_stylesheet_directory;
 }
Ejemplo n.º 3
0
 protected function __construct()
 {
     global $us_template_directory;
     // Checking if the theme was just installed
     $theme = wp_get_theme();
     if (is_child_theme()) {
         $theme = wp_get_theme($theme->get('Template'));
     }
     $theme_name = $theme->get('Name');
     if (!get_option($theme_name . '_options')) {
         $this->set_db_version();
         return;
     }
     // Get the current DB version
     $db_version = $this->get_db_version();
     // Get available migrations (should be set by the theme's us_config_migrations filter) and keep only the needed ones
     $migrations = array();
     foreach (us_config('migrations') as $migration_version => $migration_file) {
         if (version_compare($db_version, $migration_version, '<')) {
             $class = basename($migration_file, '.php');
             if (file_exists($us_template_directory . '/' . $migration_file)) {
                 include $us_template_directory . '/' . $migration_file;
             } elseif (WP_DEBUG) {
                 wp_die('Defined migration file not found: ' . $us_template_directory . '/' . $migration_file);
             }
             if (class_exists($class)) {
                 $this->translators[$migration_version] = new $class();
             }
         }
     }
     if (empty($this->translators)) {
         return;
     }
     if (!is_admin() or defined('DOING_AJAX') and DOING_AJAX) {
         // Providing fall-back compatibility for the previous website db versions
         $this->provide_fallback($migrations);
     } else {
         // Admin panel
         if ($this->should_be_manual()) {
             if (isset($_GET['us-migration']) and wp_verify_nonce($_GET['us-migration'], 'us-migration')) {
                 // Performing the migration
                 add_action('admin_init', array($this, 'perform_migration'), 1);
                 add_action('admin_notices', array($this, 'display_migration_completed'), 1);
             } else {
                 // Notifying about the needed migrations
                 add_action('admin_notices', array($this, 'display_migration_needed'), 1);
             }
         } else {
             // Performing the migration silently
             add_action('admin_init', array($this, 'perform_migration'), 1);
         }
     }
 }
Ejemplo n.º 4
0
function us_demo_import_sliders()
{
    global $us_template_directory;
    $config = us_config('demo-import');
    //select which files to import
    $aviable_demos = array_keys($config);
    $demo_version = $aviable_demos[0];
    if (in_array($_POST['demo'], $aviable_demos)) {
        $demo_version = $_POST['demo'];
    }
    if (!class_exists('RevSlider') or !isset($config[$demo_version]['sliders']) or empty($config[$demo_version]['sliders'])) {
        return FALSE;
    }
    ob_start();
    foreach ($config[$demo_version]['sliders'] as $slider) {
        $_FILES["import_file"]["tmp_name"] = $us_template_directory . '/' . $slider;
        $slider = new RevSlider();
        $response = $slider->importSliderFromPost();
        unset($slider);
    }
    ob_end_clean();
    wp_send_json_success();
}
Ejemplo n.º 5
0
 public function translate_vc_custom_heading(&$name, &$params)
 {
     if (!isset($params['google_fonts']) or empty($params['google_fonts'])) {
         $heading_font = us_get_option('heading_font_family');
         if (empty($heading_font)) {
             return FALSE;
         }
         $font_config = us_config('google-fonts.' . $heading_font);
         if (empty($font_config) or !is_array($font_config)) {
             return FALSE;
         }
         $vc_font_value = array('font_family' => array(), 'font_style' => rawurlencode('400 regular:400:normal'));
         foreach ($font_config['variants'] as $font_family) {
             if ($font_family == '400') {
                 $font_family = 'regular';
             } elseif ($font_family == '400italic') {
                 $font_family = 'italic';
             }
             $vc_font_value['font_family'][] = $font_family;
         }
         $vc_font_value['font_family'] = rawurlencode($heading_font . ':' . implode(',', $vc_font_value['font_family']));
         foreach (array(200, 300, 400, 600, 700) as $weight) {
             if (us_get_option('heading_font_weight_' . $weight)) {
                 $vc_font_value['font_style'] = rawurlencode($weight . ' regular:' . $weight . ':normal');
                 break;
             }
         }
         $params['google_fonts'] = 'font_family:' . $vc_font_value['font_family'] . '|font_style:' . $vc_font_value['font_style'];
         return TRUE;
     }
     return FALSE;
 }
Ejemplo n.º 6
0
$font_families = array();
$default_font_weights = array_fill_keys($prefixes, 400);
foreach ($prefixes as $prefix) {
    $font = explode('|', us_get_option($prefix . '_font_family', 'none'), 2);
    if ($font[0] == 'none') {
        // Use the default font
        $font_families[$prefix] = '';
    } elseif (strpos($font[0], ',') === FALSE) {
        // Use some specific font from Google Fonts
        if (!isset($font[1]) or empty($font[1])) {
            // Fault tolerance for missing font-variants
            $font[1] = '400,700';
        }
        // The first active font-weight will be used for "normal" weight
        $default_font_weights[$prefix] = intval($font[1]);
        $fallback_font_family = us_config('google-fonts.' . $font[0] . '.fallback', 'sans-serif');
        $font_families[$prefix] = 'font-family: "' . $font[0] . '", ' . $fallback_font_family . ";\n";
    } else {
        // Web-safe font combination
        $font_families[$prefix] = 'font-family: ' . $font[0] . ";\n";
    }
}
global $smof_data;
?>

<?php 
if (FALSE) {
    ?>
<style>/* Setting IDE context */<?php 
}
?>
Ejemplo n.º 7
0
$inner_css = '';
if (!empty($atts['ratio'])) {
    $classes .= ' ratio_' . $atts['ratio'];
}
$align_class = '';
if ($atts['max_width'] != FALSE) {
    $inner_css = ' style="max-width: ' . $atts['max_width'] . 'px"';
    $classes .= ' align_' . $atts['align'];
}
if (!empty($atts['css']) and function_exists('vc_shortcode_custom_css_class')) {
    $classes .= ' ' . vc_shortcode_custom_css_class($atts['css']);
}
if ($atts['el_class'] != '') {
    $classes .= ' ' . $atts['el_class'];
}
$embed_html = '';
foreach (us_config('embeds') as $provider => $embed) {
    if ($embed['type'] != 'video' or !preg_match($embed['regex'], $atts['link'], $matches)) {
        continue;
    }
    $video_id = $matches[$embed['match_index']];
    $embed_html = str_replace('<id>', $matches[$embed['match_index']], $embed['html']);
    break;
}
if (empty($embed_html)) {
    // Using the default WordPress way
    global $wp_embed;
    $embed_html = $wp_embed->run_shortcode('[embed]' . $atts['link'] . '[/embed]');
}
$output = '<div class="w-video' . $classes . '"' . $inner_css . '><div class="w-video-h">' . $embed_html . '</div></div>';
echo $output;
Ejemplo n.º 8
0
function us_theme_setup()
{
    global $content_width;
    if (!isset($content_width)) {
        $content_width = 1500;
    }
    add_theme_support('automatic-feed-links');
    add_theme_support('post-formats', array('quote', 'image', 'gallery', 'video'));
    // Add post thumbnail functionality
    add_theme_support('post-thumbnails');
    /**
     * Dev note: you can overload theme's image sizes config using filter 'us_config_image-sizes'
     */
    $tnail_sizes = us_config('image-sizes');
    foreach ($tnail_sizes as $size_name => $size) {
        add_image_size($size_name, $size['width'], $size['height'], $size['crop']);
    }
    // Excerpt length
    add_filter('excerpt_length', 'us_excerpt_length', 100);
    function us_excerpt_length($length)
    {
        $excerpt_length = us_get_option('excerpt_length');
        if ($excerpt_length === NULL) {
            return $length;
        } elseif ($excerpt_length === '') {
            // If not set, showing the full excerpt
            return 9999;
        } else {
            return intval($excerpt_length);
        }
    }
    // Remove [...] from excerpt
    add_filter('excerpt_more', 'us_excerpt_more');
    function us_excerpt_more($more)
    {
        return '...';
    }
    // Theme localization
    us_maybe_load_theme_textdomain();
}
Ejemplo n.º 9
0
 /**
  * Process options data and build option fields
  *
  * @uses get_option()
  *
  * @access public
  * @since 1.0.0
  *
  * @return array
  */
 public static function optionsframework_machine($options)
 {
     $data = of_get_options();
     $smof_data = of_get_options();
     $defaults = array();
     $counter = 0;
     $menu = '';
     $output = '';
     $gfont_weights = array('100' => __('Thin 100', 'us'), '100italic' => __('Thin 100 Italic', 'us'), '200' => __('Extra-Light 200', 'us'), '200italic' => __('Extra-Light 200 Italic', 'us'), '300' => __('Light 300', 'us'), '300italic' => __('Light 300 Italic', 'us'), '400' => __('Normal 400', 'us'), '400italic' => __('Normal 400 Italic', 'us'), '500' => __('Medium 500', 'us'), '500italic' => __('Medium 500 Italic', 'us'), '600' => __('Semi-Bold 600', 'us'), '600italic' => __('Semi-Bold 600 Italic', 'us'), '700' => __('Bold 700', 'us'), '700italic' => __('Bold 700 Italic', 'us'), '800' => __('Extra-Bold 800', 'us'), '800italic' => __('Extra-Bold 800 Italic', 'us'), '900' => __('Ultra-Bold 900', 'us'), '900italic' => __('Ultra-Bold 900 Italic', 'us'));
     foreach ($options as $value) {
         $counter++;
         $val = '';
         //create array of defaults
         if ($value['type'] == 'multicheck') {
             if (is_array($value['std'])) {
                 foreach ($value['std'] as $i => $key) {
                     $defaults[$value['id']][$key] = true;
                 }
             } else {
                 $defaults[$value['id']][$value['std']] = true;
             }
         } else {
             if (isset($value['id']) and isset($value['std'])) {
                 $defaults[$value['id']] = $value['std'];
             }
         }
         //Start Heading
         if ($value['type'] != "heading") {
             $class = '';
             if (isset($value['class'])) {
                 $class = $value['class'];
             }
             //hide items in checkbox group
             $fold = '';
             if (array_key_exists('fold', $value)) {
                 if (@$smof_data[$value['fold']]) {
                     $fold = 'f_' . $value['fold'] . ' ';
                 } else {
                     $fold = 'f_' . $value['fold'] . ' temphide ';
                 }
             } elseif (array_key_exists('unfold', $value)) {
                 if (@$smof_data[$value['unfold']]) {
                     $fold = 'uf_' . $value['unfold'] . ' temphide ';
                 } else {
                     $fold = 'uf_' . $value['unfold'] . ' ';
                 }
             }
             $output .= '<div id="section-' . $value['id'] . '" class="' . $fold . 'section section-' . $value['type'] . ' ' . $class . '">' . "\n";
             //only show header if 'name' value exists
             if ($value['name']) {
                 $output .= '<h3 class="heading">' . $value['name'] . '</h3>' . "\n";
             }
             if ($value['type'] == 'checkbox' or $value['type'] == 'radio') {
                 $output .= '<label class="option">' . "\n" . '<div class="controls">' . "\n";
             } else {
                 $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
             }
         }
         //End Heading
         // Set default value for absent options
         if (!in_array($value['type'], array('info', 'image', 'heading', 'slider', 'sorter', 'backup', 'transfer')) and !isset($smof_data[$value['id']]) and isset($defaults[$value['id']])) {
             $smof_data[$value['id']] = $defaults[$value['id']];
         }
         //switch statement to handle various options type
         switch ($value['type']) {
             //text input
             case 'text':
                 $t_value = '';
                 $_smof_val = $t_value = isset($smof_data[$value['id']]) ? stripslashes($smof_data[$value['id']]) : '';
                 $_smof_val = $t_value = str_replace('"', '&quot;', $t_value);
                 $mini = '';
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 if ($value['mod'] == 'mini') {
                     $mini = 'mini';
                 }
                 $output .= '<input class="of-input ' . $mini . '" name="' . $value['id'] . '" id="' . $value['id'] . '" type="' . $value['type'] . '" value="' . $t_value . '" />';
                 break;
                 //select option
             //select option
             case 'select':
                 $mini = '';
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 if ($value['mod'] == 'mini') {
                     $mini = 'mini';
                 }
                 $output .= '<div class="select_wrapper ' . $mini . '">';
                 $output .= '<select class="select of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
                 $_smof_val = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 foreach ($value['options'] as $select_ID => $option) {
                     $output .= '<option id="' . $value['id'] . '_' . $select_ID . '" value="' . $select_ID . '" ' . selected($_smof_val, $select_ID, false) . '>' . $option . '</option>';
                 }
                 $output .= '</select></div>';
                 break;
                 //select predefined option
             //select predefined option
             case 'select_predefined_options':
                 $mini = '';
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 if ($value['mod'] == 'mini') {
                     $mini = 'mini';
                 }
                 $output .= '<div class="select_wrapper ' . $mini . '">';
                 $output .= '<select class="select of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
                 $_smof_val = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 foreach ($value['options'] as $select_ID => $option) {
                     $output .= '<option id="' . $value['id'] . '_' . $select_ID . '" value="' . $select_ID . '" ' . selected($_smof_val, $select_ID, false) . '>' . $option['title'] . '</option>';
                 }
                 $output .= '</select><div class="json-data"' . us_pass_data_to_js($value['options']) . '></div></div>';
                 break;
                 //textarea option
             //textarea option
             case 'textarea':
                 $cols = '8';
                 $ta_value = '';
                 if (isset($value['options'])) {
                     $ta_options = $value['options'];
                     if (isset($ta_options['cols'])) {
                         $cols = $ta_options['cols'];
                     }
                 }
                 $ta_value = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 $output .= '<textarea class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" cols="' . $cols . '" rows="8">' . $ta_value . '</textarea>';
                 break;
                 //radiobox option
             //radiobox option
             case "radio":
                 $checked = isset($smof_data[$value['id']]) ? checked($smof_data[$value['id']], $option, false) : '';
                 foreach ($value['options'] as $option => $name) {
                     $output .= '<input class="of-input of-radio" name="' . $value['id'] . '" type="radio" value="' . $option . '" ' . checked($smof_data[$value['id']], $option, false) . ' /><label class="radio">' . $name . '</label><br/>';
                 }
                 break;
                 //checkbox option
             //checkbox option
             case 'checkbox':
                 if (!isset($smof_data[$value['id']])) {
                     $smof_data[$value['id']] = 0;
                 }
                 $fold = '';
                 if (array_key_exists("folds", $value)) {
                     $fold = "fld ";
                 }
                 $output .= '<input type="hidden" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                 $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($smof_data[$value['id']], 1, false) . ' />';
                 break;
                 //multiple checkbox option
             //multiple checkbox option
             case 'multicheck':
                 isset($smof_data[$value['id']]) ? $multi_stored = $smof_data[$value['id']] : ($multi_stored = "");
                 foreach ($value['options'] as $key => $option) {
                     if (!isset($multi_stored[$key])) {
                         $multi_stored[$key] = '';
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label class="multicheck" for="' . $of_key_string . '">' . $option . '</label><br />';
                 }
                 break;
                 //ajax image upload option
             //ajax image upload option
             case 'upload':
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 if (!isset($value['std'])) {
                     $value['std'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
                 // native media library uploader - @uses optionsframework_media_uploader_function()
             // native media library uploader - @uses optionsframework_media_uploader_function()
             case 'media':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
                 //colorpicker option
             //colorpicker option
             case 'color':
                 $_color = !empty($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div style="background-color: ' . $_color . '"></div></div>';
                 $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $_color . '" />';
                 break;
                 //typography option
             //typography option
             case 'typography':
                 $typography_stored = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : $value['std'];
                 /* Font Size */
                 if (isset($typography_stored['size'])) {
                     $output .= '<div class="select_wrapper typography-size" original-title="Font size">';
                     $output .= '<select class="of-typography of-typography-size select" name="' . $value['id'] . '[size]" id="' . $value['id'] . '_size">';
                     for ($i = 9; $i < 20; $i++) {
                         $test = $i . 'px';
                         $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['size'], $test, false) . '>' . $i . 'px</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Line Height */
                 if (isset($typography_stored['height'])) {
                     $output .= '<div class="select_wrapper typography-height" original-title="Line height">';
                     $output .= '<select class="of-typography of-typography-height select" name="' . $value['id'] . '[height]" id="' . $value['id'] . '_height">';
                     for ($i = 20; $i < 38; $i++) {
                         $test = $i . 'px';
                         $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['height'], $test, false) . '>' . $i . 'px</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Font Face */
                 if (isset($typography_stored['face'])) {
                     $output .= '<div class="select_wrapper typography-face" original-title="Font family">';
                     $output .= '<select class="of-typography of-typography-face select" name="' . $value['id'] . '[face]" id="' . $value['id'] . '_face">';
                     $faces = array('arial' => 'Arial', 'verdana' => 'Verdana, Geneva', 'trebuchet' => 'Trebuchet', 'georgia' => 'Georgia', 'times' => 'Times New Roman', 'tahoma' => 'Tahoma, Geneva', 'palatino' => 'Palatino', 'helvetica' => 'Helvetica');
                     foreach ($faces as $i => $face) {
                         $output .= '<option value="' . $i . '" ' . selected($typography_stored['face'], $i, false) . '>' . $face . '</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Font Weight */
                 if (isset($typography_stored['style'])) {
                     $output .= '<div class="select_wrapper typography-style" original-title="Font style">';
                     $output .= '<select class="of-typography of-typography-style select" name="' . $value['id'] . '[style]" id="' . $value['id'] . '_style">';
                     $styles = array('normal' => 'Normal', 'italic' => 'Italic', 'bold' => 'Bold', 'bold italic' => 'Bold Italic');
                     foreach ($styles as $i => $style) {
                         $output .= '<option value="' . $i . '" ' . selected($typography_stored['style'], $i, false) . '>' . $style . '</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Font Color */
                 if (isset($typography_stored['color'])) {
                     $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector typography-color"><div style="background-color: ' . $typography_stored['color'] . '"></div></div>';
                     $output .= '<input class="of-color of-typography of-typography-color" original-title="Font color" name="' . $value['id'] . '[color]" id="' . $value['id'] . '_color" type="text" value="' . $typography_stored['color'] . '" />';
                 }
                 break;
                 //border option
             //border option
             case 'border':
                 /* Border Width */
                 $border_stored = $smof_data[$value['id']];
                 $output .= '<div class="select_wrapper border-width">';
                 $output .= '<select class="of-border of-border-width select" name="' . $value['id'] . '[width]" id="' . $value['id'] . '_width">';
                 for ($i = 0; $i < 21; $i++) {
                     $output .= '<option value="' . $i . '" ' . selected($border_stored['width'], $i, false) . '>' . $i . '</option>';
                 }
                 $output .= '</select></div>';
                 /* Border Style */
                 $output .= '<div class="select_wrapper border-style">';
                 $output .= '<select class="of-border of-border-style select" name="' . $value['id'] . '[style]" id="' . $value['id'] . '_style">';
                 $styles = array('none' => 'None', 'solid' => 'Solid', 'dashed' => 'Dashed', 'dotted' => 'Dotted');
                 foreach ($styles as $i => $style) {
                     $output .= '<option value="' . $i . '" ' . selected($border_stored['style'], $i, false) . '>' . $style . '</option>';
                 }
                 $output .= '</select></div>';
                 /* Border Color */
                 $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector"><div style="background-color: ' . $border_stored['color'] . '"></div></div>';
                 $output .= '<input class="of-color of-border of-border-color" name="' . $value['id'] . '[color]" id="' . $value['id'] . '_color" type="text" value="' . $border_stored['color'] . '" />';
                 break;
                 //images checkbox - use image as checkboxes
             //images checkbox - use image as checkboxes
             case 'images':
                 $i = 0;
                 $select_value = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 foreach ($value['options'] as $key => $option) {
                     $i++;
                     $checked = '';
                     $selected = '';
                     if (NULL != checked($select_value, $key, false)) {
                         $checked = checked($select_value, $key, false);
                         $selected = 'of-radio-img-selected';
                     }
                     $output .= '<span>';
                     $output .= '<input type="radio" id="of-radio-img-' . $value['id'] . $i . '" class="checkbox of-radio-img-radio" value="' . $key . '" name="' . $value['id'] . '" ' . $checked . ' />';
                     $output .= '<div class="of-radio-img-label">' . $key . '</div>';
                     $output .= '<img src="' . $option . '" alt="" class="of-radio-img-img ' . $selected . '" onClick="document.getElementById(\'of-radio-img-' . $value['id'] . $i . '\').checked = true;" />';
                     $output .= '</span>';
                 }
                 break;
                 //info (for small intro box etc)
             //info (for small intro box etc)
             case "info":
                 $info_text = $value['std'];
                 $output .= '<div class="of-info">' . $info_text . '</div>';
                 break;
                 //display a single image
             //display a single image
             case "image":
                 $src = $value['std'];
                 $output .= '<img src="' . $src . '">';
                 break;
                 //tab heading
             //tab heading
             case 'heading':
                 if ($counter >= 2) {
                     $output .= '</div>' . "\n";
                 }
                 if (isset($value['classname'])) {
                     $header_class = $value['classname'];
                 } else {
                     $header_class = str_replace(' ', '', strtolower($value['name']));
                 }
                 $jquery_click_hook = "of-option-" . $header_class;
                 $menu .= '<li class="' . $header_class . '"><a title="' . $value['name'] . '" href="#' . $jquery_click_hook . '">' . $value['name'] . '</a></li>';
                 $output .= '<div class="group" id="' . $jquery_click_hook . '"><h2>' . $value['name'] . '</h2>' . "\n";
                 break;
                 //drag & drop slide manager
             //drag & drop slide manager
             case 'slider':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 $output .= '<div class="slider"><ul id="' . $value['id'] . '" rel="' . $int . '">';
                 $slides = $smof_data[$value['id']];
                 $count = count($slides);
                 if ($count < 2) {
                     $oldorder = 1;
                     $order = 1;
                     $output .= Options_Machine::optionsframework_slider_function($value['id'], $value['std'], $oldorder, $order, $int);
                 } else {
                     $i = 0;
                     foreach ($slides as $slide) {
                         $oldorder = $slide['order'];
                         $i++;
                         $order = $i;
                         $output .= Options_Machine::optionsframework_slider_function($value['id'], $value['std'], $oldorder, $order, $int);
                     }
                 }
                 $output .= '</ul>';
                 $output .= '<a href="#" class="button slide_add_button">Add New Slide</a></div>';
                 break;
                 //drag & drop block manager
             //drag & drop block manager
             case 'sorter':
                 $sortlists = isset($smof_data[$value['id']]) && !empty($smof_data[$value['id']]) ? $smof_data[$value['id']] : $value['std'];
                 $output .= '<div id="' . $value['id'] . '" class="sorter">';
                 if ($sortlists) {
                     foreach ($sortlists as $group => $sortlist) {
                         $output .= '<ul id="' . $value['id'] . '_' . $group . '" class="sortlist_' . $value['id'] . '">';
                         $output .= '<h3>' . $group . '</h3>';
                         foreach ($sortlist as $key => $list) {
                             $output .= '<input class="sorter-placebo" type="hidden" name="' . $value['id'] . '[' . $group . '][placebo]" value="placebo">';
                             if ($key != "placebo") {
                                 $output .= '<li id="' . $key . '" class="sortee">';
                                 $output .= '<input class="position" type="hidden" name="' . $value['id'] . '[' . $group . '][' . $key . ']" value="' . $list . '">';
                                 $output .= $list;
                                 $output .= '</li>';
                             }
                         }
                         $output .= '</ul>';
                     }
                 }
                 $output .= '</div>';
                 break;
                 //background images option
             //background images option
             case 'tiles':
                 $i = 0;
                 $select_value = isset($smof_data[$value['id']]) && !empty($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 foreach ($value['options'] as $key => $option) {
                     $i++;
                     $checked = '';
                     $selected = '';
                     if (NULL != checked($select_value, $option, false)) {
                         $checked = checked($select_value, $option, false);
                         $selected = 'of-radio-tile-selected';
                     }
                     $output .= '<span>';
                     $output .= '<input type="radio" id="of-radio-tile-' . $value['id'] . $i . '" class="checkbox of-radio-tile-radio" value="' . $option . '" name="' . $value['id'] . '" ' . $checked . ' />';
                     $output .= '<div class="of-radio-tile-img ' . $selected . '" style="background: url(' . $option . ')" onClick="document.getElementById(\'of-radio-tile-' . $value['id'] . $i . '\').checked = true;"></div>';
                     $output .= '</span>';
                 }
                 break;
                 //backup and restore options data
             //backup and restore options data
             case 'backup':
                 $instructions = $value['desc'];
                 $backup = get_option(BACKUPS);
                 if (!isset($backup['backup_log'])) {
                     $log = __('No backups yet', 'us');
                 } else {
                     $log = $backup['backup_log'];
                 }
                 $output .= '<div class="backup-box">';
                 $output .= '<div class="instructions">' . $instructions . "\n";
                 $output .= '<p><strong>' . __('Last Backup', 'us') . ': <span class="backup-log">' . $log . '</span></strong></p></div>' . "\n";
                 $output .= '<a href="#" id="of_backup_button" class="button">' . __('Backup Options', 'us') . '</a>';
                 $output .= '<a href="#" id="of_restore_button" class="button">' . __('Restore Options', 'us') . '</a>';
                 $output .= '</div>';
                 break;
                 //export or import data between different installs
             //export or import data between different installs
             case 'transfer':
                 $instructions = $value['desc'];
                 $output .= '<textarea id="export_data" rows="8">' . base64_encode(serialize($smof_data)) . '</textarea>' . "\n";
                 $output .= '<a href="#" id="of_import_button" class="button">' . __('Import Options', 'us') . '</a>';
                 break;
                 // google font field
             // google font field
             case 'select_google_font':
                 static $first_google_font_selector = TRUE;
                 if ($first_google_font_selector) {
                     $output .= '<div class="google-fonts-json"' . us_pass_data_to_js(us_config('google-fonts')) . '></div>';
                 }
                 if (!isset($smof_data[$value['id']])) {
                     $smof_data[$value['id']] = $value['std'];
                 }
                 $values = explode('|', $smof_data[$value['id']], 2);
                 if (!isset($values[1]) or empty($values[1])) {
                     $values[1] = '400,700';
                 }
                 $show_weights = (array) us_config('google-fonts.' . $values[0] . '.variants');
                 $output .= '<div class="ggf-container">';
                 $output .= '<input type="hidden" name="' . $value['id'] . '" value="' . implode('|', $values) . '" />';
                 $output .= '<div class="select_wrapper">';
                 $output .= '<select class="select of-input google_font_select" id="' . $value['id'] . '">';
                 $output .= '<option value="none">' . __('Font not specified', 'us') . '</option>';
                 $output .= '<optgroup label="' . __('Web safe font combinations (do not need to be loaded)', 'us') . '">';
                 foreach ($value['options']['web_safe_fonts'] as $select_key => $option) {
                     $output .= "<option value='" . $select_key . "' " . selected($values[0], $option, false) . '>' . $option . '</option>';
                 }
                 $output .= '</optgroup>';
                 $output .= '<optgroup label="' . __('Custom fonts (loaded from Google Fonts)', 'us') . '">';
                 foreach ($value['options']['google_fonts'] as $select_key => $option) {
                     $output .= '<option value="' . $select_key . '" ' . selected($values[0], $option, false) . '>' . $option . '</option>';
                 }
                 $output .= '</optgroup>';
                 $output .= '</select></div>';
                 if (isset($value['preview']['text'])) {
                     $g_text = $value['preview']['text'];
                 } else {
                     $g_text = '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz';
                 }
                 if (isset($value['preview']['size'])) {
                     $g_size = 'style="font-size: ' . $value['preview']['size'] . ';"';
                 } else {
                     $g_size = '';
                 }
                 $output .= '<p class="' . $value['id'] . '_ggf_previewer google_font_preview" ' . $g_size . '>' . $g_text . '</p>';
                 $output .= '<div class="' . $value['id'] . '_ggf_weights ggf_weights">';
                 $values[1] = explode(',', $values[1]);
                 foreach ($gfont_weights as $gfont_weight => $gfont_title) {
                     $output .= '<label for="' . $value['id'] . '_ggf_weight_' . $gfont_weight . '" ';
                     $output .= 'data-value="' . $gfont_weight . '"';
                     $output .= 'class="' . (in_array($gfont_weight, $show_weights) ? '' : 'hidden') . '">';
                     $output .= '<input type="checkbox" id="' . $value['id'] . '_ggf_weight_' . $gfont_weight . '" ';
                     $output .= 'value="' . $gfont_weight . '"';
                     $output .= in_array($gfont_weight, $values[1]) ? ' checked' : '';
                     $output .= '> ';
                     $output .= $gfont_title . '</label>';
                 }
                 $output .= '</div>';
                 $output .= '</div>';
                 break;
                 //JQuery UI Slider
             //JQuery UI Slider
             case 'sliderui':
                 $s_val = $s_min = $s_max = $s_step = $s_edit = '';
                 //no errors, please
                 $s_val = stripslashes(@$smof_data[@$value['id']]);
                 if (!isset($value['min'])) {
                     $s_min = '0';
                 } else {
                     $s_min = $value['min'];
                 }
                 if (!isset($value['max'])) {
                     $s_max = $s_min + 1;
                 } else {
                     $s_max = $value['max'];
                 }
                 if (!isset($value['step'])) {
                     $s_step = '1';
                 } else {
                     $s_step = $value['step'];
                 }
                 if (!isset($value['edit'])) {
                     $s_edit = ' readonly="readonly"';
                 } else {
                     $s_edit = '';
                 }
                 if ($s_val == '') {
                     $s_val = $s_min;
                 }
                 //values
                 $s_data = 'data-id="' . $value['id'] . '" data-val="' . $s_val . '" data-min="' . $s_min . '" data-max="' . $s_max . '" data-step="' . $s_step . '"';
                 //html output
                 $output .= '<input type="text" name="' . $value['id'] . '" id="' . $value['id'] . '" value="' . $s_val . '" class="mini" ' . $s_edit . ' />';
                 $output .= '<div id="' . $value['id'] . '-slider" class="smof_sliderui" style="margin-left: 7px;" ' . $s_data . '></div>';
                 break;
                 //Switch option
             //Switch option
             case 'switch':
                 if (!isset($smof_data[$value['id']])) {
                     $smof_data[$value['id']] = 0;
                 }
                 $fold = '';
                 if (array_key_exists("folds", $value)) {
                     $fold = "s_fld ";
                 }
                 $cb_enabled = $cb_disabled = '';
                 //no errors, please
                 //Get selected
                 if ($smof_data[$value['id']] == 1) {
                     $cb_enabled = ' selected';
                     $cb_disabled = '';
                 } else {
                     $cb_enabled = '';
                     $cb_disabled = ' selected';
                 }
                 //Label ON
                 if (!isset($value['on'])) {
                     $on = __('On', 'us');
                 } else {
                     $on = $value['on'];
                 }
                 //Label OFF
                 if (!isset($value['off'])) {
                     $off = __('Off', 'us');
                 } else {
                     $off = $value['off'];
                 }
                 $output .= '<p class="switch-options">';
                 $output .= '<label class="' . $fold . 'cb-enable' . $cb_enabled . '" data-id="' . $value['id'] . '"><span>' . $on . '</span></label>';
                 $output .= '<label class="' . $fold . 'cb-disable' . $cb_disabled . '" data-id="' . $value['id'] . '"><span>' . $off . '</span></label>';
                 $output .= '<input type="hidden" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                 $output .= '<input type="checkbox" id="' . $value['id'] . '" class="' . $fold . 'checkbox of-input main_checkbox" name="' . $value['id'] . '"  value="1" ' . checked($smof_data[$value['id']], 1, false) . ' />';
                 $output .= '</p>';
                 break;
         }
         //description of each option
         if ($value['type'] != 'heading') {
             if (!isset($value['desc'])) {
                 $explain_value = '';
             } else {
                 $explain_value = '<div class="explain">' . strip_tags($value['desc'], '<a><strong>') . '</div>' . "\n";
             }
             $output .= '</div>' . $explain_value . "\n";
             if ($value['type'] == 'checkbox' or $value['type'] == 'radio') {
                 $output .= '<div class="clear"> </div></div></label>' . "\n";
             } else {
                 $output .= '<div class="clear"> </div></div></div>' . "\n";
             }
         }
     }
     $output .= '</div>';
     return array($output, $menu, $defaults);
 }
Ejemplo n.º 10
0
echo $btn_classes;
?>
"<?php 
echo $btn_inner_css;
?>
>
						<div class="g-preloader style_2"></div>
						<span class="w-btn-label"><?php 
echo $btn_text;
?>
</span>
					</button>
				</div>
				<div class="w-form-field-success"></div>
				<div class="w-form-field-error"></div>
			</div>
		</div>
	</form>
	<?php 
$json_data = array('ajaxurl' => admin_url('admin-ajax.php'), 'success' => us_config('cform.success'), 'errors' => array());
foreach ($fields as $field_name => $field) {
    $json_data['errors'][$field_name] = $field['error'];
}
?>
	<div class="w-form-json hidden"<?php 
echo us_pass_data_to_js($json_data);
?>
></div>
</div>

Ejemplo n.º 11
0
function us_ajax_cform()
{
    $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0;
    if ($post_id <= 0) {
        wp_send_json_error();
    }
    $post = get_post($post_id);
    if (empty($post)) {
        wp_send_json_error();
    }
    $form_index = isset($_POST['form_index']) ? intval($_POST['form_index']) : 1;
    // Retrieving the relevant shortcode from the page to get options
    $post_content = $post->post_content;
    preg_match_all('~\\[(vc_contact_form|us_cform)(.*?)\\]~', $post_content, $matches);
    if (!isset($matches[0][$form_index - 1])) {
        wp_send_json_error();
    }
    // Getting the relevant shortcode options
    $shortcode = $matches[0][$form_index - 1];
    // For proper shortcode_parse_atts behaviour
    $shortcode = substr_replace($shortcode, ' ]', -1);
    $shortcode_name = $matches[1][$form_index - 1];
    $shortcode_atts = shortcode_parse_atts($shortcode);
    // Compatibility with older versions (applying migrations)
    if (class_exists('US_Migration')) {
        $method_name = 'translate_' . $shortcode_name;
        foreach (US_Migration::instance()->translators as $version => $translator) {
            if (method_exists($translator, $method_name)) {
                $translator->{$method_name}($shortcode_name, $shortcode_atts);
            }
        }
    }
    $shortcode_atts = shortcode_atts(array('receiver_email' => '', 'name_field' => 'required', 'email_field' => 'required', 'phone_field' => 'required', 'message_field' => 'required', 'captcha_field' => 'hidden'), $shortcode_atts);
    // Validating fields
    $errors = array();
    $fields = us_config('cform.fields');
    foreach ($fields as $field_name => $field) {
        if (!isset($shortcode_atts[$field_name . '_field']) or $shortcode_atts[$field_name . '_field'] != 'required') {
            continue;
        }
        if ($field['type'] == 'captcha') {
            $captcha = isset($_POST['captcha']) ? stripslashes($_POST['captcha']) : NULL;
            $captcha_hash = isset($_POST['captcha_hash']) ? stripslashes($_POST['captcha_hash']) : NULL;
            $is_valid = $captcha_hash === md5($captcha . NONCE_SALT);
        } elseif ($field['type'] == 'email') {
            $is_valid = (isset($_POST[$field_name]) and filter_var($_POST[$field_name], FILTER_VALIDATE_EMAIL));
        } else {
            $is_valid = (isset($_POST[$field_name]) and !empty($_POST[$field_name]));
        }
        if (!$is_valid) {
            $errors[$field_name] = $field['error'];
        }
    }
    if (!empty($errors)) {
        wp_send_json_error($errors);
    }
    $email_to = get_option('admin_email');
    if (!empty($shortcode_atts['receiver_email'])) {
        $email_to = array_map('sanitize_email', explode(',', $shortcode_atts['receiver_email']));
    }
    $email_body = '';
    foreach ($fields as $field_name => $field) {
        // The field is not used by shortcode
        if (!isset($shortcode_atts[$field_name . '_field']) or $shortcode_atts[$field_name . '_field'] == 'hidden') {
            continue;
        }
        // User didn't fill the field
        if (!isset($_POST[$field_name]) or empty($_POST[$field_name])) {
            continue;
        }
        if ($field['type'] == 'captcha') {
            continue;
        } elseif ($field['type'] == 'email') {
            $value = sanitize_email(stripslashes($_POST[$field_name]));
        } else {
            $value = sanitize_text_field(stripslashes($_POST[$field_name]));
        }
        $email_body .= $field['title'] . ': ' . $value . "\n";
    }
    $email_subject = sprintf(us_config('cform.subject'), get_bloginfo('name'));
    if (empty($email_body)) {
        wp_send_json_error(us_config('cform.error.empty_message'));
    }
    // Send attempt
    $success = wp_mail($email_to, $email_subject, $email_body);
    if ($success) {
        wp_send_json_success(us_config('cform.success'));
    } else {
        wp_send_json_error(us_config('cform.error.other'));
    }
}
Ejemplo n.º 12
0
 function of_options()
 {
     global $us_stylesheet_directory, $us_template_directory_uri;
     //Access the WordPress Categories via an Array
     $of_categories = array();
     $of_categories_obj = get_categories('hide_empty=0');
     foreach ($of_categories_obj as $of_cat) {
         $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;
     }
     $categories_tmp = array_unshift($of_categories, "Select a category:");
     //Access the WordPress Pages via an Array
     $of_pages = array();
     $of_pages_obj = get_pages('sort_column=post_parent,menu_order');
     foreach ($of_pages_obj as $of_page) {
         $of_pages[$of_page->ID] = $of_page->post_name;
     }
     $of_pages_tmp = array_unshift($of_pages, "Select a page:");
     //Testing
     $of_options_select = array('one', 'two', 'three', 'four', 'five');
     $of_options_radio = array('one' => 'One', 'two' => 'Two', 'three' => 'Three', 'four' => 'Four', 'five' => 'Five');
     //Sample Homepage blocks for the layout manager (sorter)
     $of_options_homepage_blocks = array('disabled' => array('placebo' => 'placebo', 'block_one' => 'Block One', 'block_two' => 'Block Two', 'block_three' => 'Block Three'), 'enabled' => array('placebo' => 'placebo', 'block_four' => 'Block Four'));
     //Stylesheets Reader
     $alt_stylesheet_path = LAYOUT_PATH;
     $alt_stylesheets = array();
     if (is_dir($alt_stylesheet_path)) {
         if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
             while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== FALSE) {
                 if (stristr($alt_stylesheet_file, ".css") !== FALSE) {
                     $alt_stylesheets[] = $alt_stylesheet_file;
                 }
             }
         }
     }
     //Background Images Reader
     $bg_images_path = $us_stylesheet_directory . '/images/bg/';
     // change this to where you store your bg images
     $bg_images_url = $us_template_directory_uri . '/images/bg/';
     // change this to where you store your bg images
     $bg_images = array();
     if (is_dir($bg_images_path)) {
         if ($bg_images_dir = opendir($bg_images_path)) {
             while (($bg_images_file = readdir($bg_images_dir)) !== FALSE) {
                 if (stristr($bg_images_file, ".png") !== FALSE || stristr($bg_images_file, ".jpg") !== FALSE) {
                     $bg_images[] = $bg_images_url . $bg_images_file;
                 }
             }
         }
     }
     /*-----------------------------------------------------------------------------------*/
     /* TO DO: Add options/functions that use these */
     /*-----------------------------------------------------------------------------------*/
     //More Options
     $uploads_arr = wp_upload_dir();
     $all_uploads_path = $uploads_arr['path'];
     $all_uploads = get_option('of_uploads');
     $other_entries = array('Select a number:', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19');
     $body_repeat = array('no-repeat', 'repeat-x', 'repeat-y', 'repeat');
     $body_pos = array('top left', 'top center', 'top right', 'center left', 'center center', 'center right', 'bottom left', 'bottom center', 'bottom right');
     // Image Alignment radio box
     $of_options_thumb_align = array('alignleft' => 'Left', 'alignright' => 'Right', 'aligncenter' => 'Center');
     // Image Links to Options
     $of_options_image_link_to = array('image' => 'The Image', 'post' => 'The Post');
     $web_safe_fonts = array('Georgia, serif' => 'Georgia, serif', '"Palatino Linotype", "Book Antiqua", Palatino, serif' => 'Palatino Linotype, Book Antiqua, Palatino, serif', '"Times New Roman", Times, serif' => 'Times New Roman, Times, serif', 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', 'Impact, Charcoal, sans-serif' => 'Impact, Charcoal, sans-serif', '"Lucida Sans Unicode", "Lucida Grande", sans-serif' => 'Lucida Sans Unicode, Lucida Grande, sans-serif', 'Tahoma, Geneva, sans-serif' => 'Tahoma, Geneva, sans-serif', '"Trebuchet MS", Helvetica, sans-serif' => 'Trebuchet MS, Helvetica, sans-serif', 'Verdana, Geneva, sans-serif' => 'Verdana, Geneva, sans-serif', '"Courier New", Courier, monospace' => 'Courier New, Courier, monospace', '"Lucida Console", Monaco, monospace' => 'Lucida Console, Monaco, monospace');
     $google_fonts = us_config('google-fonts');
     $google_font_names = array();
     foreach ($google_fonts as $font_name => &$font_params) {
         $google_font_names[$font_name] = $font_name;
     }
     $google_fonts_subsets = array('latin' => 'latin', 'latin-ext' => 'latin-ext', 'cyrillic' => 'cyrillic', 'cyrillic-ext' => 'cyrillic-ext', 'greek' => 'greek', 'greek-ext' => 'greek-ext', 'vietnamese' => 'vietnamese', 'khmer' => 'khmer');
     $url_fontawesome = 'http://fontawesome.io/icons/';
     $url_mdfi = 'http://designjockey.github.io/material-design-fonticons/';
     /*-----------------------------------------------------------------------------------*/
     /* The Options Array */
     /*-----------------------------------------------------------------------------------*/
     // Set the Options Array
     global $of_options;
     $of_options = array();
     //$prefix = 'us_'
     $of_options[] = array('name' => __('General Settings', 'us'), 'type' => 'heading', 'classname' => 'generalsettings');
     $url = ADMIN_DIR . 'assets/images/';
     $of_options[] = array('name' => __('Logo Type', 'us'), 'id' => 'logo_type', 'std' => 'text', 'type' => 'images', 'options' => array('text' => $url . 'logo-text.png', 'img' => $url . 'logo-img.png'));
     $of_options[] = array('name' => __('Logo Text', 'us'), 'desc' => __('Add text which will be shown as logo. Better keep it short.', 'us'), 'id' => 'logo_text', 'std' => 'LOGO', 'type' => 'text');
     $of_options[] = array('name' => __('Logo Text Size', 'us'), 'desc' => __('Set value from 12 to 60 (px)', 'us'), 'id' => 'logo_font_size', 'type' => 'sliderui', 'std' => '27', 'min' => '12', 'step' => '1', 'max' => '60');
     $of_options[] = array('name' => __('Logo Text Size for Tablets <span class="w-info">(screen width < 900px)</span>', 'us'), 'desc' => __('Set value from 12 to 60 (px)', 'us'), 'id' => 'logo_font_size_tablets', 'type' => 'sliderui', 'std' => '24', 'min' => '12', 'step' => '1', 'max' => '60');
     $of_options[] = array('name' => __('Logo Text Size for Mobiles <span class="w-info">(screen width < 600px)</span>', 'us'), 'desc' => __('Set value from 12 to 60 (px)', 'us'), 'id' => 'logo_font_size_mobiles', 'type' => 'sliderui', 'std' => '20', 'min' => '12', 'step' => '1', 'max' => '60');
     $of_options[] = array('name' => __('Logo Image', 'us'), 'desc' => __('Maximum recommended size is 300px of height (also for retina displays)', 'us'), 'id' => 'logo_image', 'std' => '', 'type' => 'upload');
     $of_options[] = array('name' => __('Logo Image in the Transparent Header <span class="w-info">(optional)</span>', 'us'), 'desc' => __('Maximum recommended size is 300px of height (also for retina displays)', 'us'), 'id' => 'logo_image_transparent', 'std' => '', 'type' => 'upload');
     $of_options[] = array('name' => __('Logo Height', 'us'), 'desc' => __('Set value from 20 to 150 (px)', 'us'), 'id' => 'logo_height', 'type' => 'sliderui', 'std' => '60', 'min' => '20', 'step' => '1', 'max' => '150');
     $of_options[] = array('name' => __('Logo Height in the Sticky Header', 'us'), 'desc' => __('Set value from 20 to 150 (px)', 'us'), 'id' => 'logo_height_sticky', 'type' => 'sliderui', 'std' => '60', 'min' => '20', 'step' => '1', 'max' => '150');
     $of_options[] = array('name' => __('Logo Height for Tablets <span class="w-info">(screen width < 900px)</span>', 'us'), 'desc' => __('Set value from 20 to 80 (px)', 'us'), 'id' => 'logo_height_tablets', 'type' => 'sliderui', 'std' => '40', 'min' => '20', 'step' => '1', 'max' => '80');
     $of_options[] = array('name' => __('Logo Height for Mobiles <span class="w-info">(screen width < 600px)</span>', 'us'), 'desc' => __('Set value from 20 to 50 (px)', 'us'), 'id' => 'logo_height_mobiles', 'type' => 'sliderui', 'std' => '30', 'min' => '20', 'step' => '1', 'max' => '50');
     $of_options[] = array('name' => __('Logo Width', 'us'), 'desc' => __('Set value from 100 to 400 (px)', 'us'), 'id' => 'logo_width', 'type' => 'sliderui', 'std' => '200', 'min' => '100', 'step' => '1', 'max' => '400');
     $of_options[] = array('name' => __('Favicon', 'us'), 'desc' => __('Upload an ICO/PNG/GIF image that will represent your website\'s favicon', 'us'), 'id' => 'favicon', 'std' => '', 'type' => 'upload');
     $of_options[] = array('name' => __('Sidebar at Regular Pages', 'us'), 'desc' => __('Select sidebar position or disable sidebar for all regular pages', 'us'), 'id' => 'page_sidebar', 'std' => 'none', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Page Comments', 'us'), 'desc' => __('Enable comments for all regular pages', 'us'), 'id' => 'page_comments', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Theme Options CSS File', 'us'), 'desc' => __('Store Theme Options generated styles in a separate CSS file', 'us'), 'id' => 'generate_css_file', 'std' => 1, 'type' => 'switch');
     if (class_exists('Vc_Manager')) {
         $of_options[] = array('name' => __('Unsupported Features of Visual Composer', 'us'), 'desc' => __('Enable theme-disabled VC\'s shortcodes and features', 'us'), 'id' => 'enable_unsupported_vc_shortcodes', 'std' => 0, 'folds' => 1, 'type' => 'switch');
         $of_options[] = array('name' => '', 'std' => __('<strong>Note</strong>: Enabling the theme-disabled VC\'s shortcodes and features will reduce your website load speed and performance. Also some of the theme-disabled shortcodes could be not fully supported by the theme and/or not styled properly.', 'us'), 'id' => 'enable_unsupported_vc_shortcodes_info', 'type' => 'info', 'fold' => 'enable_unsupported_vc_shortcodes');
     }
     $of_options[] = array('name' => __('Custom HTML Code', 'us'), 'desc' => __('Paste your custom code here, it will be added into the footer section of your site. You can use JS code with &lt;script&gt;&lt;/script&gt; tags. Also you can add Google Analytics or other tracking code into this field.', 'us'), 'id' => 'custom_html', 'std' => '', 'type' => 'textarea');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Layout Options', 'us'), 'type' => 'heading', 'classname' => 'layoutoptions');
     $of_options[] = array('name' => __('Responsive Layout', 'us'), 'desc' => __('Enable responsive layout', 'us'), 'id' => 'responsive_layout', 'std' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Site Canvas Layout', 'us'), 'id' => 'canvas_layout', 'std' => 'wide', 'type' => 'images', 'options' => array('wide' => $url . 'canvas-wide.png', 'boxed' => $url . 'canvas-boxed.png'));
     $of_options[] = array('name' => '', 'desc' => __('Body Background Color', 'us'), 'id' => 'color_body_bg', 'std' => '#eee', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Set Body Background Image', 'us'), 'id' => 'body_bg_image', 'type' => 'upload');
     $of_options[] = array('name' => '', 'desc' => __('Background Image repeat', 'us'), 'id' => 'body_bg_image_repeat', 'type' => 'select', 'std' => 'repeat', 'options' => array('repeat' => __('Repeat', 'us'), 'repeat-x' => __('Repeat Horizontally', 'us'), 'repeat-y' => __('Repeat Vertically', 'us'), 'no-repeat' => __('Do Not Repeat', 'us')));
     $of_options[] = array('name' => '', 'desc' => __('Background Image position', 'us'), 'id' => 'body_bg_image_position', 'type' => 'select', 'std' => 'top_center', 'options' => array('top center' => __('Top Center', 'us'), 'top left' => __('Top Left', 'us'), 'top right' => __('Top Right', 'us'), 'center center' => __('Center Center', 'us'), 'center left' => __('Center Left', 'us'), 'center right' => __('Center Right', 'us'), 'bottom center' => __('Bottom Center', 'us'), 'bottom left' => __('Bottom Left', 'us'), 'bottom right' => __('Bottom Right', 'us')));
     $of_options[] = array('name' => '', 'desc' => __('Background Image attachment', 'us'), 'id' => 'body_bg_image_attachment', 'type' => 'select', 'std' => 'scroll', 'options' => array('scroll' => __('Scroll', 'us'), 'fixed' => __('Fixed', 'us')));
     $of_options[] = array('name' => '', 'desc' => __('Background Image size', 'us'), 'id' => 'body_bg_image_size', 'type' => 'select', 'std' => 'cover', 'options' => array('cover' => __('Cover - Image will cover the whole browser viewport', 'us'), 'contain' => __('Contain - Image will fit inside the browser viewport', 'us'), 'initial' => __('Initial size', 'us')));
     $of_options[] = array('name' => __('Site Canvas Width', 'us'), 'desc' => __('Set value from 1000 to 1400 (px)', 'us'), 'id' => 'site_canvas_width', 'type' => 'sliderui', 'std' => '1300', 'min' => '1000', 'step' => '10', 'max' => '1400');
     $of_options[] = array('name' => __('Site Content Width', 'us'), 'desc' => __('Set value from 900 to 1300 (px)', 'us'), 'id' => 'site_content_width', 'type' => 'sliderui', 'std' => '1140', 'min' => '900', 'step' => '10', 'max' => '1300');
     $of_options[] = array('name' => __('Sidebar Width <span class="w-info">(for pages with sidebar only)</span>', 'us'), 'desc' => __('Set value from 20 to 50 (%)', 'us'), 'id' => 'sidebar_width', 'type' => 'sliderui', 'std' => '25', 'min' => '20', 'step' => '1', 'max' => '50');
     $of_options[] = array('name' => __('Content Width <span class="w-info">(for pages with sidebar only)</span>', 'us'), 'desc' => __('Set value from 50 to 80 (%)', 'us'), 'id' => 'content_width', 'type' => 'sliderui', 'std' => '68', 'min' => '50', 'step' => '1', 'max' => '80');
     $of_options[] = array('name' => __('Columns Stacking Width', 'us'), 'desc' => __('When screen width is less than this value, all columns within a row will become a single column.', 'us'), 'id' => 'columns_stacking_width', 'type' => 'sliderui', 'std' => '767', 'min' => '480', 'step' => '1', 'max' => '1024');
     $of_options[] = array('name' => __('Effects Disabling Width', 'us'), 'desc' => __('When screen width is less than this value, vertical parallax and animation of elements appearance will be disabled.', 'us'), 'id' => 'disable_effects_width', 'type' => 'sliderui', 'std' => '900', 'min' => '480', 'step' => '1', 'max' => '1024');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Styling', 'us'), 'type' => 'heading', 'classname' => 'styling');
     $style_schemes = us_config('style-schemes');
     $of_options[] = array('name' => __('Predefined Color Style', 'us'), 'id' => 'color_style', 'type' => 'select_predefined_options', 'options' => &$style_schemes);
     /*--------------------------------------*/
     $of_options[] = array('name' => __('Custom Color Style', 'us'), 'desc' => __('Change <strong>Header</strong> colors', 'us'), 'id' => 'change_header_colors', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Header Background Color', 'us'), 'id' => 'color_header_bg', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Header Text Color', 'us'), 'id' => 'color_header_text', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Header Text Hover Color', 'us'), 'id' => 'color_header_text_hover', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Extended Header Background Color', 'us'), 'id' => 'color_header_ext_bg', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Extended Header Text Color', 'us'), 'id' => 'color_header_ext_text', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Extended Header Text Hover Color', 'us'), 'id' => 'color_header_ext_text_hover', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Transparent Header Text Color', 'us'), 'id' => 'color_header_transparent_text', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Transparent Header Hover Text Color', 'us'), 'id' => 'color_header_transparent_text_hover', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Search Screen Background Color', 'us'), 'id' => 'color_header_search_bg', 'fold' => 'change_header_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Search Screen Text Color', 'us'), 'id' => 'color_header_search_text', 'fold' => 'change_header_colors', 'type' => 'color');
     /*--------------------------------------*/
     $of_options[] = array('name' => '', 'desc' => __('Change <strong>Main Menu</strong> colors', 'us'), 'id' => 'change_menu_colors', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Transparent Menu Active Text Color', 'us'), 'id' => 'color_menu_transparent_active_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Active Text Color', 'us'), 'id' => 'color_menu_active_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Hover Background Color', 'us'), 'id' => 'color_menu_hover_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Hover Text Color', 'us'), 'id' => 'color_menu_hover_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Background Color', 'us'), 'id' => 'color_drop_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Text Color', 'us'), 'id' => 'color_drop_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Hover Background Color', 'us'), 'id' => 'color_drop_hover_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Hover Text Color', 'us'), 'id' => 'color_drop_hover_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Active Background Color', 'us'), 'id' => 'color_drop_active_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Dropdown Active Text Color', 'us'), 'id' => 'color_drop_active_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Button Background Color', 'us'), 'id' => 'color_menu_button_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Button Text Color', 'us'), 'id' => 'color_menu_button_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Button Hover Background Color', 'us'), 'id' => 'color_menu_button_hover_bg', 'fold' => 'change_menu_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Menu Button Hover Text Color', 'us'), 'id' => 'color_menu_button_hover_text', 'fold' => 'change_menu_colors', 'type' => 'color');
     /*--------------------------------------*/
     $of_options[] = array('name' => '', 'desc' => __('Change <strong>Content</strong> colors', 'us'), 'id' => 'change_content_colors', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Background Color', 'us'), 'id' => 'color_content_bg', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Alternate Background Color', 'us'), 'id' => 'color_content_bg_alt', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Border Color', 'us'), 'id' => 'color_content_border', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Heading Color', 'us'), 'id' => 'color_content_heading', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Text Color', 'us'), 'id' => 'color_content_text', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Primary Color', 'us'), 'id' => 'color_content_primary', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Secondary Color', 'us'), 'id' => 'color_content_secondary', 'fold' => 'change_content_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Faded Elements Color', 'us'), 'id' => 'color_content_faded', 'fold' => 'change_content_colors', 'type' => 'color');
     /*--------------------------------------*/
     $of_options[] = array('name' => '', 'desc' => __('Change <strong>SubFooter</strong> colors', 'us'), 'id' => 'change_subfooter_colors', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Background Color', 'us'), 'id' => 'color_subfooter_bg', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Alternate Background Color', 'us'), 'id' => 'color_subfooter_bg_alt', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Border Color', 'us'), 'id' => 'color_subfooter_border', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Heading Color', 'us'), 'id' => 'color_subfooter_heading', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Text Color', 'us'), 'id' => 'color_subfooter_text', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Link Color', 'us'), 'id' => 'color_subfooter_link', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Link Hover Color', 'us'), 'id' => 'color_subfooter_link_hover', 'fold' => 'change_subfooter_colors', 'type' => 'color');
     /*--------------------------------------*/
     $of_options[] = array('name' => '', 'desc' => __('Change <strong>Footer</strong> colors', 'us'), 'id' => 'change_footer_colors', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Background Color', 'us'), 'id' => 'color_footer_bg', 'fold' => 'change_footer_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Text Color', 'us'), 'id' => 'color_footer_text', 'fold' => 'change_footer_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Link Color', 'us'), 'id' => 'color_footer_link', 'fold' => 'change_footer_colors', 'type' => 'color');
     $of_options[] = array('name' => '', 'desc' => __('Link Hover Color', 'us'), 'id' => 'color_footer_link_hover', 'fold' => 'change_footer_colors', 'type' => 'color');
     $of_options[] = array('name' => __('Quick CSS', 'us'), 'desc' => __('Paste your CSS code. Do not include <strong>&lt;pre&gt;&lt;/pre&gt;</strong> tags or any html tag in this field.', 'us'), 'id' => 'custom_css', 'type' => 'textarea');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Header Options', 'us'), 'type' => 'heading', 'classname' => 'headeroptions');
     $of_options[] = array('name' => __('Header Layout', 'us'), 'id' => 'header_options_layout', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => '', 'id' => 'header_layout', 'std' => 'standard', 'type' => 'images', 'options' => array('standard' => $url . 'header1.png', 'extended' => $url . 'header2.png', 'advanced' => $url . 'header3.png', 'centered' => $url . 'header4.png', 'sided' => $url . 'header5.png'));
     $of_options[] = array('name' => __('Transparent Header', 'us'), 'desc' => __('Make the header transparent at its initial position by default', 'us'), 'id' => 'header_transparent', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Sticky Header', 'us'), 'desc' => __('Fix the header at the top of a page during scroll by default', 'us'), 'id' => 'header_sticky', 'std' => 1, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Disable Sticky Header at width:', 'us'), 'desc' => __('When screen width is less than this value, sticky header becomes non-sticky.', 'us'), 'id' => 'header_sticky_disable_width', 'std' => '900', 'min' => '300', 'step' => '1', 'max' => '1200', 'fold' => 'header_sticky', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Hidden Header', 'us'), 'desc' => __('Hide the sticky header at its initial position by default', 'us'), 'id' => 'header_hidden', 'fold' => 'header_sticky', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => '', 'std' => __('<strong>Transparent</strong>, <strong>Sticky</strong> and <strong>Hidden</strong> options can be set for a separate certain page when editing it. If the options above has no effect for some page, check its Header Options.', 'us'), 'id' => 'header_info', 'type' => 'info');
     $of_options[] = array('name' => __('Fullwidth Header', 'us'), 'desc' => __('Stretch header content to the screen width', 'us'), 'id' => 'header_fullwidth', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Inverted Logo Position', 'us'), 'desc' => __('Place Logo to the right side of the Header', 'us'), 'id' => 'header_invert_logo_pos', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Main header area height', 'us'), 'desc' => __('Set value from 50 to 150 (px)', 'us'), 'id' => 'header_main_height', 'std' => '100', 'min' => '50', 'step' => '1', 'max' => '150', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Sticky Main header area height', 'us'), 'desc' => __('Set value from 50 to 150 (px)', 'us'), 'id' => 'header_main_sticky_height_1', 'std' => '50', 'min' => '50', 'step' => '1', 'max' => '150', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Sticky Main header area height', 'us'), 'desc' => __('Set value from 0 to 150 (px)', 'us'), 'id' => 'header_main_sticky_height_2', 'std' => '50', 'min' => '0', 'step' => '1', 'max' => '150', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Extra header area height', 'us'), 'desc' => __('Set value from 40 to 60 (px)', 'us'), 'id' => 'header_extra_height', 'std' => '50', 'min' => '40', 'step' => '1', 'max' => '60', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Sticky Extra header area height', 'us'), 'desc' => __('Set value from 0 to 60 (px)', 'us'), 'id' => 'header_extra_sticky_height_1', 'std' => '40', 'min' => '0', 'step' => '1', 'max' => '60', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Sticky Extra header area height', 'us'), 'desc' => __('Set value from 40 to 60 (px)', 'us'), 'id' => 'header_extra_sticky_height_2', 'std' => '40', 'min' => '40', 'step' => '1', 'max' => '60', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Header Width', 'us'), 'desc' => __('Set value from 200 to 400 (px)', 'us'), 'id' => 'header_main_width', 'type' => 'sliderui', 'std' => '300', 'min' => '200', 'step' => '1', 'max' => '400');
     $of_options[] = array('name' => __('Header Scroll Breakpoint', 'us'), 'desc' => __('This option sets scroll distance (in pixels) from the top of a page after which the header will be shrunk if it\'s sticky, becomes visible if it\'s hidden, and becomes solid if it\'s transparent.', 'us'), 'id' => 'header_scroll_breakpoint', 'std' => '100', 'min' => '1', 'step' => '1', 'max' => '200', 'fold' => 'header_sticky', 'type' => 'sliderui');
     $of_options[] = array('name' => __('Header Elements', 'us'), 'id' => 'header_options_elements', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => '', 'desc' => __('Show <strong>Search Widget</strong> in the Header', 'us'), 'id' => 'header_search_show', 'std' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Show <strong>Contacts Widget</strong> in the Header', 'us'), 'id' => 'header_contacts_show', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Contact Phone Number', 'us'), 'desc' => '', 'id' => 'header_contacts_phone', 'std' => '', 'fold' => 'header_contacts_show', 'type' => 'text');
     $of_options[] = array('name' => __('Contact Email', 'us'), 'desc' => '', 'id' => 'header_contacts_email', 'std' => '', 'fold' => 'header_contacts_show', 'type' => 'text');
     $of_options[] = array('name' => __('Contact Custom Icon', 'us'), 'desc' => sprintf(__('<a href="%s" target="_blank">FontAwesome</a> or <a href="%s" target="_blank">Material Design</a> icon', 'us'), $url_fontawesome, $url_mdfi), 'id' => 'header_contacts_custom_icon', 'std' => '', 'fold' => 'header_contacts_show', 'type' => 'text');
     $of_options[] = array('name' => __('Contact Custom Text', 'us'), 'desc' => __('Use can use HTML tags in this field (e.g. &lt;a href=""&gt;&lt;/a&gt; for adding links)', 'us'), 'id' => 'header_contacts_custom_text', 'std' => '', 'fold' => 'header_contacts_show', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Show <strong>Social Links</strong> in the Header', 'us'), 'id' => 'header_socials_show', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => 'Facebook', 'desc' => '', 'id' => 'header_socials_facebook', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Twitter', 'desc' => '', 'id' => 'header_socials_twitter', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Google+', 'desc' => '', 'id' => 'header_socials_google', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'LinkedIn', 'desc' => '', 'id' => 'header_socials_linkedin', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'YouTube', 'desc' => '', 'id' => 'header_socials_youtube', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Vimeo', 'desc' => '', 'id' => 'header_socials_vimeo', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Flickr', 'desc' => '', 'id' => 'header_socials_flickr', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Instagram', 'desc' => '', 'id' => 'header_socials_instagram', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Behance', 'desc' => '', 'id' => 'header_socials_behance', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Xing', 'desc' => '', 'id' => 'header_socials_xing', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Pinterest', 'desc' => '', 'id' => 'header_socials_pinterest', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Skype', 'desc' => '', 'id' => 'header_socials_skype', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Tumblr', 'desc' => '', 'id' => 'header_socials_tumblr', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Dribbble', 'desc' => '', 'id' => 'header_socials_dribbble', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Vkontakte', 'desc' => '', 'id' => 'header_socials_vk', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'SoundCloud', 'desc' => '', 'id' => 'header_socials_soundcloud', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Yelp', 'desc' => '', 'id' => 'header_socials_yelp', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Twitch', 'desc' => '', 'id' => 'header_socials_twitch', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'DeviantArt', 'desc' => '', 'id' => 'header_socials_deviantart', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Foursquare', 'desc' => '', 'id' => 'header_socials_foursquare', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'GitHub', 'desc' => '', 'id' => 'header_socials_github', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Odnoklassniki', 'desc' => '', 'id' => 'header_socials_odnoklassniki', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => '500px', 'desc' => '', 'id' => 'header_socials_s500px', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'Houzz', 'desc' => '', 'id' => 'header_socials_houzz', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => 'RSS', 'desc' => '', 'id' => 'header_socials_rss', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => __('Custom Item Icon', 'us'), 'desc' => sprintf(__('<a href="%s" target="_blank">FontAwesome</a> or <a href="%s" target="_blank">Material Design</a> icon', 'us'), $url_fontawesome, $url_mdfi), 'id' => 'header_socials_custom_icon', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => __('Custom Item URL', 'us'), 'id' => 'header_socials_custom_url', 'std' => '', 'fold' => 'header_socials_show', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Show <strong>Language Widget</strong> in the Header', 'us'), 'id' => 'header_language_show', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Languages Source', 'us'), 'id' => 'header_language_source', 'std' => 'own', 'type' => 'select', 'options' => array('own' => __('My own links', 'us'), 'wpml' => __('WPML switcher', 'us')), 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Links Title', 'us'), 'desc' => __('This text will be shown as the first active item of the dropdown menu.', 'us'), 'id' => 'header_link_title', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Links Quantity', 'us'), 'id' => 'header_link_qty', 'std' => '2', 'type' => 'select', 'options' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9'), 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 1', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_1_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_1_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 2', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_2_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_2_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 3', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_3_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_3_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 4', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_4_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_4_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 5', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_5_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_5_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 6', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_6_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_6_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 7', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_7_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_7_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 8', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_8_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_8_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => __('Link 9', 'us'), 'desc' => __('Link Label', 'us'), 'id' => 'header_link_9_label', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     $of_options[] = array('name' => '', 'desc' => __('Link URL', 'us'), 'id' => 'header_link_9_url', 'std' => '', 'type' => 'text', 'fold' => 'header_language_show');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Menu Options', 'us'), 'type' => 'heading', 'classname' => 'menuoptions');
     $of_options[] = array('name' => __('Menu Dropdown Effect', 'us'), 'desc' => '', 'id' => 'menu_dropdown_effect', 'std' => 'mdesign', 'type' => 'select', 'options' => array('opacity' => __('FadeIn', 'us'), 'height' => __('FadeIn + SlideDown', 'us'), 'mdesign' => __('Material Design Effect', 'us')));
     $of_options[] = array('name' => __('Mobile Menu at width (px):', 'us'), 'desc' => __('When screen width is less than this value, main menu transforms to mobile-friendly layout.', 'us'), 'id' => 'menu_mobile_width', 'std' => '900', 'type' => 'text');
     $of_options[] = array('name' => __('Mobile Menu Behaviour', 'us'), 'desc' => __('Open sub items on click at menu titles (instead of arrows)', 'us'), 'id' => 'menu_togglable_type', 'std' => 1, 'type' => 'switch');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Title Bar Options', 'us'), 'type' => 'heading', 'classname' => 'titlebaroptions');
     $of_options[] = array('name' => __('Title Bar Content', 'us'), 'desc' => __('This option is applied to all regular pages, Portfolio Item pages, Archive pages and Search Results page.', 'us'), 'id' => 'titlebar_content', 'std' => 'all', 'type' => 'select', 'options' => array('all' => __('Captions and Breadcrumbs / Arrows', 'us'), 'caption' => __('Captions Only', 'us'), 'hide' => __('Hide Title Bar', 'us')));
     $of_options[] = array('name' => __('Title Bar Size', 'us'), 'desc' => __('This option is applied to all pages.', 'us'), 'id' => 'titlebar_size', 'std' => 'large', 'type' => 'select', 'options' => array('small' => __('Ultra Compact', 'us'), 'medium' => __('Compact', 'us'), 'large' => __('Large', 'us'), 'huge' => __('Huge', 'us')));
     $of_options[] = array('name' => __('Title Bar Color Style', 'us'), 'desc' => __('This option is applied to all pages.', 'us'), 'id' => 'titlebar_color', 'std' => 'alternate', 'type' => 'select', 'options' => array('default' => __('Content bg | Content text', 'us'), 'alternate' => __('Alternate bg | Content text', 'us'), 'primary' => __('Primary bg | White text', 'us'), 'secondary' => __('Secondary bg | White text', 'us')));
     $of_options[] = array('name' => '', 'std' => __('<strong>Title Bar options</strong> can be set for a separate certain page when editing it. If the options above has no effect for some page, check its Title Bar Options.', 'us'), 'id' => 'titlebar_info', 'type' => 'info');
     /*--------------------------------------------------------------------------*/
     $of_options[] = array('name' => __('Footer Options', 'us'), 'type' => 'heading', 'classname' => 'footeroptions');
     $of_options[] = array('name' => __('Subfooter', 'us'), 'desc' => __('Show <strong>Subfooter</strong> (widgets area)', 'us'), 'id' => 'footer_show_top', 'std' => 0, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Subfooter Columns', 'us'), 'desc' => sprintf(__('Set number of columns in Subfooter. You can populate these columns with <a target="_blank" href="%s">widgets</a>.', 'us'), admin_url() . 'widgets.php'), 'id' => 'footer_columns', 'std' => 3, 'type' => 'select', 'fold' => 'footer_show_top', 'options' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4'));
     $of_options[] = array('name' => __('Footer', 'us'), 'desc' => __('Show <strong>Footer</strong> (copyright and menu area)', 'us'), 'id' => 'footer_show_bottom', 'std' => 1, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => __('Copyright Text', 'us'), 'desc' => '', 'id' => 'footer_copyright', 'std' => 'Any text goes here', 'fold' => 'footer_show_bottom', 'type' => 'text');
     $of_options[] = array('name' => __('Typography', 'us'), 'type' => 'heading', 'classname' => 'typography');
     $of_options[] = array('name' => __('Headings', 'us'), 'desc' => '', 'id' => 'heading_font_family', 'std' => 'Roboto', 'type' => 'select_google_font', 'preview' => array('text' => 'Heading Font Preview', 'size' => '30px'), 'options' => array('web_safe_fonts' => $web_safe_fonts, 'google_fonts' => $google_font_names));
     $of_options[] = array('name' => __('Sizes on Desktops', 'us'), 'desc' => __('<strong>Heading 1</strong> font size', 'us'), 'id' => 'h1_fontsize', 'std' => '40', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Sizes on Mobiles', 'us'), 'desc' => __('<strong>Heading 1</strong> font size', 'us'), 'id' => 'h1_fontsize_mobile', 'std' => '30', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 2</strong> font size', 'us'), 'id' => 'h2_fontsize', 'std' => '34', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 2</strong> font size', 'us'), 'id' => 'h2_fontsize_mobile', 'std' => '26', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 3</strong> font size', 'us'), 'id' => 'h3_fontsize', 'std' => '28', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 3</strong> font size', 'us'), 'id' => 'h3_fontsize_mobile', 'std' => '22', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 4</strong> font size', 'us'), 'id' => 'h4_fontsize', 'std' => '24', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 4</strong> font size', 'us'), 'id' => 'h4_fontsize_mobile', 'std' => '20', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 5</strong> font size', 'us'), 'id' => 'h5_fontsize', 'std' => '20', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 5</strong> font size', 'us'), 'id' => 'h5_fontsize_mobile', 'std' => '18', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 6</strong> font size', 'us'), 'id' => 'h6_fontsize', 'std' => '18', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('<strong>Heading 6</strong> font size', 'us'), 'id' => 'h6_fontsize_mobile', 'std' => '16', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Regular Text', 'us'), 'desc' => '', 'id' => 'body_font_family', 'std' => 'Roboto', 'type' => 'select_google_font', 'preview' => array('text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec condimentum tellus purus condimentum pulvinar. Duis cursus bibendum dui, eget iaculis urna pharetra. Aenean semper nec ipsum vitae mollis.', 'size' => '15px'), 'options' => array('web_safe_fonts' => $web_safe_fonts, 'google_fonts' => $google_font_names));
     $of_options[] = array('name' => __('Sizes on Desktops', 'us'), 'desc' => __('Font size', 'us'), 'id' => 'body_fontsize', 'std' => '14', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Sizes on Mobiles', 'us'), 'desc' => __('Font size', 'us'), 'id' => 'body_fontsize_mobile', 'std' => '13', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Line height', 'us'), 'id' => 'body_lineheight', 'std' => '24', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Line height', 'us'), 'id' => 'body_lineheight_mobile', 'std' => '23', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Main Menu Text', 'us'), 'desc' => '', 'id' => 'menu_font_family', 'std' => 'Roboto', 'type' => 'select_google_font', 'preview' => array('text' => 'Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;About&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Services&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Portfolio', 'size' => '16px'), 'options' => array('web_safe_fonts' => $web_safe_fonts, 'google_fonts' => $google_font_names));
     $of_options[] = array('name' => __('Sizes for Default Menu', 'us'), 'desc' => __('Font size of <strong>main</strong> items', 'us'), 'id' => 'menu_fontsize', 'std' => '16', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Sizes for Mobile Menu', 'us'), 'desc' => __('Font size of <strong>main</strong> items', 'us'), 'id' => 'menu_fontsize_mobile', 'std' => '16', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Font size of <strong>sub</strong> items', 'us'), 'id' => 'menu_sub_fontsize', 'std' => '15', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => '', 'desc' => __('Font size of <strong>sub</strong> items', 'us'), 'id' => 'menu_sub_fontsize_mobile', 'std' => '15', 'class' => 'font', 'type' => 'text');
     $of_options[] = array('name' => __('Subset', 'us'), 'desc' => __('Select characters subset for Google fonts. <strong>Please note: some fonts does not support particular subsets!</strong>', 'us'), 'id' => 'font_subset', 'std' => 'latin', 'type' => 'select', 'options' => $google_fonts_subsets);
     $of_options[] = array('name' => __('Portfolio Options', 'us'), 'type' => 'heading', 'classname' => 'portfoliooptions');
     $of_options[] = array('name' => __('Sidebar at Portfolio Items', 'us'), 'desc' => __('Select sidebar position or disable sidebar for all Portfolio Item pages', 'us'), 'id' => 'portfolio_sidebar', 'std' => 'none', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Portfolio Comments', 'us'), 'desc' => __('Enable comments for Portfolio Item pages', 'us'), 'id' => 'portfolio_comments', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Navigation Within a Category', 'us'), 'desc' => __('Enable previous/next portfolio item navigation within a category', 'us'), 'id' => 'portfolio_prevnext_category', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Portfolio Slug', 'us'), 'desc' => '', 'id' => 'portfolio_slug', 'std' => 'portfolio', 'type' => 'text');
     $of_options[] = array('name' => 'Portfolio Slug Note', 'std' => sprintf(__('Please go to <a href="%s">Permalinks Settings</a> and hit "Save Changes" button once after each time you change <strong>Portfolio Slug</strong> field. This will regenerate permalinks so they will match new Portfolio slug.', 'us'), admin_url('options-permalink.php')), 'id' => 'portfolio_info', 'type' => 'info');
     $of_options[] = array('name' => __('Blog Options', 'us'), 'type' => 'heading', 'classname' => 'blogoptions');
     $of_options[] = array('name' => __('Post Pages', 'us'), 'id' => 'blog_options_post_pages', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => __('Sidebar Position', 'us'), 'desc' => __('Select sidebar position or disable sidebar for all post pages', 'us'), 'id' => 'post_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Post Preview Layout', 'us'), 'desc' => __('Select Featured Image Layout for all post pages. You can set it for a separate certain post when editing it.', 'us'), 'id' => 'post_preview_layout', 'std' => 'basic', 'type' => 'select', 'options' => array('basic' => __('Standard', 'us'), 'modern' => __('Modern', 'us'), 'none' => __('No Preview', 'us')));
     $of_options[] = array('name' => __('Post Elements', 'us'), 'id' => 'post_meta', 'type' => 'title');
     $of_options[] = array('name' => '', 'desc' => __('Date', 'us'), 'id' => 'post_meta_date', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Author', 'us'), 'id' => 'post_meta_author', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Categories', 'us'), 'id' => 'post_meta_categories', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Comments number', 'us'), 'id' => 'post_meta_comments', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Tags', 'us'), 'id' => 'post_meta_tags', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => __('Author Box', 'us'), 'desc' => __('Show box with information about post author', 'us'), 'id' => 'post_author_box', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Prev/Next Navigation', 'us'), 'desc' => __('Show links to previous/next posts', 'us'), 'id' => 'post_nav', 'std' => 0, 'type' => 'switch');
     $of_options[] = array('name' => __('Related Posts', 'us'), 'desc' => __('Show list of posts with same tags at every post page', 'us'), 'id' => 'post_related', 'std' => 1, 'folds' => 1, 'type' => 'switch');
     $of_options[] = array('name' => '', 'desc' => __('Select layout of related posts', 'us'), 'id' => 'post_related_layout', 'std' => 'compact', 'type' => 'select', 'fold' => 'post_related', 'options' => array('compact' => __('Compact (without preview)', 'us'), 'related' => __('Standard (3 columns with preview)', 'us')));
     $of_options[] = array('name' => __('Default Front Page', 'us'), 'id' => 'blog_options_front_page', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => __('Sidebar Position', 'us'), 'desc' => __('Select sidebar position or disable sidebar for Default Front page', 'us'), 'id' => 'blog_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Page Layout', 'us'), 'desc' => __('Select layout for Default Front page', 'us'), 'id' => 'blog_layout', 'std' => 'large', 'type' => 'select', 'options' => array('large' => __('Large Image', 'us'), 'smallcircle' => __('Small Image', 'us'), 'grid' => __('Regular Grid', 'us'), 'masonry' => __('Masonry Grid', 'us'), 'compact' => __('Compact', 'us')));
     $of_options[] = array('name' => __('Posts Content', 'us'), 'desc' => __('Select type of posts content which shows for Default Front page', 'us'), 'id' => 'blog_content_type', 'std' => 'excerpt', 'type' => 'select', 'options' => array('excerpt' => __('Excerpt', 'us'), 'content' => __('Full Content', 'us'), 'none' => __('None', 'us')));
     $of_options[] = array('name' => __('Pagination', 'us'), 'desc' => __('Select pagination type for Default Front page', 'us'), 'id' => 'blog_pagination', 'std' => 'regular', 'type' => 'select', 'options' => array('regular' => __('Regular Pagination', 'us'), 'ajax' => __('Ajax Pagination (Load More Button)', 'us')));
     $of_options[] = array('name' => __('Posts Elements', 'us'), 'id' => 'blog_meta', 'type' => 'title');
     $of_options[] = array('name' => '', 'desc' => __('Date', 'us'), 'id' => 'blog_meta_date', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Author', 'us'), 'id' => 'blog_meta_author', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Categories', 'us'), 'id' => 'blog_meta_categories', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Comments number', 'us'), 'id' => 'blog_meta_comments', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Tags', 'us'), 'id' => 'blog_meta_tags', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Read More button', 'us'), 'id' => 'blog_read_more', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => __('Archive Pages', 'us'), 'id' => 'blog_options_archive', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => __('Sidebar Position', 'us'), 'desc' => __('Select sidebar position or disable sidebar for Archive pages', 'us'), 'id' => 'archive_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Page Layout', 'us'), 'desc' => __('Select layout for Archive pages', 'us'), 'id' => 'archive_layout', 'std' => 'smallcircle', 'type' => 'select', 'options' => array('large' => __('Large Image', 'us'), 'smallcircle' => __('Small Image', 'us'), 'grid' => __('Regular Grid', 'us'), 'masonry' => __('Masonry Grid', 'us'), 'compact' => __('Compact', 'us')));
     $of_options[] = array('name' => __('Posts Content', 'us'), 'desc' => __('Select type of posts content which shows for Archive pages', 'us'), 'id' => 'archive_content_type', 'std' => 'excerpt', 'type' => 'select', 'options' => array('excerpt' => __('Excerpt', 'us'), 'content' => __('Full Content', 'us'), 'none' => __('None', 'us')));
     $of_options[] = array('name' => __('Pagination', 'us'), 'desc' => __('Select pagination type for Archive pages', 'us'), 'id' => 'archive_pagination', 'std' => 'regular', 'type' => 'select', 'options' => array('regular' => __('Regular Pagination', 'us'), 'ajax' => __('Ajax Pagination (Load More Button)', 'us')));
     $of_options[] = array('name' => __('Posts Elements', 'us'), 'id' => 'archive_meta', 'type' => 'title');
     $of_options[] = array('name' => '', 'desc' => __('Date', 'us'), 'id' => 'archive_meta_date', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Author', 'us'), 'id' => 'archive_meta_author', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Categories', 'us'), 'id' => 'archive_meta_categories', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Comments number', 'us'), 'id' => 'archive_meta_comments', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Tags', 'us'), 'id' => 'archive_meta_tags', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Read More button', 'us'), 'id' => 'archive_read_more', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => __('Search Results Page', 'us'), 'id' => 'blog_options_search_results', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => __('Sidebar Position', 'us'), 'desc' => __('Select sidebar position or disable sidebar for Search Results page', 'us'), 'id' => 'search_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
     $of_options[] = array('name' => __('Page Layout', 'us'), 'desc' => __('Select layout for Search Results page', 'us'), 'id' => 'search_layout', 'std' => 'compact', 'type' => 'select', 'options' => array('large' => __('Large Image', 'us'), 'smallcircle' => __('Small Image', 'us'), 'grid' => __('Regular Grid', 'us'), 'masonry' => __('Masonry Grid', 'us'), 'compact' => __('Compact', 'us')));
     $of_options[] = array('name' => __('Posts Content', 'us'), 'desc' => __('Select type of posts content which shows for Search Results page', 'us'), 'id' => 'search_content_type', 'std' => 'excerpt', 'type' => 'select', 'options' => array('excerpt' => __('Excerpt', 'us'), 'content' => __('Full Content', 'us'), 'none' => __('None', 'us')));
     $of_options[] = array('name' => __('Pagination', 'us'), 'desc' => __('Select pagination type for Search Results page', 'us'), 'id' => 'search_pagination', 'std' => 'regular', 'type' => 'select', 'options' => array('regular' => __('Regular Pagination', 'us'), 'ajax' => __('Ajax Pagination (Load More Button)', 'us')));
     $of_options[] = array('name' => __('Posts Elements', 'us'), 'id' => 'search_meta', 'type' => 'title');
     $of_options[] = array('name' => '', 'desc' => __('Date', 'us'), 'id' => 'search_meta_date', 'std' => 1, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Author', 'us'), 'id' => 'search_meta_author', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Categories', 'us'), 'id' => 'search_meta_categories', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Comments number', 'us'), 'id' => 'search_meta_comments', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Tags', 'us'), 'id' => 'search_meta_tags', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => '', 'desc' => __('Read More button', 'us'), 'id' => 'search_read_more', 'std' => 0, 'type' => 'checkbox');
     $of_options[] = array('name' => __('Excerpt', 'us'), 'id' => 'blog_options_excerpt', 'std' => 1, 'type' => 'subheading');
     $of_options[] = array('name' => __('Excerpt Length', 'us'), 'desc' => __('Input amount of words in the Excerpt. If you want to show full content of posts, leave this field blank.', 'us'), 'id' => 'excerpt_length', 'std' => '55', 'type' => 'text');
     if (class_exists('woocommerce')) {
         // WooCommerce Options
         $of_options[] = array('name' => __('WooCommerce', 'us'), 'type' => 'heading', 'classname' => 'woocommerce');
         $of_options[] = array('name' => __('Title Bar Content', 'us'), 'desc' => __('This option is applied to all Shop pages and Product pages', 'us'), 'id' => 'shop_titlebar_content', 'std' => 'hide', 'type' => 'select', 'options' => array('all' => __('Captions and Breadcrumbs', 'us'), 'caption' => __('Captions Only', 'us'), 'hide' => __('Hide Title Bar', 'us')));
         $of_options[] = array('name' => '', 'std' => __('<strong>Title Bar Content</strong> can be set for a separate certain product when editing it. If the option above has no effect for some product page, check its Title Bar Options.', 'us'), 'id' => 'shop_titlebar_info', 'type' => 'info');
         $of_options[] = array('name' => __('Shop Sidebar', 'us'), 'desc' => __('Select sidebar position or disable sidebar at Shop pages', 'us'), 'id' => 'shop_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
         $of_options[] = array('name' => __('Product Sidebar', 'us'), 'desc' => __('Select sidebar position or disable sidebar at Product pages', 'us'), 'id' => 'product_sidebar', 'std' => 'right', 'type' => 'select', 'options' => array('right' => __('Right', 'us'), 'left' => __('Left', 'us'), 'none' => __('No Sidebar', 'us')));
         $of_options[] = array('name' => __('Products Grid Columns', 'us'), 'desc' => __('Select products quantity per row at Shop pages', 'us'), 'id' => 'shop_columns', 'std' => '3', 'type' => 'select', 'options' => array('2' => __('2 columns', 'us'), '3' => __('3 columns', 'us'), '4' => __('4 columns', 'us'), '5' => __('5 columns', 'us')));
         $of_options[] = array('name' => __('Products Grid Style', 'us'), 'desc' => __('Select style of products grid at all pages', 'us'), 'id' => 'shop_listing_style', 'std' => '2', 'type' => 'select', 'options' => array('1' => __('Flat style', 'us'), '2' => __('Card style', 'us')));
         $of_options[] = array('name' => __('Related Products Quantity', 'us'), 'desc' => __('Select related products quantity at Product pages and Cart page', 'us'), 'id' => 'product_related_qty', 'std' => '3', 'type' => 'select', 'options' => array('2' => __('2 items', 'us'), '3' => __('3 items', 'us'), '4' => __('4 items', 'us'), '5' => __('5 items', 'us')));
     }
     // Theme Update Options
     $of_options[] = array('name' => __('Theme Update', 'us'), 'type' => 'heading', 'classname' => 'themeupdate');
     $of_options[] = array('name' => 'TF_Update', 'std' => __('Please enter your Themeforest username and Secret API Key below if you want to get update notifications for the theme.', 'us'), 'id' => 'themeforest_info', 'type' => 'info');
     $of_options[] = array('name' => __('ThemeForest User Name', 'us'), 'desc' => '', 'id' => 'themeforest_username', 'std' => '', 'type' => 'text');
     $of_options[] = array('name' => __('ThemeForest API Key', 'us'), 'desc' => sprintf(__('Copy API Key of your ThemeForest account here. Check this <a target="_blank" href="%s">screenshot</a> for more info', 'us'), $us_template_directory_uri . '/img/find-api.png'), 'id' => 'themeforest_api_key', 'std' => '', 'type' => 'text');
     // Manage Options
     $of_options[] = array('name' => __('Manage Options', 'us'), 'type' => 'heading', 'classname' => 'manageoptions');
     $of_options[] = array('name' => __('Backup and restore Theme Options', 'us'), 'id' => 'of_backup', 'std' => '', 'type' => 'backup', 'desc' => __('You can use the two buttons below to backup your current options, and then restore them back later. This is useful if you want to experiment with the options but would like to keep the old settings in case you need them back.', 'us'));
     $of_options[] = array('name' => __('Transfer Theme Options data', 'us'), 'id' => 'of_transfer', 'std' => '', 'type' => 'transfer', 'desc' => __('You can transfer the saved options data between different installations by copying the text inside the text box. To import data from another installation, replace the data in the text box with the one from another installation and click "Import Options".', 'us'));
     // Applying default values from the first style scheme
     if (is_array($style_schemes) and !empty($style_schemes)) {
         foreach ($style_schemes as &$style_scheme) {
             foreach ($of_options as &$option) {
                 if (isset($option['id']) and isset($style_scheme['values'][$option['id']])) {
                     $option['std'] = $style_scheme['values'][$option['id']];
                 }
             }
             break;
         }
     }
 }