function mytheme_admin()
{
    global $themename, $shortname, $options;
    if ($_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . sprintf(__('%s settings saved.', 'vigilance'), $themename) . '</strong></p></div>';
    }
    if ($_REQUEST['reset']) {
        echo '<div id="message" class="updated fade"><p><strong>' . sprintf(__('%s settings reset.', 'vigilance'), $themename) . '</strong></p></div>';
    }
    ?>
<div class="wrap">
<h2 class="updatehook" style=" padding-top: 20px; font-size: 2.8em;"><?php 
    printf(__('%s Options', 'vigilance'), $themename);
    ?>
</h2>

<form action="themes.php?page=functions.php" method="post">

<table class="form-table">

<?php 
    foreach ($options as $value) {
        switch ($value['type']) {
            case 'subhead':
                ?>
			</table>
			
			<h3 style="padding-top: 15px;"><?php 
                echo $value['name'];
                ?>
</h3>
			
			<table class="form-table">
		<?php 
                break;
            case 'text':
                option_wrapper_header($value);
                ?>
		        <input name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" type="<?php 
                echo $value['type'];
                ?>
" value="<?php 
                if (get_settings($value['id']) != "") {
                    echo get_settings($value['id']);
                } else {
                    echo $value['std'];
                }
                ?>
" />
		<?php 
                option_wrapper_footer_nobreak($value);
                break;
            case 'select':
                option_wrapper_header($value);
                ?>
	            <select name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
">
	                <?php 
                foreach ($value['options'] as $option) {
                    ?>
	                <option value="<?php 
                    echo $option;
                    ?>
" <?php 
                    if (get_settings($value['id']) == $option) {
                        echo ' selected="selected"';
                    } elseif ($option == $value['std']) {
                        echo ' selected="selected"';
                    }
                    ?>
><?php 
                    _e($option);
                    ?>
</option>
	                <?php 
                }
                ?>
	            </select>
		<?php 
                option_wrapper_footer($value);
                break;
            case 'textarea':
                $ta_options = $value['options'];
                option_wrapper_header($value);
                ?>
				<textarea name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" cols="<?php 
                echo $ta_options['cols'];
                ?>
" rows="<?php 
                echo $ta_options['rows'];
                ?>
"><?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo stripslashes($value['std']);
                }
                ?>
</textarea>
		<?php 
                option_wrapper_footer($value);
                break;
            case "radio":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $radio_setting = get_settings($value['id']);
                    if ($radio_setting != '') {
                        if ($key == get_settings($value['id'])) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
	            <input type="radio" name="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $key;
                    ?>
" <?php 
                    echo $checked;
                    ?>
 /><?php 
                    echo $option;
                    ?>
<br />
		<?php 
                }
                option_wrapper_footer_nobreak($value);
                break;
            case "checkbox":
                option_wrapper_header($value);
                if (get_settings($value['id'])) {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
                ?>
		            <input type="checkbox" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
		<?php 
                option_wrapper_footer_nobreak($value);
                break;
            default:
                break;
        }
    }
    ?>

</table>

<p class="submit">
<input name="save" type="submit" value="<?php 
    _e('Save Changes', 'vigilance');
    ?>
" />    
<input type="hidden" name="action" value="save" />
</p>
</form>
<form action="themes.php?page=functions.php" method="post">
<p class="submit">
<input name="reset" type="submit" value="<?php 
    _e('Reset', 'vigilance');
    ?>
" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
<?php 
}
Example #2
0
/**
 * ADMIN OPTIONS
 *
 * output admin options
 * @since 7.0
 */
