clean up JS on options page, fixes GH#29

This commit is contained in:
John Bintz 2010-01-02 15:18:43 -05:00
parent 71c30e3008
commit 3568dbaef2
12 changed files with 239 additions and 238 deletions

View File

@ -1,47 +1,51 @@
<?php
function options() {
$pagehook = add_submenu_page('themes.php','comicpress', __('ComicPress Options','comicpress'), 10, 'comicpress-options', 'comicpress_admin');
add_action('admin_head-'.$pagehook, 'comicpress_admin_page_head');
function comicpress_options_setup() {
$pagehook = add_submenu_page('themes.php',__('ComicPress Options', 'comicpress'), __('ComicPress Options','comicpress'), 10, 'comicpress-options', 'comicpress_admin');
add_action('admin_head-' . $pagehook, 'comicpress_admin_page_head');
add_action('admin_print_scripts-' . $pagehook, 'comicpress_admin_print_scripts');
add_action('admin_print_styles-' . $pagehook, 'comicpress_admin_print_styles');
}
function comicpress_admin_page_head() {
wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
wp_admin_css( 'css/ie' );
function comicpress_admin_print_scripts() {
wp_enqueue_script('utils');
?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/options/options.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/tabbed_pages.js"></script>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]-->
wp_enqueue_script('jquery');
}
function comicpress_admin_print_styles() {
wp_admin_css('css/global');
wp_admin_css('css/colors');
wp_admin_css('css/ie');
wp_enqueue_style('comicpress-options', get_template_directory_uri() . '/options/options.css');
}
function comicpress_admin_page_head() { ?>
<!--[if lt ie 8]> <style> div.show { position: static; margin-top: 1px; } #cpadmin div.off { height: 22px; } </style> <![endif]-->
<?php }
function comicpress_admin() {
global $upload_path, $blogcat;
$comicpress_options = get_option('comicpress_options');
$comicpress_options = get_option('comicpress_options');
?>
<div class="wrap">
<div id="cpadmin-headericon" style="background: url('<?php echo get_template_directory_uri(); ?>/images/options/comicpress_icon.png') no-repeat;"></div>
<h2 class="alignleft"><?php _e('ComicPress Options','comicpress'); ?></h2>
<div class="clear"></div>
<?php
<?php
$tab = '';
if ( wp_verify_nonce($_POST['_wpnonce'], 'update-options') ) {
if ($_REQUEST['action'] == 'comicpress_save_layout') {
$comicpress_options['cp_theme_layout'] = wp_filter_nohtml_kses($_REQUEST['cp_theme_layout']);
$tab = 'themestyle';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_general') {
foreach (array(
'disable_page_restraints',
'disable_page_restraints',
'rascal_says',
'disable_comment_note',
'enable_numbered_pagination',
@ -68,7 +72,7 @@ function comicpress_admin() {
$tab = 'general';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_index') {
foreach (array(
'disable_comic_frontpage',
@ -80,9 +84,9 @@ function comicpress_admin() {
}
$comicpress_options['blog_postcount'] = wp_filter_nohtml_kses($_REQUEST['blog_postcount']);
$tab = 'index';
update_option('comicpress_options',$comicpress_options);
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_post') {
foreach (array(
'transcript_in_posts',
@ -112,9 +116,9 @@ function comicpress_admin() {
$comicpress_options[$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
$tab = 'post';
update_option('comicpress_options',$comicpress_options);
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_archivesearch') {
foreach (array(
'archive_display_order',
@ -127,7 +131,7 @@ function comicpress_admin() {
$tab = 'archivesearch';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_menubar') {
foreach (array(
'enable_search_in_menubar',
@ -139,11 +143,11 @@ function comicpress_admin() {
'enable_blogroll_off_links'
) as $key) {
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
}
}
$tab = 'menubar';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_customheader') {
foreach (array(
'enable_custom_image_header'
@ -159,7 +163,7 @@ function comicpress_admin() {
$tab = 'customheader';
update_option('comicpress_options',$comicpress_options);
}
if ($_REQUEST['action'] == 'comicpress_save_buyprint') {
foreach (array(
'buy_print_add_shipping'
@ -181,7 +185,7 @@ function comicpress_admin() {
}
if ($_REQUEST['action'] == 'comicpress_save_config') {
foreach (array(
'comiccat',
'blogcat',
@ -198,51 +202,76 @@ function comicpress_admin() {
$tab = 'config';
update_option('comicpress_options',$comicpress_options);
}
if ($tab) {
?>
<div id="message" class="updated"><p><strong><?php _e('ComicPress Settings SAVED!','comicpress'); ?></strong></p></div>
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
<?php }
<?php }
}
if ($_REQUEST['action'] == 'comicpress_reset') {
delete_option('comicpress_options');
$comicpress_options = comicpress_load_options();
?>
<div id="message" class="updated"><p><strong><?php _e('ComicPress Settings RESET!','comicpress'); ?></strong></p></div>
<script>function hidemessage() { document.getElementById('message').style.display = 'none'; }</script>
<?php
}
?>
<div id="poststuff" class="metabox-holder">
<div id="cpadmin">
<?php
$tab_info = array(
'themestyle' => __('Layout', 'comicpress'),
'general' => __('General', 'comicpress'),
'index' => __('Home Page', 'comicpress'),
'post' => __('Posts &amp; Pages', 'comicpress'),
'archivesearch' => __('Archive &amp; Search', 'comicpress'),
'menubar' => __('Menubar', 'comicpress'),
'customheader' => __('Custom Header', 'comicpress'),
'buyprint' => __('Buy Print', 'comicpress'),
'config' => __('Configuration', 'comicpress'),
);
<div id="cpadmin" onclick="hidemessage();">
<div class="<?php if ($tab == 'themestyle' || empty($tab)) { ?>on<?php } else { ?>off<?php } ?>" title="themestyle"><span><?php _e('Layout','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'general') { ?>on<?php } else { ?>off<?php } ?>" title="generaloptions"><span><?php _e('General','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'index') { ?>on<?php } else { ?>off<?php } ?>" title="indexoptions"><span><?php _e('Home Page','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'post') { ?>on<?php } else { ?>off<?php } ?>" title="postoptions"><span><?php _e('Posts &amp; Pages','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'archivesearch') { ?>on<?php } else { ?>off<?php } ?>" title="archivesearch"><span><?php _e('Archive &amp; Search','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'menubar') { ?>on<?php } else { ?>off<?php } ?>" title="menubaroptions"><span><?php _e('Menubar','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'customheader') { ?>on<?php } else { ?>off<?php } ?>" title="customheader"><span><?php _e('Custom Header','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'buyprint') { ?>on<?php } else { ?>off<?php } ?>" title="buyprintoptions"><span><?php _e('Buy Print','comicpress'); ?></span></div>
<div class="<?php if ($tab == 'config') { ?>on<?php } else { ?>off<?php } ?>" title="configoptions"><span><?php _e('Configuration','comicpress'); ?></span></div>
if (empty($tab)) { $tab = array_shift(array_keys($tab_info)); }
foreach($tab_info as $tab_id => $label) { ?>
<div id="comicpress-tab-<?php echo $tab_id ?>" class="comicpress-tab <?php echo ($tab == $tab_id) ? 'on' : 'off'; ?>"><span><?php echo $label; ?></span></div>
<?php }
?>
</div>
<div id="comicpress-options-pages">
<?php foreach (glob(get_template_directory() . '/options/*.php') as $file) { include($file); } ?>
</div>
<?php
foreach (glob(get_template_directory() . '/options/*.php') as $file) {
include($file);
}
?>
</div>
<script type="text/javascript">
(function($) {
var showPage = function(which) {
$('#comicpress-options-pages > div').each(function(i) {
$(this)[(this.id == 'comicpress-' + which) ? 'show' : 'hide']();
});
};
$('.comicpress-tab').click(function() {
$('#message').animate({height:"0", opacity:0, margin: 0}, 100, 'swing', function() { $(this).remove() });
showPage(this.id.replace('comicpress-tab-', ''));
var myThis = this;
$('.comicpress-tab').each(function() {
var isSame = (this == myThis);
$(this).toggleClass('on', isSame).toggleClass('off', !isSame);
});
return false;
});
showPage('<?php echo esc_js($tab) ?>');
}(jQuery));
</script>
</div>
<?php
<?php
}
add_action('admin_menu', 'options');
?>
add_action('admin_menu', 'comicpress_options_setup');

View File

@ -1,28 +0,0 @@
/* ================================================================
This copyright notice must be untouched at all times.
The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/various/tabbed_pages.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */
onload = function() {
var e, i = 0;
while (e = document.getElementById('cpadmin').getElementsByTagName ('DIV') [i++]) {
if (e.className == 'on' || e.className == 'off') {
e.onclick = function () {
var getEls = document.getElementsByTagName('DIV');
for (var z=0; z<getEls.length; z++) {
getEls[z].className=getEls[z].className.replace('show', 'hide');
getEls[z].className=getEls[z].className.replace('on', 'off');
}
this.className = 'on';
var max = this.getAttribute('title');
document.getElementById(max).className = "show";
}
}
}
}

View File

@ -1,4 +1,4 @@
<div id="archivesearch" class="<?php if ($tab == 'archivesearch') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-archivesearch">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
@ -59,9 +59,9 @@
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -71,7 +71,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>
</div>

View File

@ -1,10 +1,10 @@
<div id="buyprintoptions" class="<?php if ($tab == 'buyprint') { ?>show<?php } else { ?>hide<?php } ?>">
<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>
@ -30,12 +30,12 @@
<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'); ?>
<?php _e('Examples:','comicpress'); ?>
"http://yourdomain.com/?p=233",
"http://yourdomain.com/shop/",
"/?p=233",
"/shop/".
</em>
</em>
</td>
</tr>
<tr>
@ -63,7 +63,7 @@
</td>
<td>
</td>
</tr>
</tr>
<tr class="alternate">
<th scope="row"><label for="buy_print_int_amount"><?php _e('Print Cost (International)','comicpress'); ?></label></th>
<td>
@ -72,7 +72,7 @@
<td>
<?php _e('How much does a print cost for people *NOT* in the United States and Canada (International)','comicpress'); ?>
</td>
</tr>
</tr>
<tr>
<th scope="row"><label for="buy_print_int_ship"><?php _e('Shipping Cost (International)','comicpress'); ?></label></th>
<td>
@ -82,9 +82,9 @@
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -94,7 +94,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div id="configoptions" class="<?php if ($tab == 'config') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-config">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
@ -6,19 +6,19 @@
<div id="comicpress-options">
<table class="widefat">
<thead>
<tr>
<th colspan="5"><?php _e('Configuration','comicpress'); ?></th>
</tr>
</thead>
<tr class="alternate">
<th scope="row">
<label for="comiccat"><?php _e('Comic Category','comicpress'); ?></label>
<?php
<?php
$comiccat = $comicpress_options['comicpress_config']['comiccat'];
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$comiccat);
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$comiccat);
$select = preg_replace('#<select([^>]*)>#', '<select name="comiccat" id="comicccat">', $select);
echo $select;
?>
@ -27,13 +27,13 @@
<?php _e('The category that is designated for the primary comic category.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row">
<label for="comiccat"><?php _e('Blog Category','comicpress'); ?></label>
<?php
<?php
$blogcat = $comicpress_options['comicpress_config']['blogcat'];
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$blogcat);
$select = wp_dropdown_categories('show_option_all=Select category&hide_empty=0&show_count=0&orderby=name&echo=0&selected='.$blogcat);
$select = preg_replace('#<select([^>]*)>#', '<select name="blogcat" id="blogcat">', $select);
echo $select;
?>
@ -42,97 +42,97 @@
<?php _e('The primary blog category.','comicpress'); ?>
</td>
</tr>
<?php
<?php
$dirs_to_search = array_unique(array(ABSPATH));
$directories = array();
foreach ($dirs_to_search as $dir) { $directories = array_merge($directories,glob("${dir}/*")); }
$current_directory = $comicpress_options['comicpress_config']['comic_folder'];
?>
?>
<tr class="alternate">
<th scope="row"><label for="comic_folder"><?php _e('Comic Folder','comicpress'); ?></label>
<th scope="row"><label for="comic_folder"><?php _e('Comic Folder','comicpress'); ?></label>
<select name="comic_folder" id="comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the original sized comics from.','comicpress'); ?>
</td>
</tr>
<?php
<?php
$current_directory = $comicpress_options['comicpress_config']['rss_comic_folder'];
?>
?>
<tr>
<th scope="row"><label for="rss_comic_folder"><?php _e('RSS Thumbnail Folder','comicpress'); ?></label>
<th scope="row"><label for="rss_comic_folder"><?php _e('RSS Thumbnail Folder','comicpress'); ?></label>
<select name="rss_comic_folder" id="rss_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the RSS thumbnails from.','comicpress'); ?>
</td>
</tr>
</tr>
<?php
<?php
$current_directory = $comicpress_options['comicpress_config']['archive_comic_folder'];
?>
?>
<tr class="alternate">
<th scope="row"><label for="archive_comic_folder"><?php _e('Archive Thumbnail Folder','comicpress'); ?></label>
<th scope="row"><label for="archive_comic_folder"><?php _e('Archive Thumbnail Folder','comicpress'); ?></label>
<select name="archive_comic_folder" id="archive_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the ARCHIVE/SEARCH thumbnails from.','comicpress'); ?>
</td>
</tr>
<?php
<?php
$current_directory = $comicpress_options['comicpress_config']['mini_comic_folder'];
?>
?>
<tr>
<th scope="row"><label for="mini_comic_folder"><?php _e('Mini Thumbnail Folder','comicpress'); ?></label>
<th scope="row"><label for="mini_comic_folder"><?php _e('Mini Thumbnail Folder','comicpress'); ?></label>
<select name="mini_comic_folder" id="mini_comic_folder">
<?php
foreach ($directories as $dirs) {
if (is_dir($dirs)) {
if (is_dir($dirs)) {
$dir_name = basename($dirs); ?>
<option class="level-0" value="<?php echo $dir_name; ?>" <?php if ($current_directory == $dir_name) { ?>selected="selected"<?php } ?>><?php echo $dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the MINI thumbnails from. (for archive-comic-list, etc.)','comicpress'); ?>
@ -147,7 +147,7 @@
<td/>
</td>
</tr>
<tr>
<th scope="row"><label for="archive_comic_width"><?php _e('ARCHIVE Thumbnail Width','comicpress'); ?></label></th>
<td>
@ -156,7 +156,7 @@
<td/>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="mini_comic_width"><?php _e('MINI Thumbnail Width','comicpress'); ?></label></th>
<td>

View File

@ -1,10 +1,10 @@
<div id="customheader" class="<?php if ($tab == 'customheader') { ?>show<?php } else { ?>hide<?php } ?>">
<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>
@ -39,9 +39,9 @@
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -51,7 +51,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,8 +1,8 @@
<div id="generaloptions" class="<?php if ($tab == 'general') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-general">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat">
@ -41,7 +41,7 @@
<tr>
<th scope="row"><label for="disable_blogheader"><?php _e('Disable blog header','comicpress'); ?></label></th>
<td>
<input id="disable_blogheader" name="disable_blogheader" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blogheader']); ?> />
<input id="disable_blogheader" name="disable_blogheader" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blogheader']); ?> />
</td>
<td>
<?php _e('Checkmark this and your site will not display the contents of #blogheader.','comicpress'); ?>
@ -50,14 +50,14 @@
<tr class="alternate">
<th scope="row"><label for="enable_comment_count_in_rss"><?php _e('Enable the comment count to show in feed title.','comicpress'); ?></label></th>
<td>
<input id="enable_comment_count_in_rss" name="enable_comment_count_in_rss" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comment_count_in_rss']); ?> />
<input id="enable_comment_count_in_rss" name="enable_comment_count_in_rss" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comment_count_in_rss']); ?> />
</td>
<td>
<?php _e('Will show how many comments there are in the title of the post in the feed.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -91,34 +91,34 @@
<?php _e('The default comic post navigation is above each comic blog post.','comicpress'); ?>
</td>
</tr>
<?php
<?php
$current_gnav_directory = $comicpress_options['graphicnav_directory'];
if (empty($current_gnav_directory)) $current_gnav_directory = 'default';
$dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory()));
$gnav_directories = array();
foreach ($dirs_to_search as $dir) { $gnav_directories = array_merge($gnav_directories,glob("${dir}/images/nav/*")); }
?>
?>
<tr>
<th scope="row" colspan="2"><label for="graphicnav_directory"><?php _e('Graphic Navigation Directory','comicpress'); ?></label>
<th scope="row" colspan="2"><label for="graphicnav_directory"><?php _e('Graphic Navigation Directory','comicpress'); ?></label>
<select name="graphicnav_directory" id="graphicnav_directory">
<?php
foreach ($gnav_directories as $gnav_dirs) {
if (is_dir($gnav_dirs)) {
if (is_dir($gnav_dirs)) {
$gnav_dir_name = basename($gnav_dirs); ?>
<option class="level-0" value="<?php echo $gnav_dir_name; ?>" <?php if ($current_gnav_directory == $gnav_dir_name) { ?>selected="selected"<?php } ?>><?php echo $gnav_dir_name; ?></option>
<?php }
}
?>
</select>
</th>
<td>
<?php _e('Choose a directory to get the graphic navigation styling from. To create your own custom graphic navigation menu buttons just create a directory under <i>images/nav/</i> and place your image files inside of it and create a navstyle.css file to determine the style of your navigation display.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -142,9 +142,9 @@
<td>
<?php _e('Your home page will not display the default left/right sidebars. Minimalists dream. WARNING: Not recommended for use with Graphic Novel layouts.','comicpress'); ?>
</td>
</tr>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -163,14 +163,14 @@
<tr>
<th scope="row"><label for="enable_scroll_to_top"><?php _e('Enable the scroll to top link in the footer?','comicpress'); ?></label></th>
<td>
<input id="enable_scroll_to_top" name="enable_scroll_to_top" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_scroll_to_top']); ?> />
<input id="enable_scroll_to_top" name="enable_scroll_to_top" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_scroll_to_top']); ?> />
</td>
<td>
<?php _e('When this link is clicked on long pages it will scroll back to the top.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -180,8 +180,8 @@
<tr class="alternate">
<th scope="row">
<label for="members_post_category"><?php _e('Members category','comicpress'); ?></label>
<?php
$select = wp_dropdown_categories('show_option_none=Select category&show_count=0&orderby=name&echo=0&selected='.$comicpress_options['members_post_category']);
<?php
$select = wp_dropdown_categories('show_option_none=Select category&show_count=0&orderby=name&echo=0&selected='.$comicpress_options['members_post_category']);
$select = preg_replace('#<select([^>]*)>#', '<select name="members_post_category" id="members_post_category">', $select);
echo $select;
?>
@ -199,8 +199,8 @@
<p><?php _e('This will make it so that that category is only seen as blogposts inside that area and not anywhere else on the site unless the user has the members flag.','comicpress'); ?></p>
</td>
</tr>
</table>
</table>
<table class="widefat">
<thead>
<tr>
@ -226,7 +226,7 @@
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
@ -238,8 +238,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,10 +1,10 @@
<div id="indexoptions" class="<?php if ($tab == 'index') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-index">
<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>
@ -14,7 +14,7 @@
<tr class="alternate">
<th scope="row"><label for="disable_blog_frontpage"><?php _e('Disable the blog on the Home page','comicpress'); ?></label></th>
<td>
<input id="disable_blog_frontpage" name="disable_blog_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blog_frontpage']); ?> />
<input id="disable_blog_frontpage" name="disable_blog_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_blog_frontpage']); ?> />
</td>
<td>
<?php _e('Checkmark this and the blog will not display on the Home page of your site. The features allows to either not have a blog at all, or, if you place a menu link to your blog page, you can maintain your blog within the same site without readers having to see it when they are just trying to read your comic.','comicpress'); ?>
@ -40,7 +40,7 @@
<tr class="alternate">
<th scope="row"><label for="disable_comic_frontpage"><?php _e('Disable comic on Home page','comicpress'); ?></label></th>
<td>
<input id="disable_comic_frontpage" name="disable_comic_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_frontpage']); ?> />
<input id="disable_comic_frontpage" name="disable_comic_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_frontpage']); ?> />
</td>
<td>
<?php _e('Checkmark this and the comic will not display on the home page of your site. You can use the Latest Thumbnail widget to display your comic in a sidebar. Make sure you set the archive-thumbnail size to under 200px. Note: Turning this off and using the Graphic Novel style turns ComicPress into a blog only.','comicpress'); ?>
@ -49,7 +49,7 @@
<tr>
<th scope="row"><label for="disable_comic_blog_frontpage"><?php _e('Disable the comic blog on Home page','comicpress'); ?></label></th>
<td>
<input id="disable_comic_blog_frontpage" name="disable_comic_blog_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_frontpage']); ?> />
<input id="disable_comic_blog_frontpage" name="disable_comic_blog_frontpage" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_frontpage']); ?> />
</td>
<td>
<?php _e('Checkmark this and the comic blog will not display on the Home Page. Enabling this allows you to either not have a comic blog at all, or you can place it where you want using the comic blog post widget. If there is no content in the post it will not display regardless.','comicpress'); ?>
@ -58,16 +58,16 @@
<tr class="alternate">
<th scope="row"><label for="disable_comic_blog_single"><?php _e('Disable the comic blog on the single pages','comicpress'); ?></lable></th>
<td>
<input id="disable_comic_blog_single" name="disable_comic_blog_single" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_single']); ?> />
<input id="disable_comic_blog_single" name="disable_comic_blog_single" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_comic_blog_single']); ?> />
</td>
<td>
<?php _e('Checkmark this and the blog portion of the comic will not display on the single/archive pages of your site.','comicpress'); ?>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -77,7 +77,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
<div id="menubaroptions" class="<?php if ($tab == 'menubar') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-menubar">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
@ -19,7 +19,7 @@
<td>
<?php _e('Allows you to customize the location of the Menubar via Widgets.','comicpress'); ?>
</td>
</tr>
</tr>
<tr>
<th scope="row"><label for="enable_search_in_menubar"><?php _e('Enable Search Form','comicpress'); ?></label></th>
<td>
@ -28,7 +28,7 @@
<td>
<?php _e('Searchforms can be fun when you have something to search for.','comicpress'); ?>
</td>
</tr>
</tr>
<tr class="alternate">
<th scope="row"><label for="enable_rss_in_menubar"><?php _e('Enable RSS Link','comicpress'); ?></label></th>
<td>
@ -37,7 +37,7 @@
<td>
<?php _e('Adds an RSS link icon to your menubar on the right side.','comicpress'); ?>
</td>
</tr>
</tr>
<tr>
<th scope="row"><label for="enable_navigation_in_menubar"><?php _e('Enable mini navigation','comicpress'); ?></label></th>
<td>
@ -46,7 +46,7 @@
<td>
<?php _e('Mini Navigation adds small previous and next arrows arrow to the right side of your Menubar.','comicpress'); ?>
</td>
</tr>
</tr>
<tr class="alternate">
<th scope="row"><label for="contact_in_menubar"><?php _e('Enable Contact/custom links','comicpress'); ?></label></th>
<td>
@ -55,7 +55,7 @@
<td>
<?php _e('Adds a Contact button to the Menubar associated with your admin email. You can also create a links category called <i>Menubar</i> and whatever links you add to that will appear in the Menubar.','comicpress'); ?>
</td>
</tr>
</tr>
<tr>
<th scope="row"><label for="disable_dynamic_menubar_links"><?php _e('Disable auto-generated WordPress links','comicpress'); ?></label></th>
<td>
@ -75,7 +75,7 @@
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
@ -87,7 +87,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>
</div>

View File

@ -11,6 +11,7 @@
padding: 5px 0 0 0;
line-height: 5px;
margin: 0 0 -1px 0;
overflow: hidden
}
#cpadmin div {
@ -192,8 +193,8 @@ width: auto;
#comicpress-version-title a {
color: #333;
}
#comicpress-version-number {
#comicpress-version-number {
font-family: monospace;
font-size: 16px;
letter-spacing: 8px;

View File

@ -1,10 +1,10 @@
<div id="postoptions" class="<?php if ($tab == 'post') { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-post">
<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>
@ -14,7 +14,7 @@
<tr class="alternate">
<th scope="row"><label for="transcript_in_posts"><?php _e('Show transcript in post area','comicpress'); ?></label></th>
<td>
<input id="transcript_in_posts" name="transcript_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['transcript_in_posts']); ?> />
<input id="transcript_in_posts" name="transcript_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['transcript_in_posts']); ?> />
</td>
<td>
<?php _e('When enabled, if the comic has a transcript, the transcript will be displayed inside the comic post. The transcript is text that that you can have of the dialog in your comic.','comicpress'); ?>
@ -23,7 +23,7 @@
<tr>
<th scope="row"><label for="enable_related_comics"><?php _e('Put Related Comics in comic posts','comicpress'); ?></label></th>
<td>
<input id="enable_related_comics" name="enable_related_comics" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_related_comics']); ?> />
<input id="enable_related_comics" name="enable_related_comics" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_related_comics']); ?> />
</td>
<td>
<?php _e('Comics will be related by "tags" that you create for each comic post. When creating tags for your comics, include *only* the subject material and possibly cast. Do not use tags that can relate to the entire archive or storyline the post is in.','comicpress'); ?>
@ -32,7 +32,7 @@
<tr class="alternate">
<th scope="row"><label for="enable_related_posts"><?php _e('Put Related Posts in blog posts','comicpress'); ?></label></th>
<td>
<input id="enable_related_posts" name="enable_related_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_related_posts']); ?> />
<input id="enable_related_posts" name="enable_related_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_related_posts']); ?> />
</td>
<td>
<?php _e('Blog posts will be related by "tags" that you create for each blog post. Like the related posts for comics, the related posts for blog post checks with other blog posts comparing the tags. Try to only use 1-5 tags total; the less the better.','comicpress'); ?>
@ -41,14 +41,14 @@
<tr>
<th scope="row"><label for="remove_wptexturize"><?php _e('Disable WordPress default content formatting','comicpress'); ?></label></th>
<td>
<input id="remove_wptexturize" name="remove_wptexturize" type="checkbox" value="1" <?php checked(true, $comicpress_options['remove_wptexturize']); ?> />
<input id="remove_wptexturize" name="remove_wptexturize" type="checkbox" value="1" <?php checked(true, $comicpress_options['remove_wptexturize']); ?> />
</td>
<td>
<?php _e('Prevents WordPress from reformatting any specially formatted content you may add. Generally, you want to leave the WordPress formatting enabled, but it some special cases you may prefer to preserve non-WP formatting.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -58,7 +58,7 @@
<tr class="alternate">
<th scope="row"><label for="split_column_in_two"><?php _e('Two author blog','comicpress'); ?></label></th>
<td>
<input id="split_column_in_two" name="split_column_in_two" type="checkbox" value="1" <?php checked(true, $comicpress_options['split_column_in_two']); ?> />
<input id="split_column_in_two" name="split_column_in_two" type="checkbox" value="1" <?php checked(true, $comicpress_options['split_column_in_two']); ?> />
</td>
<td>
<?php _e('When enabled, it will make 2 seperate columns to have two seperate columns available to two different post authors.','comicpress'); ?>
@ -96,19 +96,19 @@
<tr>
<th scope="row"><label for="enable_comic_post_author_gravatar"><?php _e('Comic post author Gravatar','comicpress'); ?></label></th>
<td>
<input id="enable_comic_post_author_gravatar" name="enable_comic_post_author_gravatar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comic_post_author_gravatar']); ?> />
<input id="enable_comic_post_author_gravatar" name="enable_comic_post_author_gravatar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comic_post_author_gravatar']); ?> />
</td>
<td>
<?php _e('Enabling this option will show a gravatar of the comic post author based on the author email address. Gravatars are associated by your email address and you can create them at','comicpress'); ?> <a href="http://gravatar.com/">http://gravatar.com</a>.
<?php _e('Enabling this option will show a gravatar of the comic post author based on the author email address. Gravatars are associated by your email address and you can create them at','comicpress'); ?> <a href="http://gravatar.com/">http://gravatar.com</a>.
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="enable_post_author_gravatar"><?php _e('Blog post author Gravatar','comicpress'); ?></label></th>
<td>
<input id="enable_post_author_gravatar" name="enable_post_author_gravatar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_post_author_gravatar']); ?> />
<input id="enable_post_author_gravatar" name="enable_post_author_gravatar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_post_author_gravatar']); ?> />
</td>
<td>
<?php _e('Enabling this option will show a gravatar of the post author based on the author email address. Gravatars are associated by your email address and you can create them at','comicpress'); ?> <a href="http://gravatar.com/">http://gravatar.com</a>.
<?php _e('Enabling this option will show a gravatar of the post author based on the author email address. Gravatars are associated by your email address and you can create them at','comicpress'); ?> <a href="http://gravatar.com/">http://gravatar.com</a>.
</td>
</tr>
<?php
@ -164,7 +164,7 @@
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -196,11 +196,11 @@
<td>
<?php _e('Choose a directory to get the Archive Calendar styling from. To not have calendar graphics, select "none". Calendar directories are found in your theme directory/images/cal/* to create your own custom archive calendar images just create a directory under images/cal/ and place your image files inside of it.','comicpress'); ?>
</td>
</tr>
</tr>
<tr>
<th scope="row"><label for="enable_comic_post_calendar"><?php _e('Add graphic calendar to comic posts','comicpress'); ?></label></th>
<td>
<input id="enable_comic_post_calendar" name="enable_comic_post_calendar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comic_post_calendar']); ?> />
<input id="enable_comic_post_calendar" name="enable_comic_post_calendar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_comic_post_calendar']); ?> />
</td>
<td>
<?php _e('The graphic calendar is an image that has the date of the comic blog post overlayed on top of it.','comicpress'); ?>
@ -209,14 +209,14 @@
<tr class="alternate">
<th scope="row"><label for="enable_post_calendar"><?php _e('Add graphic calendar to blog posts','comicpress'); ?></label></th>
<td>
<input id="enable_post_calendar" name="enable_post_calendar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_post_calendar']); ?> />
<input id="enable_post_calendar" name="enable_post_calendar" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_post_calendar']); ?> />
</td>
<td>
<?php _e('Enabling this option will display a calendar image on your blog posts. The graphic calendar is an image that has the date of the blog post overlayed on top of it.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -226,7 +226,7 @@
<tr class="alternate">
<th scope="row"><label for="disable_tags_in_posts"><?php _e('Disable display of tags in posts','comicpress'); ?></label></th>
<td>
<input id="disable_tags_in_posts" name="disable_tags_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_tags_in_posts']); ?> />
<input id="disable_tags_in_posts" name="disable_tags_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_tags_in_posts']); ?> />
</td>
<td>
<?php _e('Tags != Categories, Tags are "descriptive keywords" of content in a post.','comicpress'); ?>
@ -235,14 +235,14 @@
<tr>
<th scope="row"><label for="disable_categories_in_posts"><?php _e('Disable display of categories in posts','comicpress'); ?></label></th>
<td>
<input id="disable_categories_in_posts" name="disable_categories_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_categories_in_posts']); ?> />
<input id="disable_categories_in_posts" name="disable_categories_in_posts" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_categories_in_posts']); ?> />
</td>
<td>
<?php _e('Categories != Tags, The categories that are shown by default are the ones the post in set to.','comicpress'); ?>
</td>
</tr>
</table>
<table class="widefat">
<thead>
<tr>
@ -252,7 +252,7 @@
<tr class="alternate">
<th scope="row"><label for="blogposts_with_comic"><?php _e('Show all blog posts up until the next comic post on single pages','comicpress'); ?></label></th>
<td>
<input id="blogposts_with_comic" name="blogposts_with_comic" type="checkbox" value="1" <?php checked(true, $comicpress_options['blogposts_with_comic']); ?> />
<input id="blogposts_with_comic" name="blogposts_with_comic" type="checkbox" value="1" <?php checked(true, $comicpress_options['blogposts_with_comic']); ?> />
</td>
<td>
<?php _e('All the blog posts that are on the same day and greater to the next comic post on the comic your viewing will appear.','comicpress'); ?>
@ -261,7 +261,7 @@
<tr>
<th scope="row"><label for="static_blog"><?php _e('Blog loop stays with all the single pages','comicpress'); ?></label></th>
<td>
<input id="static_blog" name="static_blog" type="checkbox" value="1" <?php checked(true, $comicpress_options['static_blog']); ?> />
<input id="static_blog" name="static_blog" type="checkbox" value="1" <?php checked(true, $comicpress_options['static_blog']); ?> />
</td>
<td>
<?php _e('Blog will stay with the single pages, this will automatically disable any commenting ability for comic blog posts. ','comicpress'); ?>
@ -270,16 +270,16 @@
<tr class="alternate">
<th scope="row"><label for="disable_page_titles"><?php _e('Disable the titles on pages','comicpress'); ?></label></th>
<td>
<input id="disable_page_titles" name="disable_page_titles" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_titles']); ?> />
<input id="disable_page_titles" name="disable_page_titles" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_page_titles']); ?> />
</td>
<td>
<?php _e('If you disable the titles no pages you can still add a post-image in the page editor.','comicpress'); ?>
</td>
</tr>
</table>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -289,7 +289,7 @@
<div class="clear"></div>
</div>
</div>
</form>
</div>
</div>

View File

@ -1,19 +1,19 @@
<script language="javascript">
function showimage(sel,pic) {
if (!document.images)
if (!document.images)
return
document.getElementById(pic).src = '<?php echo get_template_directory_uri(); ?>/images/options/'+sel.options[sel.selectedIndex].value+'.png'
}
</script>
<div id="themestyle" class="<?php if ($tab == 'themestyle' || empty($tab)) { ?>show<?php } else { ?>hide<?php } ?>">
<div id="comicpress-themestyle">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<div id="comicpress-options">
<table class="widefat" cellspacing="0">
<thead>
<tr>
@ -33,14 +33,14 @@
<?php if (is_cp_layout_avail('3c',$avail_layouts)) { ?>
<option class="level-0" value="3c" <?php if ($comicpress_options['cp_theme_layout'] =='3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Standard ','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('3c2r',$avail_layouts)) { ?>
<option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option>
<?php if (is_cp_layout_avail('3c2r',$avail_layouts)) { ?>
<option class="level-0" value="3c2r" <?php if ($comicpress_options['cp_theme_layout'] =='3c2r') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3c',$avail_layouts)) { ?>
<option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option>
<option class="level-0" value="v3c" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('v3cr',$avail_layouts)) { ?>
<option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option>
<option class="level-0" value="v3cr" <?php if ($comicpress_options['cp_theme_layout'] =='v3c') { ?>selected="selected" <?php } ?>><?php _e('3 Column - Vertical Double Right Sidebar','comicpress'); ?></option>
<?php } ?>
<?php if (is_cp_layout_avail('gn',$avail_layouts)) { ?>
<option class="level-0" value="gn" <?php if ($comicpress_options['cp_theme_layout'] =='gn') { ?>selected="selected" <?php } ?>><?php _e('Graphic Novel - Left Sidebar','comicpress'); ?></option>
@ -60,11 +60,11 @@
</td>
</tr>
</table>
<div class="clear"></div>
</div>
<div id="comicpress-options-save">
<div id="major-publishing-actions">
<div id="publishing-action">
@ -74,9 +74,9 @@
<div class="clear"></div>
</div>
</div>
</form>
<div class="clear"></div>
<div class="cpadmin-footer">
@ -104,13 +104,13 @@
</td>
<td style="width:200px;">
<form method="post" id="myForm" name="template" enctype="multipart/form-data">
<?php wp_nonce_field('update-options') ?>
<?php wp_nonce_field('update-options') ?>
<input name="comicpress_reset" type="submit" class="button" value="Reset All Settings" />
<input type="hidden" name="action" value="comicpress_reset" />
<input type="hidden" name="action" value="comicpress_reset" />
</form>
</td>
</tr>
</table>
</div>
</div>