more cleanup work

This commit is contained in:
John Bintz 2009-10-08 21:58:06 -04:00
parent c153688d93
commit 855cab5e1c
5 changed files with 10 additions and 10 deletions

View File

@ -855,6 +855,7 @@ class WhatDidTheySayAdmin {
} }
$transcript_options = new WDTSTranscriptOptions($post->ID); $transcript_options = new WDTSTranscriptOptions($post->ID);
$queued_transcripts = new WDTSQueuedTranscript($post->ID);
$language_options = new WDTSLanguageOptions(); $language_options = new WDTSLanguageOptions();

View File

@ -1,4 +1,4 @@
<div class="queued-transcript-holder" id="wdts-<?php echo $id = md5(rand()) ?>"> <div class="queued-transcript-holder" id="wdts-<?php echo $queued_id = md5(rand()) ?>">
<?php include(dirname(__FILE__) . '/_queued-transcript-contents.inc') ?> <?php include(dirname(__FILE__) . '/_queued-transcript-contents.inc') ?>
</div> </div>
<script type="text/javascript">queued_editors_to_attach.push('wdts-<?php echo $id ?>');</script> <script type="text/javascript">queued_editors_to_attach.push('wdts-<?php echo $queued_id ?>');</script>

View File

@ -1,16 +1,14 @@
<?php <?php
$transcripts_to_show = array(); $transcripts_to_show = array();
if (current_user_can('approve_transcriptions')) { if (current_user_can('approve_transcriptions')) {
$transcripts_to_show = $queued_transcripts->get_transcripts(); $transcripts_to_show = $queued_transcript_object->get_transcripts();
$title = __('All Submitted Transcripts', 'what-did-they-say'); $title = __('All Submitted Transcripts', 'what-did-they-say');
} else { } else {
if (!is_admin()) { if (!is_admin()) {
$user = wp_get_current_user(); $user = wp_get_current_user();
if (!empty($user)) { if (!empty($user)) {
$transcripts_to_show = $queued_transcripts->get_transcripts_for_user($user->ID); $transcripts_to_show = $queued_transcript_object->get_transcripts_for_user($user->ID);
$title = __('Your Submitted Transcripts', 'what-did-they-say'); $title = __('Your Submitted Transcripts', 'what-did-they-say');
} }
} }
@ -21,7 +19,7 @@
<h3 style="margin-top: 0.5em"><?php echo $title ?></h3> <h3 style="margin-top: 0.5em"><?php echo $title ?></h3>
<?php <?php
foreach ($transcripts_to_show as $transcript) { foreach ($transcripts_to_show as $transcript) {
include(dirname(__FILE__) . '/classes/partials/_display-queued-transcript.inc'); include('_display-queued-transcript.inc');
} }
?> ?>
<?php } ?> <?php } ?>

View File

@ -1,10 +1,11 @@
<?php $transcript_user = get_userdata($transcript['user_id']) ?>
<input type="hidden" name="wdts[language]" value="<?php echo $transcript['language'] ?>" /> <input type="hidden" name="wdts[language]" value="<?php echo $transcript['language'] ?>" />
<input type="hidden" name="wdts[post_id]" value="<?php echo $post->ID ?>" /> <input type="hidden" name="wdts[post_id]" value="<?php echo $post->ID ?>" />
<input type="hidden" name="wdts[key]" value="<?php echo $transcript['key'] ?>" /> <input type="hidden" name="wdts[key]" value="<?php echo $transcript['key'] ?>" />
<p><?php <p><?php
printf( printf(
__('From <strong>%s</strong> in <strong>%s</strong>:', 'what-did-they-say'), __('From <strong>%s</strong> in <strong>%s</strong>:', 'what-did-they-say'),
$user->display_name, $transcript_user->display_name,
$language_options->get_language_name($transcript['language']) $language_options->get_language_name($transcript['language'])
) )
?></p> ?></p>

View File

@ -184,7 +184,7 @@ function the_media_transcript_queue_editor() {
global $post; global $post;
if (current_user_can('submit_transcriptions')) { if (current_user_can('submit_transcriptions')) {
$queued_transcripts = new WDTSQueuedTranscript($post->ID); $queued_transcript_object = new WDTSQueuedTranscript($post->ID);
$language_options = new WDTSLanguageOptions(); $language_options = new WDTSLanguageOptions();
@ -204,7 +204,7 @@ function the_media_transcript_queue_editor() {
?> ?>
<div style="display:none"> <div style="display:none">
[ <a id="wdts-opener-<?php echo $id = md5(rand()) ?>" href="#"><?php _e('Edit/Add Transcripts', 'what-did-they-say') ?></a> ] <span id="wdts-opener-<?php echo $id = md5(rand()) ?>">[ <a href="#"><?php _e('Edit/Add Transcripts', 'what-did-they-say') ?></a> ]</span>
</div> </div>
<noscript> <noscript>
<p>JavaScript is required to edit transcripts.</p> <p>JavaScript is required to edit transcripts.</p>