";
$output = base64_encode($output);
update_option('wr_settings_encode',$output);
//End
$send = $_GET['page'];
header("Location: admin.php?page=$send&saved=true");
die;
} else if ( 'reset' == $_REQUEST['action'] ) {
global $wpdb;
$query = "DELETE FROM $wpdb->options WHERE option_name LIKE 'wr_%'";
$wpdb->query($query);
$send = $_GET['page'];
header("Location: admin.php?page=$send&reset=true");
die;
}
}
// Check all the Options, then if the no options are created for a ralitive sub-page... it's not created.
// Add main menu BlueHigh and its submenu in admin panel menu.
if(function_exists(add_object_page))
{
add_object_page ('Page Title', $themename, 8,'wrthemes_home', 'wrthemes_page_gen', 'http://professionalwp.com/favicon.ico');
}
else
{
add_menu_page ('Page Title', $themename, 8,'wrthemes_home', 'wrthemes_page_gen', 'http://professionalwp.com/favicon.ico');
}
add_submenu_page('wrthemes_home', $themename, 'Theme Options', 8, 'wrthemes_home','wrthemes_page_gen'); // Default
if ($page_advertising){ add_submenu_page('wrthemes_home', $themename, 'Advertising', 8, 'wrthemes_advertising', 'wrthemes_advertising'); }
if ($page_nav){ add_submenu_page('wrthemes_home', $themename, 'Navigation', 8, 'wrthemes_nav', 'wrthemes_nav'); }
if ($page_resizing){ add_submenu_page('wrthemes_home', $themename, 'Image Resizing', 8, 'wrthemes_image', 'wrthemes_image'); }
////add_submenu_page('wrthemes_home', 'Available wrThemes', 'Buy Themes', 8, 'wrthemes_themes', 'wrthemes_more_themes_page');
}
function wrthemes_advertising(){ wrthemes_page_gen('advertising'); }
function wrthemes_nav(){ wrthemes_page_gen('nav'); }
function wrthemes_image(){ wrthemes_page_gen('image'); }
/* function wrthemes_page_gen is used to display a page
at admin side to set up theme option with a well designed form using jquery */
function wrthemes_page_gen($page){
$options = get_option('wr_template');
$themename = get_option('wr_themename');
$shortname = get_option('wr_shortname');
$manualurl = get_option('wr_manual');
//Version
$theme_data = get_theme_data(ABSPATH . 'wp-content/themes/'. get_option('template') .'/style.css');
$local_version = $theme_data['Version'];
$update_message = 'v.'. $local_version .'';
?>
'."\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 && !empty($saved_std) ){$std = $saved_std;}
$meta = $array['meta'];
if($array['type'] == 'text') { // Only text at this point
$output .= '';
$output .= ''.$meta.'';
}
}
}
if ( $value['type'] != "heading" ) {
if ( $value['type'] != "checkbox" )
{
$output .= ' ';
}
$output .= '
'. $value['desc'] .'
'."\n";
$output .= '
'."\n";
}
}
}
$output .= '';
return $output;
}
// wrThemes Uploader
// This function is used when case is upload in wrthemes_machine to get the form fiellds like logo upload,custom favication in a form at admin side.
function wrthemes_uploader_function($id,$std){
$uploader .= '';
$uploader .= '';
$uploader .= '';
$upload = get_option($id);
$uploader .= '';
if (empty($upload) || $upload == $std)
{
$uploader .= '';
}
else
{
$uploader .= '';
$uploader .= '';
$uploader .= '';
$uploader .= '';
$uploader .= '';
}
return $uploader;
}
/****A main Fonction deal with a jquery at admin side option setting form.***/
function wf_admin_head() {
?>