finishing touches for the motion artist support, fixed some display issues in the comic -> comics displaying of the layout and thumbnails; made the admin-editor.css file enqueue on that page as well

This commit is contained in:
Frumph
2013-06-20 12:58:19 -07:00
parent 23520aac1e
commit 245bf7932f
5 changed files with 47 additions and 41 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ function ceo_add_menu_pages() {
}
if (!defined('CEO_FEATURE_DISABLE_DEBUG'))
$debug_hook = add_submenu_page($menu_location, $plugin_title . ' - ' . $debug_title, $debug_title, 'edit_theme_options', 'comiceasel-debug', 'ceo_debug');
ceo_enqueue_admin_cpt_style('comic', 'comic-admin-editor-style', ceo_pluginfo('plugin_url').'/css/admin-editor.css');
ceo_enqueue_admin_cpt_style('comic', 'comic-admin-editor-style', ceo_pluginfo('plugin_url').'/css/admin-editor.css');
}
function ceo_load_scripts_chapter_manager() {
@@ -93,12 +93,12 @@ function ceo_enqueue_admin_cpt_style( $cpt, $handle, $src = false, $deps = array
$enqueue = null;
/* Enqueue style only if we are on the correct CPT editor page. */
if ( isset($_GET['post_type']) && $_GET['post_type'] == $cpt && $pagenow == "post-new.php" ) {
if ( isset($_GET['post_type']) && $_GET['post_type'] == $cpt && ($pagenow == "post-new.php" || $pagenow == 'edit.php')) {
$enqueue = true;
}
/* Enqueue style only if we are on the correct CPT editor page. */
if ( isset($_GET['post']) && $pagenow == "post.php" ) {
if ( isset($_GET['post']) && ($pagenow == "post.php" || $pagenow == 'edit.php')) {
$post_id = $_GET['post'];
$post_obj = get_post( $post_id );
if( $post_obj->post_type == $cpt )
+2 -2
View File
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
add_action('init', 'ceo_initialize_post_types');
define('CEO_FEATURE_DISABLE_MOTION_ARTIST', true);
// define('CEO_FEATURE_DISABLE_MOTION_ARTIST', true);
function ceo_initialize_post_types() {
if (!post_type_exists('comic')) {
@@ -355,7 +355,7 @@ function ceo_pluginfo($whichinfo = null) {
// comic-easel plugin directory/url
'plugin_url' => plugin_dir_url(dirname (__FILE__)) . 'comic-easel',
'plugin_path' => trailingslashit(ABSPATH) . ceo_get_plugin_path(),
'version' => '1.3.13-github'
'version' => '1.3.13'
);
// Combine em.
$ceo_pluginfo = array_merge($ceo_pluginfo, $ceo_addinfo);
+8
View File
@@ -2,5 +2,13 @@
.admin-comicbox img {
max-width: 100%;
display: block;
}
.column-comicimages {
width: 200px;
}
.fixed .column-locations {
width: 200px;
}
+13 -16
View File
@@ -19,7 +19,7 @@ function ceo_admin_init() {
add_action('quick_edit_custom_box', 'ceo_chapters_quick_edit_menu_order', 10, 3);
add_action('create_term', 'ceo_chapters_add_edit_menu_order');
// add_filter('get_terms_args', 'ceo_chapters_find_menu_orderby');
// add_filter('get_terms_args', 'ceo_chapters_find_menu_orderby');
}
function ceo_chapters_add_edit_menu_order($term_id) {
@@ -104,16 +104,14 @@ function ceo_chapters_menu_order_edit_form_field($term) {
function ceo_add_new_comic_columns($comic_columns) {
$new_columns['cb'] = '<input type="checkbox" />';
$new_columns['title'] = __('Comic Title', 'comiceasel');
$new_columns['chapter'] = __('Chapter', 'comiceasel');
$new_columns['characters'] = __('Characters', 'comiceasel');
$new_columns['locations'] = __('Location', 'comiceasel');
$new_columns['tags'] = __('Tags', 'comiceasel');
$new_columns['date'] = _x('Date', 'column name');
$new_columns['comicimages'] = __('Thumbnail', 'comiceasel');
$new_columns['comicimages'] = __('Thumbnail', 'comiceasel');
return $new_columns;
}
@@ -150,7 +148,7 @@ function ceo_manage_comic_columns($column_name, $id) {
case 'comicimages':
$post = &get_post($id);
$comicthumb = ceo_display_comic_thumbnail('thumbnail', $post);
if (!$comicthumb) { echo 'No Comic Found.'; } else {
if (!$comicthumb) { echo __('No thumbnail Found.','comiceasel'); } else {
echo $comicthumb;
}
break;
@@ -164,8 +162,6 @@ function ceo_edit_select_motion_artist_directory_in_post($post) {
$current_directory = get_post_meta( $post->ID, 'ma-directory', true );
if (empty($current_directory) || is_wp_error($current_directory)) $current_directory = '';
$dirs_to_search = array_unique(array(get_template_directory(),get_stylesheet_directory()));
$ma_directories = array();
$ma_dir = get_stylesheet_directory() . '/motion-artist';
@@ -175,7 +171,6 @@ function ceo_edit_select_motion_artist_directory_in_post($post) {
$thisdir = glob($ma_dir. '/*');
$ma_directories = array_merge($ma_directories, $thisdir);
}
if (empty($ma_directories) || is_wp_error($ma_directories)) echo "No 'motion-artist' directory found in theme.";
?>
<div class="admin-motion-artist" style="">
<table>
@@ -197,13 +192,14 @@ function ceo_edit_select_motion_artist_directory_in_post($post) {
</select>
</td>
</tr>
<?php } else { ?>
No 'motion-artist' directory found in theme.<br />
<?php }
$current_height = get_post_meta( $post->ID, 'ma-height', true );
$current_width = get_post_meta( $post->ID, 'ma-width', true );
if (empty($current_height) || is_wp_error($current_height)) $current_height = '';
if (empty($current_height) || is_wp_error($current_width)) $current_width = '';
<?php } else {
echo __('No motion-artist directory found in theme or no comics found in motion-artist folder.', 'comiceasel');
}
$current_height = get_post_meta( $post->ID, 'ma-height', true );
$current_width = get_post_meta( $post->ID, 'ma-width', true );
if (empty($current_height) || is_wp_error($current_height)) $current_height = '';
if (empty($current_height) || is_wp_error($current_width)) $current_width = '';
if (!empty($ma_directories) && !is_wp_error($ma_directories)) {
?>
<tr>
<td>
@@ -216,6 +212,7 @@ Width: <input id="ma-width" name="ma-width" style="width: 40px;" type="text" val
</table>
</div>
<?php
}
}
+21 -20
View File
@@ -5,27 +5,28 @@ if (!defined('CEO_FEATURE_DISABLE_MOTION_ARTIST'))
function ceo_add_motion_artist_header_info() {
global $post;
if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
$order = (ceo_pluginfo('display_first_comic_on_home_page')) ? 'asc' : 'desc';
$args = array(
'showposts' => 1,
'posts_per_page' => 1,
'order' => $order,
'post_type' => 'comic'
);
$posts = get_posts($args);
foreach ($posts as $post) {
setup_postdata($post);
if (!is_admin()) {
if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
$order = (ceo_pluginfo('display_first_comic_on_home_page')) ? 'asc' : 'desc';
$args = array(
'showposts' => 1,
'posts_per_page' => 1,
'order' => $order,
'post_type' => 'comic'
);
$posts = get_posts($args);
foreach ($posts as $post) {
setup_postdata($post);
}
}
}
if (!empty($post)) {
$motion_artist_comic = get_post_meta( $post->ID, 'ma-directory', true );
$motion_artist_id = get_post_meta( $post->ID, 'ma-id', true );
if (!empty($motion_artist_comic)) {
echo '<base href="'.get_stylesheet_directory_uri().'/motion-artist/'.$motion_artist_comic.'/" />';
echo '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/motion-artist/'.$motion_artist_comic.'/css/MA_style.css">'."\r\n";
echo '<script src="http://motionartist.smithmicro.com/public/motionartist_1.0.js"></script>'."\r\n";
echo '<script src="'.get_stylesheet_directory_uri().'/motion-artist/'.$motion_artist_comic.'/scripts/'.$motion_artist_id.'.js"></script>';
if (!empty($post) && ($post->post_type == 'comic')) {
$motion_artist_comic = get_post_meta( $post->ID, 'ma-directory', true );
$motion_artist_id = get_post_meta( $post->ID, 'ma-id', true );
if (!empty($motion_artist_comic)) {
echo '<base href="'.get_stylesheet_directory_uri().'/motion-artist/'.$motion_artist_comic.'/" />';
echo '<script src="http://motionartist.smithmicro.com/public/motionartist_1.0.js"></script>'."\r\n";
echo '<script src="'.get_stylesheet_directory_uri().'/motion-artist/'.$motion_artist_comic.'/scripts/'.$motion_artist_id.'.js"></script>';
}
}
}
}