options as $value) { if ( array_key_exists('id', $value) ) { if ( isset( $_REQUEST[ $value['id'] ] ) ) { if ( in_array( $value['id'], array( $this->shortname.'_background_color', $this->shortname.'_border_color', $this->shortname.'_hover_color', $this->shortname.'_link_color', ) ) ) { $opt_value = preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', trim( $_REQUEST[ $value['id'] ] ) ) ? trim( $_REQUEST[ $value['id'] ] ) : ''; update_option( $value['id'], $opt_value ); } else { update_option( $value['id'], stripslashes( $_REQUEST[ $value['id'] ] ) ); } } } } wp_redirect("themes.php?page=".basename(__FILE__)."&saved=true"); exit; } else if ( ! empty( $_REQUEST['reset-theme-options-nonce'] ) && wp_verify_nonce( $_REQUEST['reset-theme-options-nonce'], 'reset-theme-options' ) && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'reset' ) { foreach ($this->options as $value) { if ( array_key_exists('id', $value) ) { delete_option( $value['id'] ); } } wp_redirect("themes.php?page=".basename(__FILE__)."&reset=true"); exit; } } add_theme_page(__( 'Theme Options' ), __( 'Theme Options' ), 'edit_theme_options', basename(__FILE__), array(&$this, 'adminPage')); } /* Output of the Admin Page */ function adminPage () { // global $themename, $shortname, $options; if ( isset( $_REQUEST['saved'] ) && $_REQUEST['saved'] ) echo '

' . $this->themename . __(' options saved.', 'vigilance') . '

'; if ( isset( $_REQUEST['reset'] ) && $_REQUEST['reset'] ) echo '

' . $this->themename . __(' options reset.', 'vigilance') . '

'; ?>
" . get_current_theme() . __( ' Theme Options' ) . ""; ?>
options); $i++) : switch ($this->options[$i]["type"]) : case "subhead": if ($i != 0) { ?>
options[$i]['hidden'] ) && $this->options[$i]['hidden'] ) ? ' style="display: none;"' : ''; ?>>

options[$i]["name"]; ?>

options[$i]["desc"] ); ?>
" type="checkbox" name="options[$i]['id'] ); ?>" value="true"options[$i]['id']) ) ? ' checked="checked"' : ''; ?> />
options[$i]["desc"] ); ?>
options[$i]['id'] ); foreach ( $this->options[$i]['options'] as $key => $val ) : $checked = false; if ( $key == $radio_setting || ( !$radio_setting && $key == $this->options[$i]['std'] ) ) { $checked = ' checked="checked"'; } ?> />

options[$i]["desc"] ); ?>
" type="text" name="options[$i]["id"] ); ?>" value="options[$i]["id"]) ) != '') ) ? esc_attr( get_settings($this->options[$i]["id"]) ) : esc_attr( $this->options[$i]["std"] ); ?>" />
options[$i]["desc"] ); ?>
_colorpicker" class="colorpicker_container">
" type="text" name="options[$i]["id"] ); ?>" value="options[$i]["id"] ) != '') ? esc_attr( get_settings($this->options[$i]["id"]) ) : esc_attr( $this->options[$i]["std"] ); ?>" />
options[$i]["desc"] ); ?>
options[$i]["desc"] ); ?>