'.__("Twenty Ten Weaver main options saved.",TTW_TRANS).'

'; foreach ($ttw_options as $value) { /* only reset main options so use $ttw_options */ $id = $value['id']; if ($value['type'] == "admincheckbox") { // special case for a few admin options if (isset($_POST[$id])) ttw_setadminopt($id, $_POST[$id]); else ttw_deleteadminopt($id); } else { if( isset( $_POST[ $id ] ) ) { $v = $_POST[$id]; ttw_setopt( $id, $v ); } else { ttw_defaultopt( $id ); } } } ttw_saveopts(); } if (isset($_POST['saveadvanced'])) { echo '

'.__("Twenty Ten Weaver advanced options saved.",TTW_TRANS).'

'; // THEME OPTS - advanced theme opts ttw_post_opt('ttw_head_opts'); ttw_post_opt('ttw_theme_head_opts'); ttw_post_opt('ttw_footer_opts'); ttw_post_opt('ttw_header_insert'); ttw_post_opt('ttw_header_frontpage_only'); // ADMIN OPTS - per site tags - not theme related ttw_post_adminopt('ttw_hide_preview'); ttw_post_adminopt('ttw_hide_theme_thumbs'); ttw_post_adminopt('ttw_hide_metainfo'); ttw_post_adminopt('ttw_metainfo'); ttw_post_adminopt('ttw_end_opts'); // NOW, save everything ttw_saveopts(); } if (isset($_POST['setsubtheme']) || isset($_POST['setsubtheme2'])) { /* seems like Mozilla doesn't like 2 sets of select inputs on same page, so we make up 2 ids/names to use */ if (isset($_POST['setsubtheme'])) $pID = 'ttw_subtheme'; else $pID = 'ttw_subtheme2'; $cur_subtheme = $_POST[ $pID]; /* must have been set to get here */ if ($cur_subtheme == '') $cur_subtheme = TTW_DEFAULT_THEME; /* but just in case */ /* now, i set all values for theme */ st_set_subtheme($cur_subtheme); $t = ttw_getopt('ttw_subtheme'); if ($t == '') $t = TTW_DEFAULT_THEME; /* did we save a theme? */ echo '

'.__("Twenty Ten Weaver options reset to sub-theme: ",TTW_TRANS).$t. '.

'; } if (isset($_POST['changethemename'])) { if (isset($_POST['newthemename'])) { $new_name = sanitize_user($_POST['newthemename']); ttw_setopt('ttw_themename',$new_name); echo '

Theme name changed to '.$new_name.'

'; } } if (isset($_POST['savemytheme'])) { ttw_savemytheme(); echo '

'.__('All current main and advanced options saved in My Saved Theme.',TTW_TRANS).'

'; } if (isset($_POST['filesavetheme'])) { $base = strtolower(sanitize_file_name($_POST['savethemename'])); $temp_url = ttw_write_current_theme($base); if ($temp_url == '') echo '

Invalid name supplied to save theme to file.

'; else echo '

'.__("All current main and advanced options saved in $temp_url.",TTW_TRANS).'

'; } if (isset($_POST['uploadit']) && $_POST['uploadit'] == 'yes') { // don't know if need 2nd test or not... ttw_uploadit(); } if (isset($_POST['uploadthemeurl'])) { // url method $filename = esc_url($_POST['ttw_uploadname'] ); if (ttw_upload_theme($filename)) { $t = ttw_getopt('ttw_subtheme'); if ($t == '') $t = TTW_DEFAULT_THEME; /* did we save a theme? */ echo '

'.__("Twenty Ten Weaver theme options reset to uploaded theme, saved as: ",TTW_TRANS).$t. '.

'; } else { echo ('

'. __('INVALID THEME URL PROVIDED - Try Again',TTW_TRANS).'

'); } } if (isset($_POST['restoretheme'])) { $wpdir = wp_upload_dir(); $fn = $wpdir['basedir'].'/weaver-subthemes/'.$_POST['ttw_restorename']; if (ttw_upload_theme($fn )) { $t = ttw_getopt('ttw_subtheme'); if ($t == '') $t = TTW_DEFAULT_THEME; /* did we save a theme? */ echo '

'.__("Twenty Ten Weaver theme restored from file, saved as: ",TTW_TRANS).$t. '.

'; } else { echo ('

'. __('INVALID FILE NAME PROVIDED - Try Again',TTW_TRANS).'

'); } } if (isset($_POST['deletetheme'])) { $myFile = $_POST['selectName']; if ($myFile != "None") { $wpdir = wp_upload_dir(); unlink($wpdir['basedir'].'/weaver-subthemes/'.$myFile); echo '

File: '.$myFile.' has been deleted.

'; } } if (isset($_POST['ttw_save_extension'])) { /* for theme extensions */ do_action('ttwx_save_extension'); } ?>

Options

', '
'); /* extended option admin tab */ ?>

Preview of site. Displays current look after you save options or select sub-theme.

Site Preview Disabled\n"); } ?> "; $ok = false; } if ($ok && $ext_check != 'wvr'){ $errors[] = "Theme files must have .wvr extension.
"; $ok = false; } if ($ok) { $handle = fopen($openname,'r'); // now try to open the uploaded file if (!$handle) { $errors[] = ''. __('Sorry, there was a problem uploading your file. You may need to check your folder permissions or other server settings.',TTW_TRANS).''. "
(Trying to use file '$openname')"; $ok = false; } } if (!$ok) { echo '

ERROR

'; foreach($errors as $error){ echo $error.'
'; } echo '

'; } else { // OK - read file and save to My Saved Theme // $handle has file handle to temp file. $contents = null; while ( !feof($handle) ) { $contents .= fread($handle, 1024); } fclose($handle); if (!ttw_save_serialized_theme($contents)) { echo '

'. __('Sorry, there was a problem uploading your file. The file you picked was not a valid Weaver theme file.',TTW_TRANS).'

'; } else { $t = ttw_getopt('ttw_subtheme'); if ($t == '') $t = TTW_DEFAULT_THEME; /* did we save a theme? */ echo '

'.__("Twenty Ten Weaver theme options reset to uploaded theme, saved as: ",TTW_TRANS).$t. '.

'; } } } function ttw_post_adminopt($optname) { if (isset($_POST[$optname])) ttw_setadminopt($optname, $_POST[$optname]); else ttw_deleteadminopt($optname); } function ttw_post_opt($optname) { if (isset($_POST[$optname])) ttw_setopt($optname, $_POST[$optname]); else ttw_deleteopt($optname); } function ttw_options_admin() { /* theme admin page - Main Options tab */ global $ttw_options; global $theme_options; ?>

Main Options

Main color and appearance options

Note: color value boxes also allow text such as blue, inherit , transparent, etc. The values are not checked if they are valid color attributes."; } function mytheme_put_form($ttw_options_list, $actname, $flabel, $showFirstInput) { /* output a list of options - this really does the layout for the options defined in an array */ echo '
' ."\n"; if ($showFirstInput) { /* maybe show extra submit button at top */ echo("

\n"); } foreach ($ttw_options_list as $value) { if ($value['type'] == "text") { ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?> '); echo $value['info']; echo(""); } ?>  "); } ?>
" />
" />
" />
>
>
'.$value['name'].''; ?> '); echo $value['info']; echo("