function nimbus_field_engine()
{
    global $allowedtags, $NIMBUS_FONT_FACES, $NIMBUS_OPTIONS_ARR;
    $option_name = THEME_OPTIONS;
    $theme_options = get_option(THEME_OPTIONS);
    $options = $NIMBUS_OPTIONS_ARR;
    foreach ($options as $option) {
        $output = '';
        // Set option variables
        if (isset($option['classes'])) {
            $classes = $option['classes'];
        } else {
            $classes = '';
        }
        if (isset($option['label'])) {
            $label = $option['label'];
        }
        // Set field number variable
        if ($option['type'] == "tab") {
            unset($field_num);
            $field_num = 1;
        }
        // Open tab container
        if ($option['type'] == "tab") {
            echo "<div id='" . $option['url'] . "'>";
        }
        // Do stuff excluding tabs and html.
        if ($option['type'] != "tab" && $option['type'] != "html" && $option['type'] != "close_tab") {
            // Set value for default and override with saved option if set.
            $value = '';
            if (isset($option['default'])) {
                $value = $option['default'];
            }
            if (isset($theme_options[$option['id']])) {
                $value = $theme_options[$option['id']];
            }
            // Begin option, wrap all with basic title and wrappers.
            $output .= '<div id="' . $option['id'] . '_option_wrapper" class="option_wrapper">' . "\n";
            $output .= '<p class="option_name"><span class="option_number">' . $field_num . '</span>. ' . $option['name'] . '</p>' . "\n";
            // Include description if availible.
            if (isset($option['desc'])) {
                $output .= '<p class="option_description">' . $option['desc'] . '</p>' . "\n";
            }
        }
        // Construct text field.
        if ($option['type'] == "text") {
            $output .= '<input id="' . $option['id'] . '" class="' . $classes . ' text_field" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . esc_attr($value) . '" />' . "\n";
            $field_num++;
            // Construct textarea.
        } else {
            if ($option['type'] == "textarea") {
                $output .= '<textarea id="' . $option['id'] . '" class="' . $classes . ' textarea" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" >' . esc_textarea($value) . '</textarea>' . "\n";
                $field_num++;
                // Construct select.
            } else {
                if ($option['type'] == "select") {
                    $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" id="' . esc_attr($option['id']) . '">' . "\n";
                    foreach ($option['options'] as $key => $select) {
                        $output .= '<option ' . selected($value, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($select) . '</option>' . "\n";
                    }
                    $output .= '</select>' . "\n";
                    $field_num++;
                    // Construct Font Select.
                } else {
                    if ($option['type'] == "typography") {
                        // Font Face
                        $output .= '<div class="split_select_left">' . "\n";
                        $output .= '<p>Font Face: ( * Google Web Font )</p>' . "\n";
                        $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
                        $faces = $NIMBUS_FONT_FACES;
                        ksort($faces);
                        foreach ($faces as $key => $face) {
                            $output .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
                        }
                        $output .= '</select>' . "\n";
                        $output .= '</div>' . "\n";
                        // Font Size
                        $output .= '<div class="split_select_right">' . "\n";
                        $output .= '<p>Font Size</p>' . "\n";
                        $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][size]') . '" id="' . esc_attr($option['id'] . '_size') . '">' . "\n";
                        for ($i = 6; $i < 66; $i++) {
                            $font_size = $i . 'px';
                            $output .= '<option value="' . esc_attr($font_size) . '" ' . selected($value['size'], $font_size, false) . '>' . esc_html($font_size) . '</option>' . "\n";
                        }
                        $output .= '</select>' . "\n";
                        $output .= '</div><div class="clear10"></div>' . "\n";
                        // Line-Height
                        $output .= '<div class="split_select_left">' . "\n";
                        $output .= '<p>Line Height</p>' . "\n";
                        $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][line]') . '" id="' . esc_attr($option['id'] . '_line') . '">' . "\n";
                        $line_begin = 0.5;
                        $line_increment = 0.1;
                        for ($i = 0; $i < 16; $i++) {
                            $line_height = $line_begin + $line_increment * $i . 'em';
                            $output .= '<option value="' . esc_attr($line_height) . '" ' . selected($value['line'], $line_height, false) . '>' . esc_html($line_height) . '</option>' . "\n";
                        }
                        $output .= '</select>' . "\n";
                        $output .= '</div>' . "\n";
                        // Font Style
                        $output .= '<div class="split_select_right">' . "\n";
                        $output .= '<p>Font Style</p>' . "\n";
                        $styles = nimbus_font_styles();
                        $output .= '<select class="' . $classes . '" name="' . $option_name . '[' . $option['id'] . '][style]" id="' . $option['id'] . '_style">' . "\n";
                        foreach ($styles as $key => $style) {
                            $output .= '<option value="' . esc_attr($key) . '" ' . selected($value['style'], $key, false) . '>' . $style . '</option>' . "\n";
                        }
                        $output .= '</select>' . "\n";
                        $output .= '</div><div class="clear10"></div>' . "\n";
                        // Text Transform
                        $output .= '<div class="split_select_left">' . "\n";
                        $output .= '<p>Font Case</p>' . "\n";
                        $cases = nimbus_font_transform();
                        $output .= '<select class="' . $classes . '" name="' . $option_name . '[' . $option['id'] . '][fonttrans]" id="' . $option['id'] . '_case">' . "\n";
                        foreach ($cases as $key => $case) {
                            $output .= '<option value="' . esc_attr($key) . '" ' . selected($value['fonttrans'], $key, false) . '>' . $case . '</option>' . "\n";
                        }
                        $output .= '</select>' . "\n";
                        $output .= '</div>' . "\n";
                        // Font Color
                        $output .= '<div class="split_select_right_color">' . "\n";
                        $output .= '<p>Font Color</p>' . "\n";
                        $output .= '<input class="' . $classes . ' hex_field color-picker" name="' . esc_attr($option_name . '[' . $option['id'] . '][color]') . '" id="' . esc_attr($option['id'] . '_color') . '" type="text" value="' . esc_attr($value['color']) . '" />';
                        $output .= '</div><div class="clear10"></div>' . "\n";
                        $field_num++;
                        // Construct checkbox.
                    } else {
                        if ($option['type'] == "checkbox") {
                            $output .= '<input id="' . $option['id'] . '" class="' . $classes . '" type="checkbox" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" ' . checked($value, 1, false) . ' /><span class="checkbox_label">' . $label . '</span>';
                            $field_num++;
                            // Construct multiple checkboxes
                        } else {
                            if ($option['type'] == "multicheck") {
                                foreach ($option['options'] as $key => $multi) {
                                    $checked = '';
                                    $label = $multi;
                                    $multi = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
                                    $id = $option_name . '-' . $option['id'] . '-' . $multi;
                                    $name = $option_name . '[' . $option['id'] . '][' . $multi . ']';
                                    if (isset($value[$multi])) {
                                        $checked = checked($value[$multi], 1, false);
                                    }
                                    $output .= '<input id="' . esc_attr($id) . '" class="' . $classes . '" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label><br />';
                                }
                                $field_num++;
                                // Construct radio.
                            } else {
                                if ($option['type'] == "radio") {
                                    $name = $option_name . '[' . $option['id'] . ']';
                                    foreach ($option['options'] as $key => $radio) {
                                        $id = $option_name . '-' . $option['id'] . '-' . $key;
                                        $output .= '<input class="' . $classes . '" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($value, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($radio) . '</label><br />';
                                    }
                                    $field_num++;
                                    // Font Face/Color
                                } else {
                                    if ($option['type'] == "font") {
                                        // Font Face
                                        $output .= '<div class="split_select_left">' . "\n";
                                        $output .= '<p>Font Face</p>' . "\n";
                                        $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
                                        $faces = $NIMBUS_FONT_FACES;
                                        ksort($faces);
                                        foreach ($faces as $key => $face) {
                                            $output .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
                                        }
                                        $output .= '</select>' . "\n";
                                        $output .= '</div>' . "\n";
                                        // Font Color
                                        $output .= '<div class="split_select_right_color">' . "\n";
                                        $output .= '<p>Font Color</p>' . "\n";
                                        $output .= '<input class="' . $classes . '  hex_field color-picker" name="' . esc_attr($option_name . '[' . $option['id'] . '][color]') . '" id="' . esc_attr($option['id'] . '_color') . '" type="text" value="' . esc_attr($value['color']) . '" />';
                                        $output .= '</div><div class="clear10"></div>' . "\n";
                                        $field_num++;
                                        // Font Face Only
                                    } else {
                                        if ($option['type'] == "face") {
                                            // Font Face
                                            $output .= '<div class="split_select_left">' . "\n";
                                            $output .= '<p>Font Face</p>' . "\n";
                                            $output .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
                                            $faces = $NIMBUS_FONT_FACES;
                                            ksort($faces);
                                            foreach ($faces as $key => $face) {
                                                $output .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
                                            }
                                            $output .= '</select>' . "\n";
                                            $output .= '</div>' . "\n";
                                            $field_num++;
                                            // Construct color picker.
                                        } else {
                                            if ($option['type'] == "color") {
                                                $output .= '<input class="' . $classes . ' hex_field color-picker" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" id="' . esc_attr($option['id']) . '" type="text" value="' . esc_attr($value) . '" />';
                                                $field_num++;
                                                // Construct image.
                                            } else {
                                                if ($option['type'] == "image") {
                                                    $output .= '<input id="' . $option['id'] . '" class="upload_image_text" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . $value . '" /><input class="upload_image_button" type="button" value="Upload" />' . "\n";
                                                    $field_num++;
                                                    // pro account
                                                } else {
                                                    if ($option['type'] == "pro") {
                                                        $output .= '<p>This feature is available to premium theme users.</p><div class="clear5"></div><a class="nimbus_button_sm_pink" href="' . SALESPAGEURL . '?utm_source=' . THEME_NAME_CLEAN . '&utm_medium=theme&utm_content=panel_link&utm_campaign=' . THEME_NAME_CLEAN . '">Upgrade today!!</a></p>';
                                                        $field_num++;
                                                        // wp_editor
                                                    } else {
                                                        if ($option['type'] == "editor") {
                                                            echo $output;
                                                            $textarea_name = esc_attr($option_name . '[' . $option['id'] . ']');
                                                            $settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
                                                            wp_editor($value, $option['id'], $settings);
                                                            $output = '';
                                                            $field_num++;
                                                            // Sortable.
                                                        } else {
                                                            if ($option['type'] == "sortable") {
                                                                $value_array = explode(',', $value);
                                                                $output .= '

           <script>

           jQuery(function() {

               jQuery( "#' . $option['id'] . '-sortable-field" ).sortable({

                   placeholder: "ui-state-highlight",

                   cursor: "crosshair",

                   create: function(event, ui) {

                       var order = jQuery("#' . $option['id'] . '-sortable-field").sortable("toArray");

                       jQuery("#' . $option['id'] . '").val(order.join(","));

                   },

                   update: function(event, ui) {

                       var order = jQuery("#' . $option['id'] . '-sortable-field").sortable("toArray");

                       jQuery("#' . $option['id'] . '").val(order.join(","));

                   }



               });

               jQuery( "#' . $option['id'] . '-sortable-field" ).disableSelection();

           });

           </script>

           ' . "\n";
                                                                $output .= '<input type="hidden" id="' . $option['id'] . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" value="" /><ul class="sortable_wrap" id="' . $option['id'] . '-sortable-field">' . "\n";
                                                                foreach ($value_array as $unique_value) {
                                                                    $output .= '<li class="sortable_child" " id="' . esc_attr($unique_value) . '" class="ui-state-default">' . $option['options'][$unique_value] . '</li>' . "\n";
                                                                }
                                                                $output .= '</ul>' . "\n";
                                                                $field_num++;
                                                                // item_html
                                                            } else {
                                                                if ($option['type'] == "item_html") {
                                                                    $output .= $option['html'];
                                                                    $field_num++;
                                                                    // Construct html.
                                                                } else {
                                                                    if ($option['type'] == "html") {
                                                                        $output .= $option['html'];
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        // Close field wrap html.
        if ($option['type'] != "tab" && $option['type'] != "html" && $option['type'] != "close_tab") {
            $output .= '<div class="clear"></div></div>';
        }
        if ($option['type'] == "close_tab") {
            echo "</div>";
        }
        echo $output;
    }
}
Example #2
0
function nimbus_field_engine()
{
    global $allowedtags, $NIMBUS_FONT_FACES, $NIMBUS_OPTIONS_ARR;
    $option_name = THEME_OPTIONS;
    $theme_options = get_option(THEME_OPTIONS);
    $options = $NIMBUS_OPTIONS_ARR;
    $section_return = array();
    foreach ($options as $option) {
        $section_return[$option['tab']] = '';
    }
    foreach ($options as $option) {
        // Set option variables
        if (isset($option['classes'])) {
            $classes = $option['classes'];
        }
        if (isset($option['label'])) {
            $label = $option['label'];
        }
        // Set field number variable
        if ($option['type'] == "tab") {
            unset($field_num);
            $field_num = 1;
        }
        // Do stuff excluding tabs and html.
        if ($option['type'] != "tab" && $option['type'] != "html") {
            // Set value for default and override with saved option if set.
            $value = '';
            if (isset($option['default'])) {
                $value = $option['default'];
            }
            if (isset($theme_options[$option['id']])) {
                $value = $theme_options[$option['id']];
            }
            // Begin option, wrap all with basic title and wrappers.
            $section_return[$option['tab']] .= '<div id="' . $option['id'] . '_option_wrapper" class="option_wrapper">' . "\n";
            $section_return[$option['tab']] .= '<div class="option_info_column">' . "\n";
            $section_return[$option['tab']] .= '<div class="option_number">' . $field_num . '</div>' . "\n";
            /*
            if (isset($option['info'])) {
                $section_return[$option['tab']] .= '<a class="info_box_button" href="#' . $option['id'] . '_info"><img src="' . get_template_directory_uri() . '/nimbus/images/info_button.png" alt="Info Window" /></a>' . "\n";
            }
            if (isset($option['video'])) {
                $section_return[$option['tab']] .= '<img src="' . get_template_directory_uri() . '/nimbus/images/vid_button.png" alt="Video Window" />' . "\n";
            }
            */
            $section_return[$option['tab']] .= '</div>' . "\n";
            $section_return[$option['tab']] .= '<div id="' . $option['id'] . '_option_right" class="option_right">' . "\n";
            $section_return[$option['tab']] .= '<p class="option_name">' . $option['name'] . '</p>' . "\n";
            // Include descrtiption if availible.
            if (isset($option['desc'])) {
                $section_return[$option['tab']] .= '<p class="option_description">' . $option['desc'] . '</p>' . "\n";
            }
        }
        // Construct text field.
        if ($option['type'] == "text") {
            $section_return[$option['tab']] .= '<input id="' . $option['id'] . '" class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . esc_attr($value) . '" />' . "\n";
            $field_num++;
            // Construct textarea.
        } elseif ($option['type'] == "textarea") {
            $section_return[$option['tab']] .= '<textarea id="' . $option['id'] . '" class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" >' . esc_textarea($value) . '</textarea>' . "\n";
            $field_num++;
            // Construct select.
        } elseif ($option['type'] == "select") {
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" id="' . esc_attr($option['id']) . '">' . "\n";
            foreach ($option['options'] as $key => $select) {
                $section_return[$option['tab']] .= '<option ' . selected($value, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($select) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $field_num++;
            // Construct Font Select.
        } elseif ($option['type'] == "typography") {
            // Font Face
            $section_return[$option['tab']] .= '<div class="split_select_left">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Face: ( * Google Web Font )</p>' . "\n";
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
            $faces = $NIMBUS_FONT_FACES;
            ksort($faces);
            foreach ($faces as $key => $face) {
                $section_return[$option['tab']] .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div>' . "\n";
            // Font Size
            $section_return[$option['tab']] .= '<div class="split_select_right">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Size</p>' . "\n";
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][size]') . '" id="' . esc_attr($option['id'] . '_size') . '">' . "\n";
            for ($i = 6; $i < 66; $i++) {
                $font_size = $i . 'px';
                $section_return[$option['tab']] .= '<option value="' . esc_attr($font_size) . '" ' . selected($value['size'], $font_size, false) . '>' . esc_html($font_size) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div><div class="clear10"></div>' . "\n";
            // Line-Height
            $section_return[$option['tab']] .= '<div class="split_select_left">' . "\n";
            $section_return[$option['tab']] .= '<p>Line Height</p>' . "\n";
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][line]') . '" id="' . esc_attr($option['id'] . '_line') . '">' . "\n";
            $line_begin = 0.5;
            $line_increment = 0.1;
            for ($i = 0; $i < 16; $i++) {
                $line_height = $line_begin + $line_increment * $i . 'em';
                $section_return[$option['tab']] .= '<option value="' . esc_attr($line_height) . '" ' . selected($value['line'], $line_height, false) . '>' . esc_html($line_height) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div>' . "\n";
            // Font Style
            $section_return[$option['tab']] .= '<div class="split_select_right">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Style</p>' . "\n";
            $styles = nimbus_font_styles();
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . $option_name . '[' . $option['id'] . '][style]" id="' . $option['id'] . '_style">' . "\n";
            foreach ($styles as $key => $style) {
                $section_return[$option['tab']] .= '<option value="' . esc_attr($key) . '" ' . selected($value['style'], $key, false) . '>' . $style . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div><div class="clear10"></div>' . "\n";
            // Text Transform
            $section_return[$option['tab']] .= '<div class="split_select_left">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Case</p>' . "\n";
            $cases = nimbus_font_transform();
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . $option_name . '[' . $option['id'] . '][fonttrans]" id="' . $option['id'] . '_case">' . "\n";
            foreach ($cases as $key => $case) {
                $section_return[$option['tab']] .= '<option value="' . esc_attr($key) . '" ' . selected($value['fonttrans'], $key, false) . '>' . $case . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div>' . "\n";
            // Font Color
            $section_return[$option['tab']] .= '<div class="split_select_right_color">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Color</p>' . "\n";
            $section_return[$option['tab']] .= '<div id="' . esc_attr($option['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $value['color']) . '"></div></div>';
            $section_return[$option['tab']] .= '<input class="' . $classes . ' hex_field" name="' . esc_attr($option_name . '[' . $option['id'] . '][color]') . '" id="' . esc_attr($option['id'] . '_color') . '" type="text" value="' . esc_attr($value['color']) . '" />';
            $section_return[$option['tab']] .= '</div><div class="clear10"></div>' . "\n";
            $field_num++;
            // Construct checkbox.
        } elseif ($option['type'] == "checkbox") {
            $section_return[$option['tab']] .= '<input id="' . $option['id'] . '" class="' . $classes . '" type="checkbox" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" ' . checked($value, 1, false) . ' /><span class="checkbox_label">' . $label . '</span>';
            $field_num++;
            // Construct multiple checkboxes
        } elseif ($option['type'] == "multicheck") {
            foreach ($option['options'] as $key => $multi) {
                $checked = '';
                $label = $multi;
                $multi = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
                $id = $option_name . '-' . $option['id'] . '-' . $multi;
                $name = $option_name . '[' . $option['id'] . '][' . $multi . ']';
                if (isset($value[$multi])) {
                    $checked = checked($value[$multi], 1, false);
                }
                $section_return[$option['tab']] .= '<input id="' . esc_attr($id) . '" class="' . $classes . '" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label><br />';
            }
            $field_num++;
            // Construct radio.
        } elseif ($option['type'] == "radio") {
            $name = $option_name . '[' . $option['id'] . ']';
            foreach ($option['options'] as $key => $radio) {
                $id = $option_name . '-' . $option['id'] . '-' . $key;
                $section_return[$option['tab']] .= '<input class="' . $classes . '" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($value, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($radio) . '</label><br />';
            }
            $field_num++;
            // Font Face/Color
        } elseif ($option['type'] == "font") {
            // Font Face
            $section_return[$option['tab']] .= '<div class="split_select_left">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Face</p>' . "\n";
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
            $faces = $NIMBUS_FONT_FACES;
            ksort($faces);
            foreach ($faces as $key => $face) {
                $section_return[$option['tab']] .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div>' . "\n";
            // Font Color
            $section_return[$option['tab']] .= '<div class="split_select_right_color">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Color</p>' . "\n";
            $section_return[$option['tab']] .= '<div id="' . esc_attr($option['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $value['color']) . '"></div></div>';
            $section_return[$option['tab']] .= '<input class="' . $classes . '  hex_field" name="' . esc_attr($option_name . '[' . $option['id'] . '][color]') . '" id="' . esc_attr($option['id'] . '_color') . '" type="text" value="' . esc_attr($value['color']) . '" />';
            $section_return[$option['tab']] .= '</div><div class="clear10"></div>' . "\n";
            $field_num++;
            // Font Face Only
        } elseif ($option['type'] == "face") {
            // Font Face
            $section_return[$option['tab']] .= '<div class="split_select_left">' . "\n";
            $section_return[$option['tab']] .= '<p>Font Face</p>' . "\n";
            $section_return[$option['tab']] .= '<select class="' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][face]') . '" id="' . esc_attr($option['id'] . '_face') . '">' . "\n";
            $faces = $NIMBUS_FONT_FACES;
            ksort($faces);
            foreach ($faces as $key => $face) {
                $section_return[$option['tab']] .= '<option value="' . esc_attr($key) . '" ' . selected($value['face'], $key, false) . '>' . esc_html($face['name']) . '</option>' . "\n";
            }
            $section_return[$option['tab']] .= '</select>' . "\n";
            $section_return[$option['tab']] .= '</div>' . "\n";
            $field_num++;
            // Construct color picker.
        } elseif ($option['type'] == "color") {
            $section_return[$option['tab']] .= '<div id="' . esc_attr($option['id'] . '_picker') . '" class="colorSelector"><div style="' . esc_attr('background-color:' . $value) . '"></div></div>';
            $section_return[$option['tab']] .= '<input class="' . $classes . ' hex_field" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" id="' . esc_attr($option['id']) . '" type="text" value="' . esc_attr($value) . '" />';
            $field_num++;
            // Construct image.
        } elseif ($option['type'] == "image") {
            $section_return[$option['tab']] .= '<input id="' . $option['id'] . '" class="upload_image ' . $classes . '" name="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . esc_attr($value) . '" />';
            $section_return[$option['tab']] .= '<input type="button" name="upload_image_button" class="upload_image_button nimbus_button_blue" value="Browse" />';
            //$section_return[$option['tab']] .= '<img src="' . $value . '" />';
            $field_num++;
            // pro account
        } elseif ($option['type'] == "pro") {
            $section_return[$option['tab']] .= '<p><span style="color:#fc7e2a;">This feature is available to Nimbus Themes members.</span> <a href="' . SALESPAGEURL . '?utm_source=cirrus&utm_medium=theme&utm_content=panel_link&utm_campaign=cirrus"  target="_blank">Join today!!</a></p>';
            $field_num++;
            // item_html
        } elseif ($option['type'] == "item_html") {
            $section_return[$option['tab']] .= $option['html'];
            $field_num++;
            // Construct tabs.
        } elseif ($option['type'] == "tab") {
            $section_return[$option['tab']] .= '<li><a href="#' . $option['url'] . '" id="' . $option['id'] . '" class="' . $classes . '">' . $option['name'] . '</a></li>';
            // Construct html.
        } elseif ($option['type'] == "html") {
            $section_return[$option['tab']] .= $option['html'];
        }
        // Close field wrap html.
        if ($option['type'] != "tab" && $option['type'] != "html") {
            $section_return[$option['tab']] .= '<div class="clear30"></div></div><div class="clear20"></div></div>';
        }
        /*
        if (isset($option['info'])) {
            $section_return[$option['tab']] .= '<div style="display: none;">';
            $section_return[$option['tab']] .= '<div id="' . $option['id'] . '_info" class="info_box">';
            $section_return[$option['tab']] .= '<h2>' . $option['name'] . '</h2>';
            $section_return[$option['tab']] .= $option['info'];
            $section_return[$option['tab']] .= '</div>';
            $section_return[$option['tab']] .= '</div>';
        }
        */
    }
    return $section_return;
}