From 1fafe2a3da08473c1429acbff282cf39f00479b3 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 6 Sep 2009 11:04:38 -0400 Subject: [PATCH] rearrange some things --- ...DidTheySay.php => WDTSLanguageOptions.php} | 32 +---------------- classes/WDTSTranscript.php | 6 +++- classes/WDTSTranscriptClasses.php | 8 +++++ classes/WDTSTranscriptOptions.php | 34 +++++++++++++++++++ 4 files changed, 48 insertions(+), 32 deletions(-) rename classes/{WhatDidTheySay.php => WDTSLanguageOptions.php} (51%) create mode 100644 classes/WDTSTranscriptClasses.php create mode 100644 classes/WDTSTranscriptOptions.php 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