summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2006-11-04 20:17:06 (GMT)
committer Earl Miles2006-11-04 20:17:06 (GMT)
commit610a39f5345f67ce9643fc8b504e59248da20634 (patch)
tree77a5737794555b6f39b0c56b4a20313ac72219f0
parent9ffe86096505503a36efc90891d8ca42078c6ab1 (diff)
Minor improvements to audio play list
-rw-r--r--views_bonus.module24
1 files changed, 15 insertions, 9 deletions
diff --git a/views_bonus.module b/views_bonus.module
index 1bfc414..64cf8b7 100644
--- a/views_bonus.module
+++ b/views_bonus.module
@@ -732,18 +732,24 @@ function views_bonus_audio_playlist($view, $nodes, $type) {
$output .= " <trackList>\n";
foreach ($nodes as $n) {
$node = node_load($n->nid);
- $output .= " <track>\n";
- $output .= " <annotation>" . check_plain($node->title) . "</annotation>\n";
- $output .= " <title>" . check_plain($node->audio_tags['title']) . "</title>\n";
- $output .= " <track>" . check_plain($node->audio_tags['track']) . "</track>\n";
- $output .= " <album>" . check_plain($node->audio_tags['album']) . "</album>\n";
- $output .= " <location>" . check_url($node->url_play) . "</location>\n";
- $output .= " <identifier>" . $node->nid . "</identifier>\n";
- $output .= " </track>\n";
+ $output .= theme('views_bonus_audio_track_xml', $node);
}
$output .= " </trackList>\n";
- $output .= " </playlist>\n";
+ $output .= "</playlist>\n";
drupal_set_header('Content-Type: text/xml; charset=utf-8');
print $output;
exit;
}
+
+function theme_views_bonus_audio_track_xml($node) {
+ $output .= " <track>\n";
+ $output .= " <annotation>" . check_plain($node->title) . "</annotation>\n";
+ $output .= " <title>" . check_plain($node->audio_tags['title']) . "</title>\n";
+ $output .= " <track>" . check_plain($node->audio_tags['track']) . "</track>\n";
+ $output .= " <album>" . check_plain($node->audio_tags['album']) . "</album>\n";
+ $output .= " <location>" . check_url($node->url_play) . "</location>\n";
+ $output .= " <info>" . url("node/$node->nid", NULL, NULL, TRUE) . "</info>\n";
+ $output .= " <identifier>" . $node->nid . "</identifier>\n";
+ $output .= " </track>\n";
+ return $output;
+}