Schaltfläche Speichern und Zurücksetzen in der Themenoption mit Ajax (ohne Aktualisierung)

Ich habe eine Thema-Optionen-Seite und ich werde, dass die Schaltfläche speichern und Reset geladen, ohne die ganze Seite zu aktualisieren … aber ich habe keine Ahnung, wie ich Ajax in meinem Thema-Option implementieren kann … Vielen Dank für Ihre Hilfe.

Der Code ist:

function mytheme_add_admin() { global $themename, $dirname, $themeurl, $shortname, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: admin.php?page=admin_interface.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: admin.php?page=admin_interface&reset=true"); die; } else if( 'export' == $_REQUEST['action'] ) export_settings(); else if( 'import' == $_REQUEST['action'] ) import_settings(); } $rp_page = add_menu_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); add_action("admin_print_scripts-$rp_page", 'rp_load_only'); add_action("admin_print_styles-$rp_page",'rp_style_only'); } function rp_style_only() { $file_dir=get_bloginfo('template_directory'); wp_enqueue_style("admin_style", $file_dir."/functions/admin/css/admin_style.css", false, "1.0", "all"); wp_enqueue_script("colorpicker", $file_dir."/functions/admin/js/jquery.color.picker.js", false, "1.0"); wp_enqueue_script("tabs", $file_dir."/functions/admin/js/jquery.tabs.js", false, "1.0"); wp_enqueue_script("custom", $file_dir."/functions/admin/js/custom.js", false, "1.0"); } function mytheme_admin() { global $themename, $dirname, $themeurl, $shortname, $options; if ( $_REQUEST['saved'] ) echo '

Options Saved

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

Options Reset

'; ?>
<div class="panel option-tab" title="">

<input name="" id="" type="" value="" class="theme-input" /> Get Image

<input name="" id="" type="text" value="" class="theme-input text-small" />

<input name="" id="" type="text" value="" class="theme-input" />px

<textarea name="" type="" cols="" rows="" class="theme-textarea large-textarea">

<select class="theme-select" name="" id=""><option value="" >
<div class="option multi-checkbox">

<input class="theme-checkbox" type="checkbox" name="" id="" value="true" />

$option) { $radio_setting = get_option($value['id']); if($radio_setting != ''){ if ($key == get_option($value['id']) ) { $checked = "checked=\"checked\""; } else { $checked = ""; } }else{ if($key == $value['std']){ $checked = "checked=\"checked\""; }else{ $checked = ""; } }?>
<input type="radio" name="" id="" value="" /><label for="">

jQuery(document).ready(function($) { $("#").ColorPicker({ onSubmit: function(hsb, hex, rgb) { $("#").val("#"+hex); }, onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); return false; }, onChange: function (hsb, hex, rgb) { $("#cp_ div").css({"backgroundColor":"#"+hex, "backgroundImage": "none", "borderColor":"#"+hex}); $("#cp_").prev("input").attr("value", "#"+hex); } }) .bind('keyup', function(){ $(this).ColorPickerSetColor(this.value); }); }); <input type="text" name="" id="" value="" class="cp_input" /> <div id="cp_" class="cp_box"> <div style="background-color:;">
Click the text box for color picker.

Import Theme Settings

If you have a back up of your theme settings you can import them below.

Export Theme Settings

If you want to create a back up of all your theme settings click the Export button below. Note: This option only backs up your theme settings and not your post/page data.

0) { echo "Error: " . $_FILES["file"]["error"] . "
"; } else { $rawdata = file_get_contents($_FILES["file"]["tmp_name"]); $theme_settings = unserialize($rawdata); foreach ($options as $value) { if ($theme_settings[$value['id']]) { update_option( $value['id'], $theme_settings[$value['id']] ); $$value['id'] = $theme_settings[$value['id']]; } else { if ($value['type'] == 'checkbox_multiple') $$value['id'] = array(); else $$value['id'] = $value['std']; } } } if (in_array('cacheStyles', get_option('theme_misc'))) cache_settings(); wp_redirect($_SERVER['PHP_SELF'].'?page=admin_options.php'); } ?>

Solutions Collecting From Web of "Schaltfläche Speichern und Zurücksetzen in der Themenoption mit Ajax (ohne Aktualisierung)"