コード例 #1
0
ファイル: admin-interface.php プロジェクト: ggxyjs/yanjiusuo
function inkthemes_optionsframework_machine($options)
{
    $counter = 0;
    $menu = '';
    $output = '';
    foreach ($options['of_template'] as $value) {
        $counter++;
        $val = '';
        //Start Heading
        if ($value['type'] != "heading") {
            $class = '';
            if (isset($value['class'])) {
                $class = $value['class'];
            }
            //$output .= '<div class="section section-'. $value['type'] .'">'."\n".'<div class="option-inner">'."\n";
            $output .= '<div class="section section-' . $value['type'] . ' ' . $class . '">' . "\n";
            $output .= '<h3 class="heading">' . $value['name'] . '</h3>' . "\n";
            $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
        }
        //End Heading
        $select_value = '';
        switch ($value['type']) {
            case 'pro':
                $output .= '<a class="pro_link" href="http://www.inkthemes.com/wp-themes/colorway-wp-theme/" target="_blank"><div class="pro_feature_div">' . $value['msg'] . '  <span class="button-primary">Get Premium</span></div></a>';
                break;
            case 'text':
                $val = $value['std'];
                $std = inkthemes_get_option($value['id']);
                if ($std != "") {
                    $val = $std;
                }
                $output .= '<input class="of-input" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '" type="' . $value['type'] . '" value="' . esc_attr($val) . '" />';
                break;
            case 'select':
                $output .= '<select class="of-input" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '">';
                $select_value = get_option($value['id']);
                foreach ($value['options'] as $option) {
                    $selected = '';
                    if ($select_value != '') {
                        if ($select_value == $option) {
                            $selected = ' selected="selected"';
                        }
                    } else {
                        if (isset($value['std'])) {
                            if ($value['std'] == $option) {
                                $selected = ' selected="selected"';
                            }
                        }
                    }
                    $output .= '<option' . $selected . '>';
                    $output .= $option;
                    $output .= '</option>';
                }
                $output .= '</select>';
                break;
            case 'textarea':
                $cols = '8';
                $ta_value = '';
                if (isset($value['std'])) {
                    $ta_value = $value['std'];
                    if (isset($value['options'])) {
                        $ta_options = $value['options'];
                        if (isset($ta_options['cols'])) {
                            $cols = $ta_options['cols'];
                        } else {
                            $cols = '8';
                        }
                    }
                }
                $std = inkthemes_get_option($value['id']);
                if ($std != "") {
                    $ta_value = stripslashes($std);
                }
                $output .= '<textarea class="of-input" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '" cols="' . esc_attr($cols) . '" rows="8">' . esc_textarea($ta_value) . '</textarea>';
                break;
            case "radio":
                $select_value = inkthemes_get_option($value['id']);
                foreach ($value['options'] as $key => $option) {
                    $checked = '';
                    if ($select_value != '') {
                        if ($select_value == $key) {
                            $checked = ' checked';
                        }
                    } else {
                        if ($value['std'] == $key) {
                            $checked = ' checked';
                        }
                    }
                    $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr($value['id']) . '" value="' . esc_attr($key) . '" ' . $checked . ' />' . $option . '<br />';
                }
                break;
            case "checkbox":
                $output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />';
                $output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
                break;
            case "multicheck":
                foreach ($value['options'] as $key => $option) {
                    $checked = '';
                    $label = $option;
                    $option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
                    $id = $option_name . '-' . $value['id'] . '-' . $option;
                    $name = $option_name . '[' . $value['id'] . '][' . $option . ']';
                    if (isset($val[$option])) {
                        $checked = checked($val[$option], 1, false);
                    }
                    $output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
                }
                break;
            case "upload":
                $value['std'] = '';
                if (isset($value['std'])) {
                    $output .= inkthemes_optionsframework_uploader_function(esc_attr($value['id']), $value['std'], null);
                }
                break;
            case "upload_min":
                $output .= inkthemes_optionsframework_uploader_function(esc_attr($value['id']), $value['std'], 'min');
                break;
            case "color":
                $val = $value['std'];
                $stored = inkthemes_get_option($value['id']);
                if ($stored != "") {
                    $val = $stored;
                }
                $output .= '<div id="' . esc_attr($value['id']) . '_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '" type="text" value="' . esc_attr($val) . '" />';
                break;
            case "typography":
                $default = $value['std'];
                $typography_stored = inkthemes_get_option($value['id']);
                /* Font Size */
                $val = $default['size'];
                if ($typography_stored['size'] != "") {
                    $val = $typography_stored['size'];
                }
                $output .= '<select class="of-typography of-typography-size" name="' . esc_attr($value['id']) . '_size" id="' . esc_attr($value['id']) . '_size">';
                for ($i = 9; $i < 71; $i++) {
                    if ($val == $i) {
                        $active = 'selected="selected"';
                    } else {
                        $active = '';
                    }
                    $output .= '<option value="' . $i . '" ' . $active . '>' . $i . 'px</option>';
                }
                $output .= '</select>';
                /* Font Face */
                $val = $default['face'];
                if ($typography_stored['face'] != "") {
                    $val = $typography_stored['face'];
                }
                $font01 = '';
                $font02 = '';
                $font03 = '';
                $font04 = '';
                $font05 = '';
                $font06 = '';
                $font07 = '';
                $font08 = '';
                $font09 = '';
                if (strpos($val, 'Arial, sans-serif') !== false) {
                    $font01 = 'selected="selected"';
                }
                if (strpos($val, 'Verdana, Geneva') !== false) {
                    $font02 = 'selected="selected"';
                }
                if (strpos($val, 'Trebuchet') !== false) {
                    $font03 = 'selected="selected"';
                }
                if (strpos($val, 'Georgia') !== false) {
                    $font04 = 'selected="selected"';
                }
                if (strpos($val, 'Times New Roman') !== false) {
                    $font05 = 'selected="selected"';
                }
                if (strpos($val, 'Tahoma, Geneva') !== false) {
                    $font06 = 'selected="selected"';
                }
                if (strpos($val, 'Palatino') !== false) {
                    $font07 = 'selected="selected"';
                }
                if (strpos($val, 'Helvetica') !== false) {
                    $font08 = 'selected="selected"';
                }
                $output .= '<select class="of-typography of-typography-face" name="' . $value['id'] . '_face" id="' . $value['id'] . '_face">';
                $output .= '<option value="Arial, sans-serif" ' . $font01 . '>' . __('Arial', 'colorway') . '</option>';
                $output .= '<option value="Verdana, Geneva, sans-serif" ' . $font02 . '>' . __('Verdana', 'colorway') . '</option>';
                $output .= '<option value="&quot;Trebuchet MS&quot;, Tahoma, sans-serif"' . $font03 . '>' . __('Trebuchet', 'colorway') . '</option>';
                $output .= '<option value="Georgia, serif" ' . $font04 . '>' . __('Georgia', 'colorway') . '</option>';
                $output .= '<option value="&quot;Times New Roman&quot;, serif"' . $font05 . '>' . __('Times New Roman', 'colorway') . '</option>';
                $output .= '<option value="Tahoma, Geneva, Verdana, sans-serif"' . $font06 . '>' . __('Tahoma', 'colorway') . '</option>';
                $output .= '<option value="Palatino, &quot;Palatino Linotype&quot;, serif"' . $font07 . '>' . __('Palatino', 'colorway') . '</option>';
                $output .= '<option value="&quot;Helvetica Neue&quot;, Helvetica, sans-serif" ' . $font08 . '>' . __('Helvetica*', 'colorway') . '</option>';
                $output .= '</select>';
                /* Font Weight */
                $val = $default['style'];
                if ($typography_stored['style'] != "") {
                    $val = $typography_stored['style'];
                }
                $normal = '';
                $italic = '';
                $bold = '';
                $bolditalic = '';
                if ($val == 'normal') {
                    $normal = 'selected="selected"';
                }
                if ($val == 'italic') {
                    $italic = 'selected="selected"';
                }
                if ($val == 'bold') {
                    $bold = 'selected="selected"';
                }
                if ($val == 'bold italic') {
                    $bolditalic = 'selected="selected"';
                }
                $output .= '<select class="of-typography of-typography-style" name="' . esc_attr($value['id']) . '_style" id="' . esc_attr($value['id']) . '_style">';
                $output .= '<option value="normal" ' . $normal . '>' . __('Normal', 'colorway') . '</option>';
                $output .= '<option value="italic" ' . $italic . '>' . __('Italic', 'colorway') . '</option>';
                $output .= '<option value="bold" ' . $bold . '>' . __('Bold', 'colorway') . '</option>';
                $output .= '<option value="bold italic" ' . $bolditalic . '>' . __('Bold/Italic', 'colorway') . '</option>';
                $output .= '</select>';
                /* Font Color */
                $val = $default['color'];
                if ($typography_stored['color'] != "") {
                    $val = $typography_stored['color'];
                }
                $output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($value['id']) . '_color" id="' . esc_attr($value['id']) . '_color" type="text" value="' . esc_attr($val) . '" />';
                break;
            case "border":
                $default = esc_attr($value['std']);
                $border_stored = inkthemes_get_option($value['id']);
                /* Border Width */
                $val = $default['width'];
                if ($border_stored['width'] != "") {
                    $val = $border_stored['width'];
                }
                $output .= '<select class="of-border of-border-width" name="' . esc_attr($value['id']) . '_width" id="' . esc_attr($value['id']) . '_width">';
                for ($i = 0; $i < 21; $i++) {
                    if ($val == $i) {
                        $active = 'selected="selected"';
                    } else {
                        $active = '';
                    }
                    $output .= '<option value="' . esc_attr($i) . '" ' . $active . '>' . esc_attr($i) . 'px</option>';
                }
                $output .= '</select>';
                /* Border Style */
                $val = $default['style'];
                if ($border_stored['style'] != "") {
                    $val = $border_stored['style'];
                }
                $solid = '';
                $dashed = '';
                $dotted = '';
                if ($val == 'solid') {
                    $solid = 'selected="selected"';
                }
                if ($val == 'dashed') {
                    $dashed = 'selected="selected"';
                }
                if ($val == 'dotted') {
                    $dotted = 'selected="selected"';
                }
                $output .= '<select class="of-border of-border-style" name="' . esc_attr($value['id']) . '_style" id="' . esc_attr($value['id']) . '_style">';
                $output .= '<option value="solid" ' . $solid . '>' . __('Solid', 'colorway') . '</option>';
                $output .= '<option value="dashed" ' . $dashed . '>' . __('Dashed', 'colorway') . '</option>';
                $output .= '<option value="dotted" ' . $dotted . '>' . __('Dotted', 'colorway') . '</option>';
                $output .= '</select>';
                /* Border Color */
                $val = $default['color'];
                if ($border_stored['color'] != "") {
                    $val = $border_stored['color'];
                }
                $output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color of-border of-border-color" name="' . esc_attr($value['id']) . '_color" id="' . esc_attr($value['id']) . '_color" type="text" value="' . esc_attr($val) . '" />';
                break;
            case "images":
                $name = $option_name . '[' . esc_attr($value['id']) . ']';
                foreach ($value['options'] as $key => $option) {
                    $selected = '';
                    $checked = '';
                    if ($val != '') {
                        if ($val == $key) {
                            $selected = ' of-radio-img-selected';
                        }
                        checked($options['$key'], $val);
                    }
                    $output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . $checked . ' />';
                    $output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>';
                    $output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />';
                }
                break;
            case "info":
                $default = $value['std'];
                $output .= $default;
                break;
            case "heading":
                if ($counter >= 2) {
                    $output .= '</div>' . "\n";
                }
                $jquery_click_hook = preg_replace("/[^a-zA-Z0-9._\\-]/", "", strtolower($value['name']));
                $jquery_click_hook = "of-option-" . esc_attr($jquery_click_hook);
                $menu .= '<li><a title="' . esc_attr($value['name']) . '" href="#' . esc_attr($jquery_click_hook) . '">' . esc_html($value['name']) . '</a></li>';
                $output .= '<div class="group" id="' . esc_attr($jquery_click_hook) . '"><h2>' . esc_html($value['name']) . '</h2>' . "\n";
                break;
        }
        // if TYPE is an array, formatted into smaller inputs... ie smaller values
        if (is_array($value['type'])) {
            foreach ($value['type'] as $array) {
                $id = $array['id'];
                $std = $array['std'];
                $saved_std = inkthemes_get_option($id);
                if ($saved_std != $std) {
                    $std = $saved_std;
                }
                $meta = $array['meta'];
                if ($array['type'] == 'text') {
                    // Only text at this point
                    $output .= '<input class="input-text-small of-input" name="' . esc_attr($id) . '" id="' . esc_attr($id) . '" type="text" value="' . $std . '" />';
                    $output .= '<span class="meta-two">' . $meta . '</span>';
                }
            }
        }
        if ($value['type'] != "heading") {
            if ($value['type'] != "checkbox") {
                $output .= '<br/>';
            }
            if (!isset($value['desc'])) {
                $explain_value = '';
            } else {
                $explain_value = $value['desc'];
            }
            $output .= '</div><div class="explain">' . $explain_value . '</div>' . "\n";
            $output .= '<div class="clear"> </div></div></div>' . "\n";
        }
    }
    $output .= '</div>';
    return array($output, $menu);
}
コード例 #2
0
function inkthemes_optionsframework_machine($options)
{
    $counter = 0;
    $menu = '';
    $output = '';
    foreach ($options as $value) {
        $counter++;
        $val = '';
        //Start Heading
        if ($value['type'] != "heading") {
            $class = '';
            if (isset($value['class'])) {
                $class = $value['class'];
            }
            //$output .= '<div class="section section-'. $value['type'] .'">'."\n".'<div class="option-inner">'."\n";
            $output .= '<div class="section section-' . $value['type'] . ' ' . $class . '">' . "\n";
            $output .= '<h3 class="heading">' . $value['name'] . '</h3>' . "\n";
            $output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
        }
        //End Heading
        $select_value = '';
        switch ($value['type']) {
            case 'text':
                $val = $value['std'];
                $std = get_option($value['id']);
                if ($std != "") {
                    $val = $std;
                }
                $output .= '<input class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" type="' . $value['type'] . '" value="' . $val . '" />';
                break;
            case 'select':
                $output .= '<select class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
                $select_value = get_option($value['id']);
                foreach ($value['options'] as $option) {
                    $selected = '';
                    if ($select_value != '') {
                        if ($select_value == $option) {
                            $selected = ' selected="selected"';
                        }
                    } else {
                        if (isset($value['std'])) {
                            if ($value['std'] == $option) {
                                $selected = ' selected="selected"';
                            }
                        }
                    }
                    $output .= '<option' . $selected . '>';
                    $output .= $option;
                    $output .= '</option>';
                }
                $output .= '</select>';
                break;
            case 'select2':
                $output .= '<select class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '">';
                $select_value = get_option($value['id']);
                foreach ($value['options'] as $option => $name) {
                    $selected = '';
                    if ($select_value != '') {
                        if ($select_value == $option) {
                            $selected = ' selected="selected"';
                        }
                    } else {
                        if (isset($value['std'])) {
                            if ($value['std'] == $option) {
                                $selected = ' selected="selected"';
                            }
                        }
                    }
                    $output .= '<option' . $selected . ' value="' . $option . '">';
                    $output .= $name;
                    $output .= '</option>';
                }
                $output .= '</select>';
                break;
            case 'textarea':
                $cols = '8';
                $ta_value = '';
                if (isset($value['std'])) {
                    $ta_value = $value['std'];
                    if (isset($value['options'])) {
                        $ta_options = $value['options'];
                        if (isset($ta_options['cols'])) {
                            $cols = $ta_options['cols'];
                        } else {
                            $cols = '8';
                        }
                    }
                }
                $std = get_option($value['id']);
                if ($std != "") {
                    $ta_value = stripslashes($std);
                }
                $output .= '<textarea class="of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" cols="' . $cols . '" rows="8">' . $ta_value . '</textarea>';
                break;
            case "radio":
                $select_value = get_option($value['id']);
                foreach ($value['options'] as $key => $option) {
                    $checked = '';
                    if ($select_value != '') {
                        if ($select_value == $key) {
                            $checked = ' checked';
                        }
                    } else {
                        if ($value['std'] == $key) {
                            $checked = ' checked';
                        }
                    }
                    $output .= '<input class="of-input of-radio" type="radio" name="' . $value['id'] . '" value="' . $key . '" ' . $checked . ' />' . $option . '<br />';
                }
                break;
            case "checkbox":
                $std = $value['std'];
                $saved_std = get_option($value['id']);
                $checked = '';
                if (!empty($saved_std)) {
                    if ($saved_std == 'true') {
                        $checked = 'checked="checked"';
                    } else {
                        $checked = '';
                    }
                } elseif ($std == 'true') {
                    $checked = 'checked="checked"';
                } else {
                    $checked = '';
                }
                $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="true" ' . $checked . ' />';
                break;
            case "multicheck":
                $std = $value['std'];
                foreach ($value['options'] as $key => $option) {
                    $of_key = $value['id'] . '_' . $key;
                    $saved_std = get_option($of_key);
                    if (!empty($saved_std)) {
                        if ($saved_std == 'true') {
                            $checked = 'checked="checked"';
                        } else {
                            $checked = '';
                        }
                    } elseif ($std == $key) {
                        $checked = 'checked="checked"';
                    } else {
                        $checked = '';
                    }
                    $output .= '<input type="checkbox" class="checkbox of-input" name="' . $of_key . '" id="' . $of_key . '" value="true" ' . $checked . ' /><label for="' . $of_key . '">' . $option . '</label><br />';
                }
                break;
            case "upload":
                $value['std'] = '';
                if (isset($value['std'])) {
                    $output .= inkthemes_optionsframework_uploader_function($value['id'], $value['std'], null);
                }
                break;
            case "upload_min":
                $output .= inkthemes_optionsframework_uploader_function($value['id'], $value['std'], 'min');
                break;
            case "color":
                $val = $value['std'];
                $stored = get_option($value['id']);
                if ($stored != "") {
                    $val = $stored;
                }
                $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $val . '" />';
                break;
            case "typography":
                $default = $value['std'];
                $typography_stored = get_option($value['id']);
                /* Font Size */
                $val = $default['size'];
                if ($typography_stored['size'] != "") {
                    $val = $typography_stored['size'];
                }
                $output .= '<select class="of-typography of-typography-size" name="' . $value['id'] . '_size" id="' . $value['id'] . '_size">';
                for ($i = 9; $i < 71; $i++) {
                    if ($val == $i) {
                        $active = 'selected="selected"';
                    } else {
                        $active = '';
                    }
                    $output .= '<option value="' . $i . '" ' . $active . '>' . $i . 'px</option>';
                }
                $output .= '</select>';
                /* Font Face */
                $val = $default['face'];
                if ($typography_stored['face'] != "") {
                    $val = $typography_stored['face'];
                }
                $font01 = '';
                $font02 = '';
                $font03 = '';
                $font04 = '';
                $font05 = '';
                $font06 = '';
                $font07 = '';
                $font08 = '';
                $font09 = '';
                if (strpos($val, 'Arial, sans-serif') !== false) {
                    $font01 = 'selected="selected"';
                }
                if (strpos($val, 'Verdana, Geneva') !== false) {
                    $font02 = 'selected="selected"';
                }
                if (strpos($val, 'Trebuchet') !== false) {
                    $font03 = 'selected="selected"';
                }
                if (strpos($val, 'Georgia') !== false) {
                    $font04 = 'selected="selected"';
                }
                if (strpos($val, 'Times New Roman') !== false) {
                    $font05 = 'selected="selected"';
                }
                if (strpos($val, 'Tahoma, Geneva') !== false) {
                    $font06 = 'selected="selected"';
                }
                if (strpos($val, 'Palatino') !== false) {
                    $font07 = 'selected="selected"';
                }
                if (strpos($val, 'Helvetica') !== false) {
                    $font08 = 'selected="selected"';
                }
                $output .= '<select class="of-typography of-typography-face" name="' . $value['id'] . '_face" id="' . $value['id'] . '_face">';
                $output .= '<option value="Arial, sans-serif" ' . $font01 . '>Arial</option>';
                $output .= '<option value="Verdana, Geneva, sans-serif" ' . $font02 . '>Verdana</option>';
                $output .= '<option value="&quot;Trebuchet MS&quot;, Tahoma, sans-serif"' . $font03 . '>Trebuchet</option>';
                $output .= '<option value="Georgia, serif" ' . $font04 . '>Georgia</option>';
                $output .= '<option value="&quot;Times New Roman&quot;, serif"' . $font05 . '>Times New Roman</option>';
                $output .= '<option value="Tahoma, Geneva, Verdana, sans-serif"' . $font06 . '>Tahoma</option>';
                $output .= '<option value="Palatino, &quot;Palatino Linotype&quot;, serif"' . $font07 . '>Palatino</option>';
                $output .= '<option value="&quot;Helvetica Neue&quot;, Helvetica, sans-serif" ' . $font08 . '>Helvetica*</option>';
                $output .= '</select>';
                /* Font Weight */
                $val = $default['style'];
                if ($typography_stored['style'] != "") {
                    $val = $typography_stored['style'];
                }
                $normal = '';
                $italic = '';
                $bold = '';
                $bolditalic = '';
                if ($val == 'normal') {
                    $normal = 'selected="selected"';
                }
                if ($val == 'italic') {
                    $italic = 'selected="selected"';
                }
                if ($val == 'bold') {
                    $bold = 'selected="selected"';
                }
                if ($val == 'bold italic') {
                    $bolditalic = 'selected="selected"';
                }
                $output .= '<select class="of-typography of-typography-style" name="' . $value['id'] . '_style" id="' . $value['id'] . '_style">';
                $output .= '<option value="normal" ' . $normal . '>Normal</option>';
                $output .= '<option value="italic" ' . $italic . '>Italic</option>';
                $output .= '<option value="bold" ' . $bold . '>Bold</option>';
                $output .= '<option value="bold italic" ' . $bolditalic . '>Bold/Italic</option>';
                $output .= '</select>';
                /* Font Color */
                $val = $default['color'];
                if ($typography_stored['color'] != "") {
                    $val = $typography_stored['color'];
                }
                $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color of-typography of-typography-color" name="' . $value['id'] . '_color" id="' . $value['id'] . '_color" type="text" value="' . $val . '" />';
                break;
            case "border":
                $default = $value['std'];
                $border_stored = get_option($value['id']);
                /* Border Width */
                $val = $default['width'];
                if ($border_stored['width'] != "") {
                    $val = $border_stored['width'];
                }
                $output .= '<select class="of-border of-border-width" name="' . $value['id'] . '_width" id="' . $value['id'] . '_width">';
                for ($i = 0; $i < 21; $i++) {
                    if ($val == $i) {
                        $active = 'selected="selected"';
                    } else {
                        $active = '';
                    }
                    $output .= '<option value="' . $i . '" ' . $active . '>' . $i . 'px</option>';
                }
                $output .= '</select>';
                /* Border Style */
                $val = $default['style'];
                if ($border_stored['style'] != "") {
                    $val = $border_stored['style'];
                }
                $solid = '';
                $dashed = '';
                $dotted = '';
                if ($val == 'solid') {
                    $solid = 'selected="selected"';
                }
                if ($val == 'dashed') {
                    $dashed = 'selected="selected"';
                }
                if ($val == 'dotted') {
                    $dotted = 'selected="selected"';
                }
                $output .= '<select class="of-border of-border-style" name="' . $value['id'] . '_style" id="' . $value['id'] . '_style">';
                $output .= '<option value="solid" ' . $solid . '>Solid</option>';
                $output .= '<option value="dashed" ' . $dashed . '>Dashed</option>';
                $output .= '<option value="dotted" ' . $dotted . '>Dotted</option>';
                $output .= '</select>';
                /* Border Color */
                $val = $default['color'];
                if ($border_stored['color'] != "") {
                    $val = $border_stored['color'];
                }
                $output .= '<div id="' . $value['id'] . '_color_picker" class="colorSelector"><div></div></div>';
                $output .= '<input class="of-color of-border of-border-color" name="' . $value['id'] . '_color" id="' . $value['id'] . '_color" type="text" value="' . $val . '" />';
                break;
            case "images":
                $i = 0;
                $select_value = get_option($value['id']);
                foreach ($value['options'] as $key => $option) {
                    $i++;
                    $checked = '';
                    $selected = '';
                    if ($select_value != '') {
                        if ($select_value == $key) {
                            $checked = ' checked';
                            $selected = 'of-radio-img-selected';
                        }
                    } else {
                        if ($value['std'] == $key) {
                            $checked = ' checked';
                            $selected = 'of-radio-img-selected';
                        } elseif ($i == 1 && !isset($select_value)) {
                            $checked = ' checked';
                            $selected = 'of-radio-img-selected';
                        } elseif ($i == 1 && $value['std'] == '') {
                            $checked = ' checked';
                            $selected = 'of-radio-img-selected';
                        } else {
                            $checked = '';
                        }
                    }
                    $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;
            case "info":
                $default = $value['std'];
                $output .= $default;
                break;
            case "heading":
                if ($counter >= 2) {
                    $output .= '</div>' . "\n";
                }
                $jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['name']));
                $jquery_click_hook = "of-option-" . $jquery_click_hook;
                $menu .= '<li><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;
        }
        // if TYPE is an array, formatted into smaller inputs... ie smaller values
        if (is_array($value['type'])) {
            foreach ($value['type'] as $array) {
                $id = $array['id'];
                $std = $array['std'];
                $saved_std = get_option($id);
                if ($saved_std != $std) {
                    $std = $saved_std;
                }
                $meta = $array['meta'];
                if ($array['type'] == 'text') {
                    // Only text at this point
                    $output .= '<input class="input-text-small of-input" name="' . $id . '" id="' . $id . '" type="text" value="' . $std . '" />';
                    $output .= '<span class="meta-two">' . $meta . '</span>';
                }
            }
        }
        if ($value['type'] != "heading") {
            if ($value['type'] != "checkbox") {
                $output .= '<br/>';
            }
            if (!isset($value['desc'])) {
                $explain_value = '';
            } else {
                $explain_value = $value['desc'];
            }
            $output .= '</div><div class="explain">' . $explain_value . '</div>' . "\n";
            $output .= '<div class="clear"> </div></div></div>' . "\n";
        }
    }
    $output .= '</div>';
    return array($output, $menu);
}