diff --git a/classes/WhatDidTheySay.php b/classes/WDTSLanguageOptions.php similarity index 51% rename from classes/WhatDidTheySay.php rename to classes/WDTSLanguageOptions.php index e7c7c18..888dfa0 100644 --- a/classes/WhatDidTheySay.php +++ b/classes/WDTSLanguageOptions.php @@ -1,16 +1,6 @@ diff --git a/classes/WDTSTranscript.php b/classes/WDTSTranscript.php index 74168a3..006e7fd 100644 --- a/classes/WDTSTranscript.php +++ b/classes/WDTSTranscript.php @@ -4,8 +4,12 @@ class WDTSTranscriptManager { var $key = null; var $post_id = null; + function __construct($post_id = null) { + if (is_numeric($post_id)) { $this->post_id = $post_id; } + } + function WDTSTranscriptManager($post_id = null) { - if (is_numeric($post_id)) { $this->post_id = $post_id; } + $this->__construct($post_id); } function _get_transcripts_metadata() { diff --git a/classes/WDTSTranscriptClasses.php b/classes/WDTSTranscriptClasses.php new file mode 100644 index 0000000..c79618e --- /dev/null +++ b/classes/WDTSTranscriptClasses.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/classes/WDTSTranscriptOptions.php b/classes/WDTSTranscriptOptions.php new file mode 100644 index 0000000..e12917e --- /dev/null +++ b/classes/WDTSTranscriptOptions.php @@ -0,0 +1,34 @@ +post_id = $post_id; } + } + + function WDTSTranscriptOptions($post_id = null) { $this->__construct($post_id); } + + /** + * Set whether or not the indicated post can accept new queued transcriptions. + * @param int $post_id The post ID to affect. + * @param boolean $allow True if the post can accept new queued transcriptions. + */ + function set_allow_transcripts_for_post($post_id, $allow = true) { + $current_transcripts = get_post_meta($post_id, "transcript_options", true); + if (!is_array + $current_transcripts['_allow'] = $allow; + update_post_meta($post_id, "provided_transcripts", $current_transcripts); + } + + /** + * See if the indicated post is accepting new transcripts. + * @return boolean True if the post is acceptin new transcripts. + */ + function get_allow_transcripts_for_post($post_id) { + $current_transcripts = get_post_meta($post_id, "provided_transcripts", true); + return $current_transcripts['_allow']; + } +} + +?> \ No newline at end of file