false); $uploaded = wp_handle_upload($files_one,$overrides); if (isset($uploaded['url'])) { $image_info = getimagesize($uploaded['file']); $the_value['file' ] = $uploaded['file']; $the_value['url' ] = $uploaded['url' ]; $the_value['width' ] = $image_info[0]; $the_value['height'] = $image_info[1]; $_REQUEST[$option['id']] = true; } } } // upload } // type == image else { if (!isset($_REQUEST[$option['id']])) { if ($option['type'] == 'checkbox') $_REQUEST[$option['id']] = ''; } if (!is_array($_REQUEST[$option['id']])) $the_value = stripslashes($_REQUEST[$option['id']]); else $the_value = serialize($_REQUEST[$option['id']]); } if (isset($_REQUEST[$option['id']])) { if (isset($the_value)) { if ($option['type'] == 'color') { $len = strlen($the_value); if ((($len != 4) && ($len != 7)) || ($the_value{0} != '#')) $the_value = ''; } update_option($option['id'],$the_value); } } } header('Location: admin.php?page=btw_kiss_admin.php&saved=true'); die; } // // action: reset // else if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'reset')) { // Loop the options and delete them (setting the default values will happen on next page load). foreach ($options as $option) { if (isset($option['id'])) delete_option($option['id']); } // Insert into the wp_options table. foreach ($options as $option) { if (($option['type'] == 'open') || ($option['type'] == 'close') || ($option['type'] == 'displayonly')) continue; update_option($option['id'],$option['std']); } header("Location: admin.php?page=btw_kiss_admin.php&reset=true"); die; } // // action: delete (all oprtions table data) // else if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'delete')) { foreach ($options as $option) { if (isset($option['id'])) delete_option($option['id']); } header("Location: themes.php"); die; } // // action: the end // } // Required, for some reason. add_theme_page(__('BirchWare Theme Kiss - Options','bwt_kiss') ,__('Theme Options','bwt_kiss') ,'edit_themes' ,basename(__FILE__) ,'bwt_options_menu_form' ); //add_menu_page(__('BirchWare Theme Kiss - Options','bwt_kiss') // ,__('Theme Options','bwt_kiss') // ,'edit_themes' // ,basename(__FILE__) // ,'bwt_options_menu_form' // ,get_template_directory_uri() . '/pix/icon_menu_admin.png' // ,61 // ); } function bwt_options_menu_form() { $menubar_html = ''; $fields_html = ''; include get_template_directory() . '/options/init_fields.php'; include get_template_directory() . '/options/get_fields.php'; $save_button = '
' . ' ' . ' ' . '
' ; ?> ' ?>
' . '
' . '

' . __('This is for when you want to uninstall the theme, and remove any trace of it from the database.' ,'bwt_kiss') . '

' . '

' . __('After you have confirmed the deletion, you will be taken to the Appearance/Themes page, where you can replace and delete the theme.' ,'bwt_kiss') . '

' . '

' . __('You must do this before you activate another theme, since upon inactivation, this menu option will disappear.' ,'bwt_kiss') . '

' . '
' . '' . '' . '
' . '
' ; }