rearrange some things

This commit is contained in:
John Bintz 2009-09-06 11:04:38 -04:00
parent 712708a996
commit 1fafe2a3da
4 changed files with 48 additions and 32 deletions

View File

@ -1,16 +1,6 @@
<?php
/**
* WhatDidTheySay manages transcriptions that are attached as metadata
* individual posts. Transcriptions can be updated, deleted, and moved to
* other posts as necessary.
*/
class WhatDidTheySay {
/**
* Constructor.
*/
function WhatDidTheySay() {}
class WDTSLanguageOptions {
/**
* Get the default transcript language for this blog.
* @return string The language code representing the default language.
@ -49,26 +39,6 @@ class WhatDidTheySay {
return $options['languages'];
}
/**
* 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, "provided_transcripts", true);
$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'];
}
}
?>

View File

@ -4,10 +4,14 @@ class WDTSTranscriptManager {
var $key = null;
var $post_id = null;
function WDTSTranscriptManager($post_id = null) {
function __construct($post_id = null) {
if (is_numeric($post_id)) { $this->post_id = $post_id; }
}
function WDTSTranscriptManager($post_id = null) {
$this->__construct($post_id);
}
function _get_transcripts_metadata() {
$transcripts = false;
if (!is_null($this->key)) {

View File

@ -0,0 +1,8 @@
<?php
require_once('WDTSTranscript.php');
class WDTSQueuedTranscript extends WDTSTranscript { var $key = "queued_transcripts"; }
class WDTSApprovedTranscript extends WDTSTranscript { var $key = "approved_transcripts"; }
?>

View File

@ -0,0 +1,34 @@
<?php
class WDTSTranscriptOptions {
var $post_id;
function __construct($post_id = null) {
if (is_numeric($post_id)) { $this->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'];
}
}
?>