You are here

views_rss_itunes.module in Views RSS: iTunes Elements 8

Same filename and directory in other branches
  1. 6 views_rss_itunes.module
  2. 7 views_rss_itunes.module

Provides iTunes namespace, <channel> and <item> elements for Views RSS module.

File

views_rss_itunes.module
View source
<?php

/**
 * @file
 * Provides iTunes namespace, <channel> and <item> elements for Views RSS module.
 */

/**
 * Include file with all preprocess functions.
 */
include_once drupal_get_path('module', 'views_rss_itunes') . '/views_rss_itunes.inc';

/**
 * Implements hook_views_rss_namespaces().
 */
function views_rss_itunes_views_rss_namespaces() {
  $namespaces['itunes'] = array(
    'prefix' => 'xmlns',
    'uri' => 'http://www.itunes.com/dtds/podcast-1.0.dtd',
  );
  return $namespaces;
}

/**
 * Implements hook_views_rss_channel_elements().
 */
function views_rss_itunes_views_rss_channel_elements() {
  $elements['itunes:subtitle'] = array(
    'description' => t('The contents of this tag are shown in the Description column in iTunes. The subtitle displays best if it is only a few words long.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#subtitle',
  );
  $elements['itunes:summary'] = array(
    'settings form' => array(
      '#type' => 'textarea',
      '#rows' => 3,
    ),
    'description' => t('The contents of this tag are shown in a separate window that appears when the "circled i" in the Description column is clicked. It also appears on the iTunes page for your podcast. This field can be up to 4000 characters. If &lt;itunes:summary&gt; is not included, the contents of the &lt;description&gt; tag are used.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#summary',
  );
  $elements['itunes:category'] = array(
    'description' => t('Category column and in iTunes Store Browse.'),
    'settings form' => array(
      '#type' => 'select',
      '#multiple' => TRUE,
      '#size' => 3,
    ),
    'settings form options callback' => 'views_rss_itunes_get_category_options',
    'preprocess functions' => array(
      'views_rss_itunes_preprocess_channel_category',
    ),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#category',
  );
  $elements['itunes:keywords'] = array(
    'description' => t('This tag allows users to search on a maximum of 12 text keywords. Use commas to separate keywords. Not visible in iTunes.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#keywords',
  );
  $elements['itunes:image'] = array(
    'description' => t('Path to the image to be used as the artwork for your podcast, for example <em>sites/default/files/AllAboutEverything.jpg</em>. iTunes prefers square .jpg images that are at least 600 x 600 pixels. iTunes supports images in JPEG and PNG formats with a RGB color space (CMYK is not supported). If the tag is not present, iTunes will use the contents of the RSS &lt;image&gt; tag.'),
    'preprocess functions' => array(
      'views_rss_itunes_preprocess_channel_image',
    ),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#image',
  );
  $elements['itunes:author'] = array(
    'description' => t('The content of this tag is shown in the Artist column in iTunes. If the tag is not present, iTunes uses the contents of the &lt;author&gt; tag. If &lt;itunes:author&gt; is not present at the feed level, iTunes will use the contents of &lt;managingEditor&gt;.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#author',
  );
  $elements['itunes:explicit'] = array(
    'settings form' => array(
      '#type' => 'select',
      '#options' => array(
        '',
        'yes',
        'no',
        'clean',
      ),
    ),
    'description' => t('This tag should be used to indicate whether or not your podcast contains explicit material.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#explicit',
  );
  $elements['itunes:block'] = array(
    'settings form' => array(
      '#type' => 'select',
      '#options' => array(
        '',
        'yes',
        'no',
      ),
    ),
    'description' => t('If this tag is present and set to "yes", that means to block the feed. If the tag\'s value is any other value, including empty string, it\'s indicated as a signal to unblock the feed. If there is no block tag, then the block status of the feed is left unchanged.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#block',
  );
  $elements['itunes:complete'] = array(
    'settings form' => array(
      '#type' => 'select',
      '#options' => array(
        '',
        'yes',
        'no',
      ),
    ),
    'description' => t('This tag can be used to indicate the completion of a podcast. If you populate this tag with "yes", you are indicating that no more episodes will be added to the podcast. If the &lt;itunes:complete&gt; tag is present and has any other value (e.g. "no"), it will have no effect on the podcast.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#complete',
  );
  $elements['itunes:new-feed-url'] = array(
    'description' => t('This tag allows you to change the URL where the podcast feed is located. After adding the tag to your old feed, you should maintain the old feed for 48 hours before retiring it. At that point, iTunes will have updated the directory with the new feed URL.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#newfeed',
  );
  $elements['itunes:owner'] = array(
    'description' => t('This tag contains information that will be used to contact the owner of the podcast for communication specifically about their podcast. It will not be publicly displayed. Enter owner\'s email address followed by their name, separating them with comma.'),
    'preprocess functions' => array(
      'views_rss_itunes_preprocess_channel_owner',
    ),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#owner',
  );
  return $elements;
}

/**
 * Implements hook_views_rss_item_elements().
 */
function views_rss_itunes_views_rss_item_elements() {
  $elements['itunes:subtitle'] = array(
    'description' => t('The contents of this tag are shown in the Description column in iTunes. The subtitle displays best if it is only a few words long.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#subtitle',
  );
  $elements['itunes:summary'] = array(
    'description' => t('The contents of this tag are shown in a separate window that appears when the "circled i" in the Description column is clicked. It also appears on the iTunes page for your podcast. This field can be up to 4000 characters. If &lt;itunes:summary&gt; is not included, the contents of the &lt;description&gt; tag are used.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#summary',
  );
  $elements['itunes:duration'] = array(
    'description' => t('The content of this tag is shown in the Time column in iTunes.'),
    'preprocess functions' => array(
      'views_rss_itunes_preprocess_item_duration',
    ),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#duration',
  );
  $elements['itunes:keywords'] = array(
    'description' => t('This tag allows users to search on a maximum of 12 text keywords. Use commas to separate keywords. Not visible in iTunes.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#keywords',
  );
  $elements['itunes:image'] = array(
    'description' => t('This tag specifies the artwork for your podcast. iTunes prefers square .jpg images that are at least 600 x 600 pixels. iTunes supports images in JPEG and PNG formats with a RGB color space (CMYK is not supported). If the tag is not present, iTunes will use the contents of the RSS &lt;image&gt; tag.'),
    'preprocess functions' => array(
      'views_rss_itunes_preprocess_item_image',
    ),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#image',
  );
  $elements['itunes:author'] = array(
    'description' => t('The content of this tag is shown in the Artist column in iTunes. If the tag is not present, iTunes uses the contents of the &lt;author&gt; tag. If &lt;itunes:author&gt; is not present at the feed level, iTunes will use the contents of &lt;managingEditor&gt;.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#author',
  );
  $elements['itunes:isClosedCaptioned'] = array(
    'description' => t('This tag should be used if your podcast includes a video episode with embedded closed captioning support. The two values for this tag are "yes" and "no".'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#isClosedCaptioned',
  );
  $elements['itunes:explicit'] = array(
    'description' => t('This tag should be used to indicate whether or not your podcast contains explicit material.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#explicit',
  );
  $elements['itunes:block'] = array(
    'description' => t('If this tag is present and set to "yes", that means to block the episode. If the tag\'s value is any other value, including empty string, it\'s indicated as a signal to unblock the episode. If there is no block tag, it is the same as if a block=no were present.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#block',
  );
  $elements['itunes:order'] = array(
    'description' => t('This tag can be used to override the default ordering of episodes on the store. This tag is used at an &lt;item&gt; level by populating with the number value in which you would like the episode to appear on the store.'),
    'help' => 'http://www.apple.com/itunes/podcasts/specs.html#order',
  );
  return $elements;
}

Functions

Namesort descending Description
views_rss_itunes_views_rss_channel_elements Implements hook_views_rss_channel_elements().
views_rss_itunes_views_rss_item_elements Implements hook_views_rss_item_elements().
views_rss_itunes_views_rss_namespaces Implements hook_views_rss_namespaces().