function bizzthemes_options()
{
    global $options, $design, $frame;
    // declare options variables
    if ($_GET['page'] == 'bizzthemes') {
        $options = $options;
        $bizz_page = __('Framework Settings', 'bizzthemes');
    } elseif ($_GET['page'] == 'bizz-design') {
        $options = $design;
        $bizz_page = __('Design Options', 'bizzthemes');
    }
    // options header
    bizzthemes_options_header($bizz_page, $toggle = true);
    foreach ($options as $value) {
        if (isset($value['type'])) {
            switch ($value['type']) {
                case 'text':
                    option_wrapper_header($value);
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value" type="<?php 
                    echo $value['type'];
                    ?>
" value="<?php 
                    echo stripslashes(stripslashes($val));
                    ?>
" />
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'select':
                    option_wrapper_header($value);
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<select class="select_input" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value">
<?php 
                    if (isset($value['show_option_none']) && $value['show_option_none'] == true) {
                        echo "<option value=''>" . __('-- None --', 'bizzthemes') . "</option>\n";
                    }
                    foreach ($value['options'] as $option) {
                        if ($val == $option) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $option . "\">" . $option . "</option>\n";
                    }
                    ?>

					</select>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'select_by_id':
                    option_wrapper_header($value);
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<select class="select_input" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value">
<?php 
                    if ($value['show_option_none'] == true) {
                        echo "<option value=''>" . __('-- None --', 'bizzthemes') . "</option>\n";
                    } elseif ($value['show_option_all'] == true) {
                        echo "<option value=''>" . __('-- All --', 'bizzthemes') . "</option>\n";
                    }
                    foreach ($value['options'] as $key => $option) {
                        if ($val == $option) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $option . "\">" . $key . "</option>\n";
                    }
                    ?>

					</select>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'menu_select':
                    option_wrapper_header($value);
                    $nav_menus = wp_get_nav_menus();
                    $nav_menu_selected_id = $nav_menus[0]->term_id;
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<select class="select_input" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value">
<?php 
                    foreach ((array) $nav_menus as $key => $_nav_menu) {
                        $_nav_menu->truncated_name = trim(wp_html_excerpt($_nav_menu->name, 40));
                        if ($_nav_menu->truncated_name != $_nav_menu->name) {
                            $_nav_menu->truncated_name .= '&hellip;';
                        }
                        $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name;
                        if ($val == esc_attr($_nav_menu->term_id)) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        ?>

								<option value="<?php 
                        echo esc_attr($_nav_menu->term_id);
                        ?>
" <?php 
                        echo $selected;
                        ?>
>
									<?php 
                        echo esc_html($_nav_menu->truncated_name);
                        ?>

								</option>
<?php 
                    }
                    ?>

					</select>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'upload':
                    option_wrapper_header($value);
                    $id = $value['id'];
                    $std = $value['std']['value'];
                    $uploader = '';
                    $val = '';
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<div id="upload-wrap">
						<div class="upload_button" id="<?php 
                    echo $id;
                    ?>
"><?php 
                    _e('Choose File', 'bizzthemes');
                    ?>
</div>
						<input class="upload_text_input" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value" type="text" value="<?php 
                    echo $val;
                    ?>
" />
<?php 
                    if (!empty($val)) {
                        ?>

							<a class="img-preview" href="<?php 
                        echo $val;
                        ?>
">
							<img id="image_<?php 
                        echo $id;
                        ?>
" src="<?php 
                        echo $val;
                        ?>
" width="10" height="10" title="Image Preview" alt="Image Preview" />
							</a>
<?php 
                    }
                    ?>

						<div class="clear"><!----></div>
					</div>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'textarea':
                    option_wrapper_header($value);
                    if (isset($value['wysiwyg']) && $value['wysiwyg'] != '') {
                        $wysiwyg = $value['wysiwyg'];
                    } else {
                        $wysiwyg = $value['id'];
                    }
                    if (isset($value['cols']) && $value['cols'] != '') {
                        $cols = $value['cols'];
                    } else {
                        $cols = '50';
                    }
                    if (isset($value['rows']) && $value['rows'] != '') {
                        $rows = $value['rows'];
                    } else {
                        $rows = '8';
                    }
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<textarea name="<?php 
                    echo $value['id'];
                    ?>
[value]" class="<?php 
                    echo $wysiwyg;
                    ?>
" id="<?php 
                    echo $wysiwyg;
                    ?>
" cols="<?php 
                    echo $cols;
                    ?>
" rows="<?php 
                    echo $rows;
                    ?>
"><?php 
                    echo stripslashes($val);
                    ?>
</textarea>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "radio":
                    option_wrapper_header($value);
                    $std = $value['std']['value'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['value']) ? $GLOBALS['opt'][$value['id']]['value'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['value']) ? $GLOBALS['optd'][$value['id']]['value'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    $counting = 0;
                    foreach ($value['options'] as $key => $option) {
                        $counting++;
                        $checked = '';
                        if ($val == $key) {
                            $checked = ' checked';
                        } else {
                            $checked = '';
                        }
                        ?>

					<input class="input_checkbox" type="radio" name="<?php 
                        echo $value['id'];
                        ?>
[value]" id="<?php 
                        echo $value['id']['value'] . '_' . $counting;
                        ?>
" value="<?php 
                        echo $key;
                        ?>
" <?php 
                        echo $checked;
                        ?>
 />&nbsp;
					<label for="<?php 
                        echo $value['id']['value'] . '_' . $counting;
                        ?>
"><?php 
                        echo $option;
                        ?>
</label><br />
					<input class="text_input" name="<?php 
                        echo $value['id'];
                        ?>
[css]" id="<?php 
                        echo $value['id'];
                        ?>
_css" type="hidden" value="<?php 
                        echo stripslashes(stripslashes($value['std']['css']));
                        ?>
" />
<?php 
                    }
                    option_wrapper_footer($value);
                    break;
                case "checkbox":
                    option_wrapper_header($value);
                    if (isset($GLOBALS['opt'][$value['id']]['value']) && $GLOBALS['opt'][$value['id']]['value'] || isset($GLOBALS['optd'][$value['id']]['value']) && $GLOBALS['optd'][$value['id']]['value'] || isset($value['std']['value']) && $value['std']['value'] && isset($GLOBALS['opt'][$value['id']]['value'])) {
                        $val = 'true';
                    } else {
                        $val = '';
                    }
                    $checked = '';
                    $checked = $val == 'true' ? ' checked' : '';
                    $disabled = isset($value['disabled']) ? $value['disabled'] : '';
                    ?>

					<input <?php 
                    echo $disabled;
                    ?>
 class="input_checkbox" type="checkbox" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value" value="true" <?php 
                    echo $checked;
                    ?>
 />
					<label for="<?php 
                    echo $value['id'];
                    ?>
_value"><?php 
                    echo $value['label'];
                    ?>
</label><br />
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "checkbox2":
                    option_wrapper_header($value);
                    if (isset($GLOBALS['opt'][$value['id']]['value'])) {
                        $checked = "checked=\"checked\"";
                    } elseif (isset($GLOBALS['optd'][$value['id']]['value'])) {
                        $checked = "checked=\"checked\"";
                    } else {
                        $checked = "";
                    }
                    $disabled = isset($value['disabled']) ? $value['disabled'] : '';
                    ?>

					<input <?php 
                    echo $disabled;
                    ?>
 class="input_checkbox" type="checkbox" name="<?php 
                    echo $value['id'];
                    ?>
[value]" id="<?php 
                    echo $value['id'];
                    ?>
_value" value="true" <?php 
                    echo $checked;
                    ?>
 />&nbsp;
					<label for="<?php 
                    echo $value['id'];
                    ?>
_value"><?php 
                    echo $value['label'];
                    ?>
</label><br />
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "multisort":
                    $vid = $value['id']['value'];
                    if ($GLOBALS['opt'][$value['id']]['value'] != '') {
                        $array1 = $GLOBALS['opt'][$value['id']]['value'];
                        $array2 = $value['options'];
                        $sort_array1 = array_intersect_key($array1, $array2);
                        $sort_array2 = array_diff_key($array1, $array2);
                        $count_a1 = count($sort_array1);
                        // count same array keys
                        $count_a2 = count($array2);
                        // count std arrays
                        if ($count_a1 == $count_a2) {
                            $sort_array = $sort_array1;
                            $opto = 'false';
                        } else {
                            $sort_array = $array2;
                            $opto = 'true';
                        }
                    } else {
                        $sort_array = $value['options'];
                        $opto = 'true';
                    }
                    foreach ($sort_array as $key => $value) {
                        $pn_key = $vid . '_' . $key;
                        $chk_std = $value['show'];
                        $chk_sav = isset($GLOBALS['opt'][$vid . '_' . $key]) ? true : '';
                        $chk_sav2 = isset($GLOBALS['opt'][$vid . '_' . $key]) ? true : '';
                        $checked = '';
                        if (!empty($chk_sav)) {
                            if ($chk_sav == 'true') {
                                $checked = "checked=\"checked\"";
                            } else {
                                $checked = '';
                            }
                        } elseif (!empty($chk_sav2)) {
                            if ($chk_sav == 'true') {
                                $checked = "checked=\"checked\"";
                            } else {
                                $checked = '';
                            }
                        } elseif ($chk_std == 'true') {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = '';
                        }
                        $opt_name = $value;
                        // get option full name
                        if ($opto == 'true') {
                            $opt_name = $value['name'];
                        } else {
                            $opt_name = $value;
                        }
                        // get option full name
                        ?>

					<div class="list_item">
					<input class="input_checkbox" type="checkbox" name="<?php 
                        echo $pn_key;
                        ?>
" id="<?php 
                        echo $pn_key;
                        ?>
" value="true" <?php 
                        echo $checked;
                        ?>
 />&nbsp;
					<label for="<?php 
                        echo $pn_key;
                        ?>
"><?php 
                        echo $opt_name;
                        ?>
&nbsp;&nbsp;<small style='color:#aaaaaa'>id=<?php 
                        echo $key;
                        ?>
</small></label><br />
					<input type="hidden" name="<?php 
                        echo $vid;
                        ?>
[<?php 
                        echo $key;
                        ?>
]" value="<?php 
                        echo $opt_name;
                        ?>
" />
					</div>
					<input class="text_input" name="<?php 
                        echo $value['id'];
                        ?>
[css]" id="<?php 
                        echo $value['id'];
                        ?>
_css" type="hidden" value="<?php 
                        echo stripslashes(stripslashes($value['std']['css']));
                        ?>
" />
<?php 
                    }
                    // end foreach
                    break;
                case "typography":
                    option_wrapper_header($value);
                    // font-family
                    $font_stacks = bizz_get_fonts();
                    $std = $value['std']['font-family'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['font-family']) ? $GLOBALS['opt'][$value['id']]['font-family'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['font-family']) ? $GLOBALS['optd'][$value['id']]['font-family'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q6" name="<?php 
                    echo $value['id'];
                    ?>
[font-family]" id="<?php 
                    echo $value['id'];
                    ?>
_font-family">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">Inherit</option>\n";
                    foreach ($font_stacks as $font_key => $font) {
                        if ($val == $font_key) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        $web_safe = $font['web_safe'] ? ' *' : '';
                        $goog_font = $font['google'] ? ' <small>G</small>' : '';
                        echo "<option " . $selected . " value=\"" . $font_key . "\">" . $font['name'] . $web_safe . '' . $goog_font . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // font-weight
                    $options_weight = array("normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900");
                    $std = $value['std']['font-weight'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['font-weight']) ? $GLOBALS['opt'][$value['id']]['font-weight'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['font-weight']) ? $GLOBALS['optd'][$value['id']]['font-weight'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q7" name="<?php 
                    echo $value['id'];
                    ?>
[font-weight]" id="<?php 
                    echo $value['id'];
                    ?>
_font-weight">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- weight --</option>\n";
                    foreach ($options_weight as $weight) {
                        if ($val == $weight) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $weight . "\">" . $weight . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // font-size
                    $std = $value['std']['font-size'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['font-size']) ? $GLOBALS['opt'][$value['id']]['font-size'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['font-size']) ? $GLOBALS['optd'][$value['id']]['font-size'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q3" name="<?php 
                    echo $value['id'];
                    ?>
[font-size]" id="<?php 
                    echo $value['id'];
                    ?>
_font-size">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- size --</option>\n";
                    for ($i = 7; $i < 71; $i++) {
                        $val == $i ? $selected = ' selected="selected"' : ($selected = '');
                        echo "<option{$selected} value=\"" . $i . "px\">" . $i . "px</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
				<span class="opt-spacing"><!----></span>
<?php 
                    // font-variant
                    $options_variant = array("normal", "small-caps");
                    $std = $value['std']['font-variant'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['font-variant']) ? $GLOBALS['opt'][$value['id']]['font-variant'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['font-variant']) ? $GLOBALS['optd'][$value['id']]['font-variant'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q2" name="<?php 
                    echo $value['id'];
                    ?>
[font-variant]" id="<?php 
                    echo $value['id'];
                    ?>
_font-variant">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- variant --</option>\n";
                    foreach ($options_variant as $variant) {
                        if ($val == $variant) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $variant . "\">" . $variant . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // font-style
                    $options_style = array("normal", "italic", "oblique");
                    $std = $value['std']['font-style'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['font-style']) ? $GLOBALS['opt'][$value['id']]['font-style'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['font-style']) ? $GLOBALS['optd'][$value['id']]['font-style'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q3" name="<?php 
                    echo $value['id'];
                    ?>
[font-style]" id="<?php 
                    echo $value['id'];
                    ?>
_font-style">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- style --</option>\n";
                    foreach ($options_style as $style) {
                        if ($val == $style) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $style . "\">" . $style . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // font-color
                    $std = $value['std']['color'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['color']) ? $GLOBALS['opt'][$value['id']]['color'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['color']) ? $GLOBALS['optd'][$value['id']]['color'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<input class="text_q color {hash:true,caps:false,required:false}" type="text" name="<?php 
                    echo $value['id'];
                    ?>
[color]" id="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $val;
                    ?>
" />
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "border":
                    option_wrapper_header($value);
                    // border-color
                    $position = $value['std']['border-position'];
                    $std = $value['std']['border-color'];
                    $sav = isset($GLOBALS['opt'][$value['id']][$position . '-color']) ? $GLOBALS['opt'][$value['id']][$position . '-color'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']][$position . '-color']) ? $GLOBALS['optd'][$value['id']][$position . '-color'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<input class="text_q q8 color {hash:true,caps:false,required:false}" name="<?php 
                    echo $value['id'];
                    ?>
[<?php 
                    echo $position;
                    ?>
-color]" id="<?php 
                    echo $value['id'];
                    ?>
_color" type="text" value="<?php 
                    echo $val;
                    ?>
" />
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // border-width
                    $position = $value['std']['border-position'];
                    $std = $value['std']['border-width'];
                    $sav = isset($GLOBALS['opt'][$value['id']][$position . '-width']) ? $GLOBALS['opt'][$value['id']][$position . '-width'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']][$position . '-width']) ? $GLOBALS['optd'][$value['id']][$position . '-width'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q3" name="<?php 
                    echo $value['id'];
                    ?>
[<?php 
                    echo $position;
                    ?>
-width]" id="<?php 
                    echo $value['id'];
                    ?>
_border-width">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- width --</option>\n";
                    for ($i = 0; $i < 30; $i++) {
                        $val == $i && $val != '' ? $selected = ' selected="selected"' : ($selected = '');
                        echo "<option{$selected} value=\"" . $i . "px\">" . $i . "px</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // border-style
                    $position = $value['std']['border-position'];
                    $options_style = array("solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset");
                    $std = $value['std']['border-style'];
                    $sav = isset($GLOBALS['opt'][$value['id']][$position . '-style']) ? $GLOBALS['opt'][$value['id']][$position . '-style'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']][$position . '-style']) ? $GLOBALS['optd'][$value['id']][$position . '-style'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q9" name="<?php 
                    echo $value['id'];
                    ?>
[<?php 
                    echo $position;
                    ?>
-style]" id="<?php 
                    echo $value['id'];
                    ?>
-style">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- style --</option>\n";
                    foreach ($options_style as $style) {
                        if ($val == $style) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $style . "\">" . $style . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "bgproperties":
                    option_wrapper_header($value);
                    // bg-image
                    $id = $value['id'];
                    $std = $value['std']['background-image'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['background-image']) ? $GLOBALS['opt'][$value['id']]['background-image'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['background-image']) ? $GLOBALS['optd'][$value['id']]['background-image'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

					<div id="upload-wrap">
						<div class="upload_button" id="<?php 
                    echo $id;
                    ?>
"><?php 
                    _e('Choose File', 'bizzthemes');
                    ?>
</div>
						<input class="upload_text_input" name="<?php 
                    echo $value['id'];
                    ?>
[background-image]" id="<?php 
                    echo $value['id'];
                    ?>
_value" type="text" value="<?php 
                    echo $val;
                    ?>
" />
						<?php 
                    if (!empty($val)) {
                        ?>

							<a class="img-preview" href="<?php 
                        echo $val;
                        ?>
">
							<img id="image_<?php 
                        echo $id;
                        ?>
" src="<?php 
                        echo $val;
                        ?>
" width="10" height="10" title="Image Preview" alt="Image Preview" />
							</a>
						<?php 
                    }
                    ?>

						<div class="clear"><!----></div>
					</div>
					<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
					
				<span class="opt-spacing"><!----></span>
<?php 
                    // bg-color
                    $std = $value['std']['background-color'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['background-color']) ? $GLOBALS['opt'][$value['id']]['background-color'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['background-color']) ? $GLOBALS['optd'][$value['id']]['background-color'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<input class="text_q q8 color {hash:true,caps:false,required:false}" type="text" name="<?php 
                    echo $value['id'];
                    ?>
[background-color]" id="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $val;
                    ?>
" />
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // bg-repeat
                    $options_style = array("repeat", "repeat-x", "repeat-y", "no-repeat");
                    $std = $value['std']['background-repeat'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['background-repeat']) ? $GLOBALS['opt'][$value['id']]['repeat'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['background-repeat']) ? $GLOBALS['optd'][$value['id']]['background-repeat'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q3" name="<?php 
                    echo $value['id'];
                    ?>
[background-repeat]" id="<?php 
                    echo $value['id'];
                    ?>
_repeat">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- repeat --</option>\n";
                    foreach ($options_style as $repeat) {
                        if ($val == $repeat) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $repeat . "\">" . $repeat . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    // bg-position
                    $options_style = array("top left", "top center", "top right", "center left", "center center", "center right", "bottom left", "bottom center", "bottom right");
                    $std = $value['std']['background-position'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['background-position']) ? $GLOBALS['opt'][$value['id']]['background-position'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['background-position']) ? $GLOBALS['optd'][$value['id']]['background-position'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<select class="select_q q9" name="<?php 
                    echo $value['id'];
                    ?>
[background-position]" id="<?php 
                    echo $value['id'];
                    ?>
_position">
<?php 
                    $selected = !$std ? ' selected="selected"' : '';
                    echo "<option{$selected} value=\"\">-- position --</option>\n";
                    foreach ($options_style as $position) {
                        if ($val == $position) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        echo "<option " . $selected . " value=\"" . $position . "\">" . $position . "</option>\n";
                    }
                    ?>

				</select>
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "color":
                    option_wrapper_header($value);
                    $std = $value['std']['color'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['color']) ? $GLOBALS['opt'][$value['id']]['color'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['color']) ? $GLOBALS['optd'][$value['id']]['color'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<input class="text_q q8 color {hash:true,caps:false,required:false}" type="text" name="<?php 
                    echo $value['id'];
                    ?>
[color]" id="<?php 
                    echo $value['id'];
                    ?>
_color"  value="<?php 
                    echo $val;
                    ?>
" />
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case "background-color":
                    option_wrapper_header($value);
                    $std = $value['std']['background-color'];
                    $sav = isset($GLOBALS['opt'][$value['id']]['background-color']) ? $GLOBALS['opt'][$value['id']]['background-color'] : '';
                    $sav2 = isset($GLOBALS['optd'][$value['id']]['background-color']) ? $GLOBALS['optd'][$value['id']]['background-color'] : '';
                    if ($sav != "") {
                        $val = $sav;
                    } elseif ($sav2 != "") {
                        $val = $sav2;
                    } else {
                        $val = $std;
                    }
                    ?>

				<input class="text_q q8 color {hash:true,caps:false,required:false}" type="text" name="<?php 
                    echo $value['id'];
                    ?>
[background-color]" id="<?php 
                    echo $value['id'];
                    ?>
_background-color" value="<?php 
                    echo $val;
                    ?>
" />
				<input class="text_input" name="<?php 
                    echo $value['id'];
                    ?>
[css]" id="<?php 
                    echo $value['id'];
                    ?>
_css" type="hidden" value="<?php 
                    echo stripslashes(stripslashes($value['std']['css']));
                    ?>
" />
<?php 
                    option_wrapper_footer($value);
                    break;
                case 'help':
                    option_wrapper_header3($value);
                    echo '<div><!----></div>' . "\n";
                    option_wrapper_footer3($value);
                    break;
                case "heading":
                    echo '<div class="box-title">' . $value['name'] . '</div>' . "\n";
                    echo '<div class="fr submit submit-title">' . "\n";
                    echo '<input name="save" class="button" type="submit" value="' . __('Save changes', 'bizzthemes') . '" />' . "\n";
                    // echo '<input type="hidden" name="bizz_save" value="save" />'."\n";
                    echo '</div>' . "\n";
                    break;
                case "subheadingtop":
                    echo '<div class="feature-box">' . "\n";
                    echo '<div class="subheading">' . "\n";
                    if ($value['toggle'] != "") {
                        echo '<a class="toggle" href="" title="Show/hide additional information"><span class="pos">&nbsp;</span><span class="neg">&nbsp;</span>' . $value['name'] . '</a>';
                    }
                    echo '</div>' . "\n";
                    echo '<div class="options-box">' . "\n";
                    break;
                case "subheadingbottom":
                    echo '</div>' . "\n";
                    // end options-box
                    echo '</div>' . "\n";
                    // end feature-box
                    break;
                case "wraptop":
                    echo '<div class="table-row"><div class="text"><div class="wrap-dropdown">' . "\n";
                    break;
                case "wrapbottom":
                    echo '</div></div></div>' . "\n";
                    break;
                case "upc_top":
                    echo '<div class="table-row upc-top"><div class="text"><div class="upc-wrap">' . "\n";
                    break;
                case "upc_bottom":
                    echo '</div></div></div>' . "\n";
                    break;
                case "upc_addremove":
                    echo '<div class="addremove"><span class="add" title="Add new item">Add [&#43;]</span> <span class="remove" title="Remove this item">Remove [&#45;]</span></div>' . "\n";
                    break;
                case "sorttop":
                    echo '<div class="table-row"><div class="text"><div id="sortme" class="wrap-dropdown sortable">' . "\n";
                    break;
                case "sortbottom":
                    echo '</div></div></div>' . "\n";
                    break;
                case "maintabletop":
                    echo '<div class="maintable">' . "\n";
                    break;
                case "maintablebottom":
                    echo '</div>' . "\n";
                    break;
                case "maintablebreak":
                    echo '<div class="break"><!----></div>' . "\n";
                    break;
                default:
                    break;
            }
            #end switch
        }
    }
    #foreach
    // options footer
    bizzthemes_options_footer();
}
Example #3
0
function mytheme_admin_child()
{
    global $customserviceurl, $kampylefeedback, $themename, $bloghomeurl, $shortname, $options_child;
    $options = $options_child;
    ?>
<h2><?php 
    _e('Child Theme');
    ?>
</h2>

<form method="post">
  <?php 
    foreach ($options as $value) {
        switch ($value['type']) {
            case 'text':
                option_wrapper_header($value);
                ?>
  <input class="text_input" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" type="<?php 
                echo $value['type'];
                ?>
" value="<?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo stripslashes($value['std']);
                }
                ?>
" />
  <?php 
                option_wrapper_footer($value);
                break;
            case 'select':
                option_wrapper_header($value);
                ?>
  <select class="select_input" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
">
    <?php 
                foreach ($value['options'] as $option) {
                    ?>
    <option<?php 
                    if (get_settings($value['id']) == $option) {
                        echo ' selected="selected"';
                    } elseif ($option == $value['std']) {
                        echo ' selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option>
    <?php 
                }
                ?>
  </select>
  <?php 
                option_wrapper_footer($value);
                break;
            case 'textarea':
                $ta_options = $value['options'];
                option_wrapper_header($value);
                ?>
  <textarea name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" cols="<?php 
                echo $ta_options['cols'];
                ?>
" rows="8"><?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo $value['std'];
                }
                ?>
</textarea>
  <?php 
                option_wrapper_footer($value);
                break;
            case 'textarea2':
                $ta_options = $value['options'];
                option_wrapper_header($value);
                ?>
  <textarea name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" cols="<?php 
                echo $ta_options['cols'];
                ?>
" rows="2"><?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo $value['std'];
                }
                ?>
</textarea>
  <?php 
                option_wrapper_footer($value);
                break;
            case "radio":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $radio_setting = get_settings($value['id']);
                    if ($radio_setting != '') {
                        if ($key == get_settings($value['id'])) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
  <input type="radio" name="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $key;
                    ?>
" <?php 
                    echo $checked;
                    ?>
 />
  <?php 
                    echo $option;
                    ?>
<br />
  <?php 
                }
                option_wrapper_footer($value);
                break;
            case "checkbox":
                option_wrapper_header($value);
                if (get_settings($value['id'])) {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
                ?>
  <input <?php 
                echo $value['disabled'];
                ?>
 class="input_checkbox" type="checkbox" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
  &nbsp;
  <label for="<?php 
                echo $value['id'];
                ?>
"><?php 
                _e($value['label']);
                ?>
</label>
  <br />
  <?php 
                option_wrapper_footer($value);
                break;
            case "multicheck":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $pn_key = $value['id'] . '_' . $key;
                    $checkbox_setting = get_settings($pn_key);
                    if ($checkbox_setting != '') {
                        if (get_settings($pn_key)) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
  <input type="checkbox" name="<?php 
                    echo $pn_key;
                    ?>
" id="<?php 
                    echo $pn_key;
                    ?>
" value="true" <?php 
                    echo $checked;
                    ?>
 />
  <label for="<?php 
                    echo $pn_key;
                    ?>
"><?php 
                    echo $option;
                    ?>
</label>
  <br />
  <?php 
                }
                option_wrapper_footer($value);
                break;
            case "label":
                ?>
  <div class="subheading"><?php 
                _e($value['name']);
                ?>
 
  <p class="description"><?php 
                _e($value['desc']);
                ?>
</p>
  </div>
  
  <?php 
                break;
            case "heading":
                ?>
  <div class="box-title"><?php 
                _e($value['name']);
                ?>
 </div>
  <div class="fr submit submit-title">
    <input name="save" type="submit" value="<?php 
                _e('Save changes');
                ?>
" />
    <input type="hidden" name="action" value="save" />
  </div>
  <?php 
                break;
            case "subheadingtop":
                ?>
  <div class="feature-box">
    <div class="subheading">
      <?php 
                if ($value['toggle'] != "") {
                    ?>
      <a href="" title="Show/hide additional information"><span class="pos"> <?php 
                    _e($value['name']);
                    ?>
</span><span class="neg"><?php 
                    _e($value['name']);
                    ?>
</span></a>
      <?php 
                }
                ?>
     </div>
    <div class="options-box">
      <?php 
                break;
            case "subheadingbottom":
                ?>
    </div>
  </div>
  <?php 
                break;
            case "wraptop":
                ?>
    <div class="wrap-dropdown">
      <?php 
                break;
            case "wrapbottom":
                ?>
    </div>
  <?php 
                break;
            case "multihead":
                option_wrapper_header2($value);
                break;
            case "maintabletop":
                ?>
  <div class="maintable">
    <?php 
                break;
            case "maintablebottom":
                ?>
  </div>
  <?php 
                break;
            case "maintablebreak":
                ?>
  <br/>
  <?php 
                break;
            default:
                break;
        }
    }
    ?>

  <p class="submit reset_save">
    <input name="save" type="submit" value="<?php 
    _e('Save changes');
    ?>
" />
    <input type="hidden" name="action" value="save" />
  </p>
</form>
<form method="post">
  <p class="submit reset_save reset">
    <input name="reset" type="submit" value="<?php 
    _e('Reset');
    ?>
" />
    <input type="hidden" name="action" value="reset" />
  </p>
</form>
<?php 
}
Example #4
0
function mytheme_admin()
{
    global $themename, $shortname, $options;
    if ($_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings saved.</strong></p></div>';
    }
    if ($_REQUEST['reset']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings reset.</strong></p></div>';
    }
    ?>
<div class="wrap">
<h2><?php 
    echo $themename;
    ?>
 options</h2>

<form method="post">

<table class="optiontable">

<?php 
    foreach ($options as $value) {
        switch ($value['type']) {
            case 'text':
                option_wrapper_header($value);
                ?>
		        <input style="width:400px;" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" type="<?php 
                echo $value['type'];
                ?>
" value="<?php 
                if (get_settings($value['id']) != "") {
                    echo get_settings($value['id']);
                } else {
                    echo $value['std'];
                }
                ?>
" />
		<?php 
                option_wrapper_footer($value);
                break;
            case 'select':
                option_wrapper_header($value);
                ?>
	            <select style="width:240px;" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
">
	                <?php 
                foreach ($value['options'] as $option) {
                    ?>
	                <option<?php 
                    if (get_settings($value['id']) == $option) {
                        echo ' selected="selected"';
                    } elseif ($option == $value['std']) {
                        echo ' selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option>
	                <?php 
                }
                ?>
	            </select>
		<?php 
                option_wrapper_footer($value);
                break;
            case 'textarea':
                $ta_options = $value['options'];
                option_wrapper_header($value);
                ?>
				<textarea name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" style="width:400px;height:100px;"><?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo $value['std'];
                }
                ?>
</textarea>
		<?php 
                option_wrapper_footer($value);
                break;
            case "radio":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $radio_setting = get_settings($value['id']);
                    if ($radio_setting != '') {
                        if ($key == get_settings($value['id'])) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
	            <input type="radio" name="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $key;
                    ?>
" <?php 
                    echo $checked;
                    ?>
 /><?php 
                    echo $option;
                    ?>
<br />
		<?php 
                }
                option_wrapper_footer($value);
                break;
            case "checkbox":
                option_wrapper_header($value);
                if (get_settings($value['id'])) {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
                ?>
		            <input type="checkbox" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
		<?php 
                option_wrapper_footer($value);
                break;
            case "multicheck":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $pn_key = $value['id'] . '_' . $key;
                    $checkbox_setting = get_settings($pn_key);
                    if ($checkbox_setting != '') {
                        if (get_settings($pn_key)) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
	            <input type="checkbox" name="<?php 
                    echo $pn_key;
                    ?>
" id="<?php 
                    echo $pn_key;
                    ?>
" value="true" <?php 
                    echo $checked;
                    ?>
 /><label for="<?php 
                    echo $pn_key;
                    ?>
"><?php 
                    echo $option;
                    ?>
</label><br />
		<?php 
                }
                option_wrapper_footer($value);
                break;
            case "heading":
                ?>
		<tr valign="top"> 
		    <td colspan="2" style="text-align: center;"><h3><?php 
                echo $value['name'];
                ?>
</h3></td>
		</tr>
		<?php 
                break;
            default:
                break;
        }
    }
    ?>

</table>

<p class="submit">
<input name="save" type="submit" value="Save changes" />    
<input type="hidden" name="action" value="save" />
</p>
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Reset" />
<input type="hidden" name="action" value="reset" />
</p>
</form>

<?php 
}
function mytheme_admin()
{
    global $themename, $shortname, $options;
    if ($_REQUEST['saved']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings saved.</strong></p></div>';
    }
    if ($_REQUEST['reset']) {
        echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' settings reset.</strong></p></div>';
    }
    ?>
<div class="wrap">
<h2 class="updatehook" style=" padding-top: 20px; font-size: 2.8em;"><?php 
    echo $themename;
    ?>
 Options</h2>
<div class="updated" style="margin: 15px 10px 15px 25px;"><p style="line-height: 1.6em; font-size: 1.2em; width: 75%;">On this page you can modify background colors, link colors, add your contact info, welcome message and tracking code.  If you have questions, please visit the <a href="http://graphpaperpress.com/forums/">forums</a> at <a href="http://graphpaperpress.com">GraphPaperPress.com</a>.  Happy publishing!</p>
</div>
<div class="error" style="margin: 15px 10px 15px 25px;"><h2>Introducing...Totally Rad Homepage Options</h2>
<p style="line-height: 1.6em; font-size: 1.2em; width: 75%;">You can download and install additional applications for this theme at <a href="http://graphpaperpress.com">GraphPaperPress.com</a>.  You can add things like a homepage slideshow, a Mac-style image slider, a magazine-style front page, plus much, much more.</p>
</div>
<form method="post">

<table class="form-table">

<?php 
    foreach ($options as $value) {
        switch ($value['type']) {
            case 'subhead':
                ?>
			</table>

			<h3><?php 
                echo $value['name'];
                ?>
</h3>

			<table class="form-table">
		<?php 
                break;
            case 'text':
                option_wrapper_header($value);
                ?>
		        <input name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" type="<?php 
                echo $value['type'];
                ?>
" value="<?php 
                if (get_settings($value['id']) != "") {
                    echo get_settings($value['id']);
                } else {
                    echo $value['std'];
                }
                ?>
" />
		<?php 
                option_wrapper_footer($value);
                break;
            case 'select':
                option_wrapper_header($value);
                ?>
	            <select name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
">
	                <?php 
                foreach ($value['options'] as $option) {
                    ?>
	                <option <?php 
                    if (get_settings($value['id']) == $option) {
                        echo ' selected="selected"';
                    } elseif ($option == $value['std']) {
                        echo ' selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option>
	                <?php 
                }
                ?>
	            </select>
		<?php 
                option_wrapper_footer($value);
                break;
            case 'textarea':
                $ta_options = $value['options'];
                option_wrapper_header($value);
                ?>
				<textarea name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" cols="<?php 
                echo $ta_options['cols'];
                ?>
" rows="<?php 
                echo $ta_options['rows'];
                ?>
"><?php 
                if (get_settings($value['id']) != "") {
                    echo stripslashes(get_settings($value['id']));
                } else {
                    echo stripslashes($value['std']);
                }
                ?>
</textarea>
		<?php 
                option_wrapper_footer($value);
                break;
            case "radio":
                option_wrapper_header($value);
                foreach ($value['options'] as $key => $option) {
                    $radio_setting = get_settings($value['id']);
                    if ($radio_setting != '') {
                        if ($key == get_settings($value['id'])) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    } else {
                        if ($key == $value['std']) {
                            $checked = "checked=\"checked\"";
                        } else {
                            $checked = "";
                        }
                    }
                    ?>
	            <input type="radio" name="<?php 
                    echo $value['id'];
                    ?>
" value="<?php 
                    echo $key;
                    ?>
" <?php 
                    echo $checked;
                    ?>
 /><?php 
                    echo $option;
                    ?>
<br />
		<?php 
                }
                option_wrapper_footer($value);
                break;
            case "checkbox":
                option_wrapper_header($value);
                if (get_settings($value['id'])) {
                    $checked = "checked=\"checked\"";
                } else {
                    $checked = "";
                }
                ?>
		            <input type="checkbox" name="<?php 
                echo $value['id'];
                ?>
" id="<?php 
                echo $value['id'];
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
		<?php 
                option_wrapper_footer($value);
                break;
            default:
                break;
        }
    }
    ?>

</table>

<p class="submit">
<input name="save" type="submit" value="Save changes" />
<input type="hidden" name="action" value="save" />
</p>
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Reset" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
<?php 
}
Example #6
0
                ?>
" value="true" <?php 
                echo $checked;
                ?>
 />
  <label for="<?php 
                echo $pn_key;
                ?>
"><?php 
                echo $option;
                ?>
</label>
  <br />
  <?php 
            }
            option_wrapper_footer($value);
            break;
        case "label":
            ?>
  <div class="subheading"><?php 
            _e($value['name']);
            ?>
 
  <p class="description"><?php 
            _e($value['desc']);
            ?>
</p>
  </div>
  
  <?php 
            break;