work on queued transcripts
This commit is contained in:
parent
6622b88dfe
commit
0434beb429
|
@ -251,6 +251,12 @@ class WhatDidTheySay {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_languages() {
|
||||||
|
$options = get_option('what-did-they-say-options');
|
||||||
|
|
||||||
|
return $options['languages'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -133,6 +133,21 @@ class WhatDidTheySayAdmin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handle_update_queue_transcript($queue_transcript_info) {
|
||||||
|
$updated = false;
|
||||||
|
if (current_user_can('submit_transcriptions')) {
|
||||||
|
var_dump($queue_transcript_info);
|
||||||
|
switch ($queue_transcript_info['action']) {
|
||||||
|
case 'submit_queued_transcript':
|
||||||
|
$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) {
|
function handle_update_post_transcripts($post_transcript_info) {
|
||||||
$updated = false;
|
$updated = false;
|
||||||
|
|
|
@ -112,4 +112,30 @@ function the_media_transcript_select_and_display($dropdown_message = null, $sing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 }
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue