diff --git a/classes/WDTSTranscript.inc b/classes/WDTSTranscript.inc index 6ce73c1..e37ea1f 100644 --- a/classes/WDTSTranscript.inc +++ b/classes/WDTSTranscript.inc @@ -172,6 +172,10 @@ class WDTSTranscriptManager { } return array_keys($languages); } + + function count() { + return count($this->get_transcripts()); + } } ?> \ No newline at end of file diff --git a/classes/WhatDidTheySayAdmin.inc b/classes/WhatDidTheySayAdmin.inc index e078f28..c63a0c5 100644 --- a/classes/WhatDidTheySayAdmin.inc +++ b/classes/WhatDidTheySayAdmin.inc @@ -335,6 +335,14 @@ class WhatDidTheySayAdmin { } if (current_user_can('approve_transcriptions')) { + // edit posts notification + add_filter('manage_posts_columns', array(&$this, 'manage_posts_columns')); + add_action('manage_posts_custom_column', array(&$this, 'manage_posts_custom_column'), 10, 2); + + // dashboard widget + //wp_add_dashboard_widget('dashboard_transcripts', __('Recent Queued Transcripts', 'what-did-they-say'), array(&$this, 'dashboard_transcripts')); + //add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_transcripts')); + if (strpos($pagenow, "post") === 0) { add_meta_box( 'manage-transcriptions', @@ -371,6 +379,34 @@ class WhatDidTheySayAdmin { return $content . ob_get_clean(); } + /** + * The edit posts column header. + */ + function manage_posts_columns($columns) { + $keys = array_keys($columns); + $values = array_values($columns); + + $index = array_search('comments', $keys); + if ($index === false) { $index = count($keys); } + + array_splice($keys, $index, 0, array('transcripts')); + array_splice($values, $index, 0, __('Trans')); + + return array_combine($keys, $values); + } + + /** + * The edit posts column. Needs a pretty icon. + */ + function manage_posts_custom_column($name, $post_id) { + if ($name === "transcripts") { + $queued_transcript_object = new WDTSQueuedTranscript($post_id); + + if (($queued_count = $queued_transcript_object->count()) > 0) { + printf(__('%s queued', 'what-did-they-say'), $queued_count); + } + } + } /** Transcript Search Filters **/ diff --git a/readme.txt b/readme.txt index d6393e4..09beac8 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://www.coswellproductions.com/wordpress/wordpress-plugins Tags: admin, comics, webcomics, transcript, video, audio Requires at least: 2.8 Tested up to: 2.8.4 -Stable tag: 0.9.1 +Stable tag: 0.9.2 What Did They Say?!? lets your users provide multilingual transcriptions to your media, in their language, quickly and securely. @@ -65,7 +65,10 @@ Transcripts can be in one of two states: **queued** and **approved**. Users can * Users who can approve transcripts can also directly edit the approved transcripts. * If a user submits a transcript to the queue, they can delete it before it's approved. -Permissions are handed out based on role and is set under the *Capabilities* tab. +Permissions are handed out in two ways and are set under the *Capabilities* tab. + +* Based on role (Subscriber, Administrator, etc.) +* Per user = How do short codes work? = @@ -88,6 +91,10 @@ Thanks to @mindfaucet, @Frumph, and @ChibiJen for early testing and bug reportin == Changelog == += 0.9.2 = +* JavaScript bugfixes. +* Per-user permissions. +* Visual feedback for number of queued transcripts per post. = 0.9.1 = * Bugfixes for transcript submission and theme editor global variable name collision. * Improved transcript submission feedback. diff --git a/what-did-they-say.php b/what-did-they-say.php index 125f580..7d3a27e 100644 --- a/what-did-they-say.php +++ b/what-did-they-say.php @@ -3,7 +3,7 @@ Plugin Name: What Did They Say?!? Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ Description: Manage and display text transcriptions of comics, videos, or other media. -Version: 0.9.1 +Version: 0.9.2 Author: John Bintz Author URI: http://www.coswellproductions.com/wordpress/ Text Domain: what-did-they-say @@ -217,8 +217,7 @@ function the_media_transcript_queue_editor() { [ get_transcripts()); - if ($queued_count > 0) { ?> + if (($queued_count = $queued_transcript_object->count()) > 0) { ?> ()