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) {
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_style('cp-admin', get_template_directory_uri() . '/css/cp-admin.css');
wp_enqueue_script('cp-ordering', plugin_dir_url(dirname(__FILE__)) . '/js/ComicImageOrdering.js', array('scriptaculous', 'scriptaculous-slider'));
wp_enqueue_style('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/css/cp-admin.css');
add_action('admin_footer', array(&$this, 'admin_footer'));
}
if ($plugin_page == 'comicpress/render_admin') {
wp_enqueue_style('cp-admin', get_template_directory_uri() . '/css/cp-admin.css');
wp_enqueue_script('cp-admin', get_template_directory_uri() . '/js/Storyline.js', array('prototype', 'scriptaculous'));
wp_enqueue_style('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/css/cp-admin.css');
wp_enqueue_script('cp-admin', plugin_dir_url(dirname(__FILE__)) . '/js/Storyline.js', array('prototype', 'scriptaculous'));
add_action('admin_footer', array(&$this, 'admin_footer'));
}
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,41 +1,52 @@
<div class="wrap">
<div class="wrap comicpress-admin">
<h2><?php _e('ComicPress Config', 'comicpress') ?></h2>
<form method="post" action="">
<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_nonce]" value="<?php echo esc_attr($action_nonce) ?>" />
<h3><?php _e('Global Options', 'comicpress') ?></h3>
<table class="widefat fixed">
<tr>
<th width="25%" scope="row" valign="top"><?php _e("Arrange storyline category order", 'comicpress') ?></th>
<td width="75%">
<input type="hidden" name="cp[storyline_order]" value="" />
<div id="storyline-sorter">
<div class="cp-children">
<?php
$this->_render_admin_storyline_tree(reset($storyline->get_simple_storyline()))
?>
</div>
</div>
<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>
</td>
</tr>
<tr>
<th scope="row" valign="top"><?php _e('Set up comic image types', 'comicpress') ?></th>
<td>
<div id="image-type-container">
<?php foreach ($this->comicpress->comicpress_options['image_types'] as $type => $info) { ?>
<?php include('_image-type-editor.inc'); ?>
<?php } ?>
</div>
<a id="add-new-image-type" href="#">[+] Add a new image type</a>
<script type="text/javascript">ComicImageTypes.setup()</script>
</td>
</tr>
</table>
<div style="text-align: center; margin-top: 10px;">
<h3>
<?php _e('Storyline Order', 'comicpress') ?>
</h3>
<div id="comicpress-storyline-category-order-holder" class="comicpress-holder">
<input type="hidden" name="cp[storyline_order]" value="" />
<div id="storyline-sorter">
<div class="cp-children">
<?php
$this->_render_admin_storyline_tree(reset($storyline->get_simple_storyline()))
?>
</div>
</div>
<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>
<input class="button-primary" type="submit" value="<?php _e('Submit Updated ComicPress Options', 'comicpress') ?>" />
</div>
<h3><?php _e('Comic Image Types', 'comicpress') ?></h3>
<div id="comicpress-image-types-holder" class="comicpress-holder">
<div id="image-type-container">
<?php foreach ($this->comicpress->comicpress_options['image_types'] as $type => $info) { ?>
<?php include('_image-type-editor.inc'); ?>
<?php } ?>
</div>
<a id="add-new-image-type" href="#">[+] Add a new image type</a>
<script type="text/javascript">ComicImageTypes.setup()</script>
<input class="button-primary" type="submit" value="<?php _e('Submit Updated ComicPress Options', 'comicpress') ?>" />
</div>
</form>
</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

@ -131,4 +131,25 @@
border: solid #aaa 1px;
padding: 5px;
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
}