Consolidating the customheaderoptions.php and buyprintoptions.php into addonoptions.php

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2010-01-02 14:15:09 -08:00
parent 1616e6de31
commit 436e72740d
4 changed files with 141 additions and 177 deletions

View File

@ -149,29 +149,16 @@ function comicpress_admin() {
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
if ($_REQUEST['action'] == 'comicpress_save_customheader') { if ($_REQUEST['action'] == 'comicpress_save_addons') {
foreach (array(
'enable_custom_image_header'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
foreach (array(
'custom_image_header_width',
'custom_image_header_height'
) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'customheader';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_buyprint') {
foreach (array( foreach (array(
'enable_custom_image_header',
'buy_print_add_shipping' 'buy_print_add_shipping'
) as $key) { ) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
} }
foreach (array( foreach (array(
'custom_image_header_width',
'custom_image_header_height',
'buy_print_email', 'buy_print_email',
'buy_print_url', 'buy_print_url',
'buy_print_us_amount', 'buy_print_us_amount',
@ -181,7 +168,7 @@ function comicpress_admin() {
) as $key) { ) as $key) {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]); $comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
} }
$tab = 'buyprint'; $tab = 'addons';
update_option('comicpress_options',$comicpress_options); update_option('comicpress_options',$comicpress_options);
} }
@ -230,8 +217,7 @@ function comicpress_admin() {
'post' => __('Posts &amp; Pages', 'comicpress'), 'post' => __('Posts &amp; Pages', 'comicpress'),
'archivesearch' => __('Archive &amp; Search', 'comicpress'), 'archivesearch' => __('Archive &amp; Search', 'comicpress'),
'menubar' => __('Menubar', 'comicpress'), 'menubar' => __('Menubar', 'comicpress'),
'customheader' => __('Custom Header', 'comicpress'), 'addons' => __('Add Ons', 'comicpress'),
'buyprint' => __('Buy Print', 'comicpress'),
'config' => __('Configuration', 'comicpress'), 'config' => __('Configuration', 'comicpress'),
); );

135
options/addonoptions.php Normal file
View File

@ -0,0 +1,135 @@
<div id="comicpress-addons">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Custom Header','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_custom_image_header"><?php _e('Use Custom Header','comicpress'); ?></label></th>
<td>
<input id="enable_custom_image_header" name="enable_custom_image_header" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_custom_image_header']); ?> />
</td>
<td>
<?php _e('Adds Custom Header option under Dashboard -> Appearance. Allows you to add your own header image and customize or hide the default text.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="custom_image_header_width"><?php _e('Width','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_width" id="custom_image_header_width" value="<?php echo $comicpress_options['custom_image_header_width']; ?>" /><br />
</td>
<td>
<?php _e('Sets the width of the image you want to use for Custom Header. Defaults widths are 780px or 980px depending on the layout. Refer to the width of the layout you chose and any custom changes you have made to site width in the CSS.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="custom_image_header_height"><?php _e('Height','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_height" id="custom_image_header_height" value="<?php echo $comicpress_options['custom_image_header_height']; ?>" />
</td>
<td>
<?php _e('Sets the height of the image you want to use for Custom Header. Recommended maximum height is 120px, but if your logo/image demands it you can set it higher.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Print','comicpress'); ?></th>
</tr>
</thead>
<tr>
<th scope="row" colspan="2">
<label for="buy_print_email"><?php _e('Paypal email address','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_email" id="buy_print_email" value="<?php echo $comicpress_options['buy_print_email']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, you do not want other people getting your money.','comicpress'); ?></span><br />
<?php _e('The Email address you registered with Paypal and that your store is associated with.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"colspan="2">
<label for="buy_print_url"><?php _e('URL of the template page','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_url" id="buy_print_url" value="<?php echo $comicpress_options['buy_print_url']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, the form needs some place to go.','comicpress'); ?></span><br />
<?php _e('The URL address to which you associated the buy print template.','comicpress'); ?><br />
<em>
<?php _e('Examples:','comicpress'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
"/?p=233",
"/shop/".
</em>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_add_shipping"><?php _e('Add shipping to each item','comicpress'); ?></label></th>
<td>
<input id="buy_print_add_shipping" name="buy_print_add_shipping" type="checkbox" value="1" <?php checked(true, $comicpress_options['buy_print_add_shipping']); ?> />
</td>
<td>
<?php _e('Enabling this option will make it so that shipping costs will be added to each item purchased.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_us_amount"><?php _e('Print Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_amount" id="buy_print_us_amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people in the United States and Canada?','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_us_ship"><?php _e('Shipping Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_ship" id="buy_print_us_ship" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>" />
</td>
<td>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_int_amount"><?php _e('Print Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_amount" id="buy_print_int_amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people *NOT* in the United States and Canada (International)','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_int_ship"><?php _e('Shipping Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_ship" id="buy_print_int_ship" value="<?php echo $comicpress_options['buy_print_int_ship']; ?>" />
</td>
<td/>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_customheader" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_addons" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,100 +0,0 @@
<div id="comicpress-buyprint">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Buy Print','comicpress'); ?></th>
</tr>
</thead>
<tr>
<th scope="row" colspan="2">
<label for="buy_print_email"><?php _e('Paypal email address','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_email" id="buy_print_email" value="<?php echo $comicpress_options['buy_print_email']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, you do not want other people getting your money.','comicpress'); ?></span><br />
<?php _e('The Email address you registered with Paypal and that your store is associated with.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"colspan="2">
<label for="buy_print_url"><?php _e('URL of the template page','comicpress'); ?></label>
<input type="text" size="25" name="buy_print_url" id="buy_print_url" value="<?php echo $comicpress_options['buy_print_url']; ?>" />
</th>
<td>
<span style="color: #d54e21;"><?php _e('* This must be correct, the form needs some place to go.','comicpress'); ?></span><br />
<?php _e('The URL address to which you associated the buy print template.','comicpress'); ?><br />
<em>
<?php _e('Examples:','comicpress'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
"/?p=233",
"/shop/".
</em>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_add_shipping"><?php _e('Add shipping to each item','comicpress'); ?></label></th>
<td>
<input id="buy_print_add_shipping" name="buy_print_add_shipping" type="checkbox" value="1" <?php checked(true, $comicpress_options['buy_print_add_shipping']); ?> />
</td>
<td>
<?php _e('Enabling this option will make it so that shipping costs will be added to each item purchased.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_us_amount"><?php _e('Print Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_amount" id="buy_print_us_amount" value="<?php echo $comicpress_options['buy_print_us_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people in the United States and Canada?','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_us_ship"><?php _e('Shipping Cost (US/Canada)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_us_ship" id="buy_print_us_ship" value="<?php echo $comicpress_options['buy_print_us_ship']; ?>" />
</td>
<td>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_int_amount"><?php _e('Print Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_amount" id="buy_print_int_amount" value="<?php echo $comicpress_options['buy_print_int_amount']; ?>" />
</td>
<td>
<?php _e('How much does a print cost for people *NOT* in the United States and Canada (International)','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="buy_print_int_ship"><?php _e('Shipping Cost (International)','comicpress'); ?></label></th>
<td>
<input type="text" size="7" name="buy_print_int_ship" id="buy_print_int_ship" value="<?php echo $comicpress_options['buy_print_int_ship']; ?>" />
</td>
<td/>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_buyprint" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_buyprint" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,57 +0,0 @@
<div id="comicpress-customheader">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="3"><?php _e('Custom Header','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row"><label for="enable_custom_image_header"><?php _e('Use Custom Header','comicpress'); ?></label></th>
<td>
<input id="enable_custom_image_header" name="enable_custom_image_header" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_custom_image_header']); ?> />
</td>
<td>
<?php _e('Adds Custom Header option under Dashboard -> Appearance. Allows you to add your own header image and customize or hide the default text.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="custom_image_header_width"><?php _e('Width','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_width" id="custom_image_header_width" value="<?php echo $comicpress_options['custom_image_header_width']; ?>" /><br />
</td>
<td>
<?php _e('Sets the width of the image you want to use for Custom Header. Defaults widths are 780px or 980px depending on the layout. Refer to the width of the layout you chose and any custom changes you have made to site width in the CSS.','comicpress'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="custom_image_header_height"><?php _e('Height','comicpress'); ?></label></th>
<td>
<input type="text" size="5" name="custom_image_header_height" id="custom_image_header_height" value="<?php echo $comicpress_options['custom_image_header_height']; ?>" />
</td>
<td>
<?php _e('Sets the height of the image you want to use for Custom Header. Recommended maximum height is 120px, but if your logo/image demands it you can set it higher.','comicpress'); ?>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
<input name="comicpress_save_customheader" type="submit" class="button-primary" value="Save Settings" />
<input type="hidden" name="action" value="comicpress_save_customheader" />
</div>
<div class="clear"></div>
</div>
</div>
</form>
</div>