Merge branch 'master' of ssh://claritycomic.com/home/john/repositories/what-did-they-say

This commit is contained in:
John Bintz 2009-08-18 21:18:34 -04:00
commit 4aee4ba21f
3 changed files with 47 additions and 0 deletions

View File

@ -234,6 +234,12 @@ class WhatDidTheySay {
return false;
}
}
function get_languages() {
$options = get_option('what-did-they-say-options');
return $options['languages'];
}
}
?>

View File

@ -134,6 +134,21 @@ class WhatDidTheySayAdmin {
}
}
function handle_update_queue_transcript($queue_transcript_info) {
$updated = false;
if (current_user_can('submit_transcriptions')) {
switch ($queue_transcript_info['action']) {
case 'submit_queued_transcript':
var_dump($queue_transcript_info);
$result = $this->what_did_they_say->add_queued_transcription_to_post($queue_transcript_info['post_id'], $queue_transcript_info);
if ($result) {
$updated = __('Transcript added to queue.', 'what-did-they-say');
}
}
}
return $updated;
}
function handle_update_post_transcripts($post_transcript_info) {
$updated = false;
if (current_user_can('approve_transcriptions')) {

View File

@ -114,4 +114,30 @@ function transcripts_display($dropdown_message = null, $single_language_message
echo apply_filters('transcripts_display', implode("\n", $output));
}
function the_media_transcript_queue_editor() {
global $post, $what_did_they_say;
if (current_user_can('submit_transcriptions')) { ?>
<form method="post">
<input type="hidden" name="wdts[_nonce]" value="<?php echo wp_create_nonce('what-did-they-say') ?>" />
<input type="hidden" name="wdts[action]" value="submit_queued_transcript" />
<input type="hidden" name="wdts[post_id]" value="<?php echo $post->ID ?>" />
<h3><?php _e('Submit a new transcription:', 'what-did-they-say') ?></h3>
<label>
<?php _e('Language:', 'what-did-they-say') ?>
<select name="wdts[language]">
<?php foreach ($what_did_they_say->get_languages() as $code => $info) { ?>
<option value="<?php echo $code ?>"><?php echo $info['name'] ?></option>
<?php } ?>
</select>
</label><br />
<label>
<?php _e('Transcription:', 'what-did-they-say') ?><br />
<textarea style="height: 200px; width: 90%" name="wdts[transcript]"></textarea>
</label>
<input type="submit" value="<?php _e('Submit New Transcription', 'what-did-they-say') ?>" />
</form>
<?php }
}
?>