pretty up admin area

This commit is contained in:
John Bintz 2009-11-16 21:12:04 -05:00
parent 1209336388
commit ce27525e72
3 changed files with 69 additions and 37 deletions

View File

@ -71,19 +71,19 @@ class ComicPressAdmin {
if (strpos($pagenow, "post") === 0) { if (strpos($pagenow, "post") === 0) {
add_meta_box("comic-image-ordering", __("Comic Image Ordering", 'comicpress'), array(&$this, 'render_comic_image_ordering'), "post", "normal", "low"); add_meta_box("comic-image-ordering", __("Comic Image Ordering", 'comicpress'), array(&$this, 'render_comic_image_ordering'), "post", "normal", "low");
wp_enqueue_script('cp-ordering', get_template_directory_uri() . '/js/ComicImageOrdering.js', array('scriptaculous', 'scriptaculous-slider')); wp_enqueue_script('cp-ordering', plugin_dir_url(dirname(__FILE__)) . '/js/ComicImageOrdering.js', array('scriptaculous', 'scriptaculous-slider'));
wp_enqueue_style('cp-admin', get_template_directory_uri() . '/css/cp-admin.css'); wp_enqueue_style('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/css/cp-admin.css');
add_action('admin_footer', array(&$this, 'admin_footer')); add_action('admin_footer', array(&$this, 'admin_footer'));
} }
if ($plugin_page == 'comicpress/render_admin') { if ($plugin_page == 'comicpress/render_admin') {
wp_enqueue_style('cp-admin', get_template_directory_uri() . '/css/cp-admin.css'); wp_enqueue_style('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/css/cp-admin.css');
wp_enqueue_script('cp-admin', get_template_directory_uri() . '/js/Storyline.js', array('prototype', 'scriptaculous')); wp_enqueue_script('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/js/Storyline.js', array('prototype', 'scriptaculous'));
add_action('admin_footer', array(&$this, 'admin_footer')); add_action('admin_footer', array(&$this, 'admin_footer'));
} }
if (strpos($pagenow, "-upload") !== false) { if (strpos($pagenow, "-upload") !== false) {
wp_enqueue_script('cp-media', get_template_directory_uri() . '/js/MediaUpload.js', array('prototype')); wp_enqueue_script('cp-media', plugin_dir_url(dirname(__FILE__)) . '/js/MediaUpload.js', array('prototype'));
} }
} }

View File

@ -1,14 +1,14 @@
<div class="wrap"> <div class="wrap comicpress-admin">
<h2><?php _e('ComicPress Config', 'comicpress') ?></h2> <h2><?php _e('ComicPress Config', 'comicpress') ?></h2>
<form method="post" action=""> <form method="post" action="">
<input type="hidden" name="cp[_nonce]" value="<?php echo esc_attr($nonce) ?>" /> <input type="hidden" name="cp[_nonce]" value="<?php echo esc_attr($nonce) ?>" />
<input type="hidden" name="cp[action]" value="comicpress-options" /> <input type="hidden" name="cp[action]" value="comicpress-options" />
<input type="hidden" name="cp[_action_nonce]" value="<?php echo esc_attr($action_nonce) ?>" /> <input type="hidden" name="cp[_action_nonce]" value="<?php echo esc_attr($action_nonce) ?>" />
<h3><?php _e('Global Options', 'comicpress') ?></h3>
<table class="widefat fixed"> <h3>
<tr> <?php _e('Storyline Order', 'comicpress') ?>
<th width="25%" scope="row" valign="top"><?php _e("Arrange storyline category order", 'comicpress') ?></th> </h3>
<td width="75%"> <div id="comicpress-storyline-category-order-holder" class="comicpress-holder">
<input type="hidden" name="cp[storyline_order]" value="" /> <input type="hidden" name="cp[storyline_order]" value="" />
<div id="storyline-sorter"> <div id="storyline-sorter">
<div class="cp-children"> <div class="cp-children">
@ -19,11 +19,12 @@
</div> </div>
<script type="text/javascript">Storyline.setup()</script> <script type="text/javascript">Storyline.setup()</script>
<p><em><?php _e('(drag and drop desired order. categories can be modified on the Posts -> Categories page)', 'comicpress') ?></em></p> <p><em><?php _e('(drag and drop desired order. categories can be modified on the Posts -> Categories page)', 'comicpress') ?></em></p>
</td>
</tr> <input class="button-primary" type="submit" value="<?php _e('Submit Updated ComicPress Options', 'comicpress') ?>" />
<tr> </div>
<th scope="row" valign="top"><?php _e('Set up comic image types', 'comicpress') ?></th>
<td> <h3><?php _e('Comic Image Types', 'comicpress') ?></h3>
<div id="comicpress-image-types-holder" class="comicpress-holder">
<div id="image-type-container"> <div id="image-type-container">
<?php foreach ($this->comicpress->comicpress_options['image_types'] as $type => $info) { ?> <?php foreach ($this->comicpress->comicpress_options['image_types'] as $type => $info) { ?>
<?php include('_image-type-editor.inc'); ?> <?php include('_image-type-editor.inc'); ?>
@ -31,11 +32,21 @@
</div> </div>
<a id="add-new-image-type" href="#">[+] Add a new image type</a> <a id="add-new-image-type" href="#">[+] Add a new image type</a>
<script type="text/javascript">ComicImageTypes.setup()</script> <script type="text/javascript">ComicImageTypes.setup()</script>
</td>
</tr>
</table>
<div style="text-align: center; margin-top: 10px;">
<input class="button-primary" type="submit" value="<?php _e('Submit Updated ComicPress Options', 'comicpress') ?>" /> <input class="button-primary" type="submit" value="<?php _e('Submit Updated ComicPress Options', 'comicpress') ?>" />
</div> </div>
</form> </form>
</div> </div>
<script type="text/javascript">
$$('.comicpress-admin h3').each(function(h3) {
h3.observe('click', function(e) {
Event.stop(e);
var area = $(e.target).nextSiblings().shift();
if (area) {
new Effect[area.visible() ? 'BlindUp' : 'BlindDown'](area, {
duration: 0.25
});
}
});
});
</script>

View File

@ -132,3 +132,24 @@
padding: 5px; padding: 5px;
width: 100% width: 100%
} }
.comicpress-admin h3 {
border: solid #464646 1px;
padding: 0.25em;
background: #6D6D6D;
color: #FFFFFF;
text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
border-top-left-radius: 5px;
border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
margin-bottom: 0;
cursor: hand;
cursor: pointer
}
.comicpress-holder {
border: solid #464646 1px;
border-top: none;
padding: 0.5em
}