views_rss_media.module 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * @file
  4. * Provides Media RSS namespace, <channel> and <item> elements for Views RSS module.
  5. */
  6. /**
  7. * Module installation path.
  8. */
  9. define('VIEWS_RSS_MEDIA_PATH', drupal_get_path('module', 'views_rss_media'));
  10. /**
  11. * Include file with field formatters.
  12. */
  13. include_once VIEWS_RSS_MEDIA_PATH .'/views_rss_media.field.inc';
  14. /**
  15. * Include file with all preprocess functions.
  16. */
  17. include_once VIEWS_RSS_MEDIA_PATH .'/views_rss_media.inc';
  18. /**
  19. * Implements hook_views_rss_namespaces().
  20. */
  21. function views_rss_media_views_rss_namespaces() {
  22. $namespaces['media'] = array(
  23. 'prefix' => 'xmlns',
  24. 'uri' => 'http://search.yahoo.com/mrss/',
  25. );
  26. return $namespaces;
  27. }
  28. /**
  29. * Implements hook_views_rss_item_elements().
  30. */
  31. function views_rss_media_views_rss_item_elements() {
  32. $elements['media:content'] = array(
  33. 'description' => t('Contains the primary metadata entries needed to index and organize media content.'),
  34. 'preprocess functions' => array('views_rss_media_preprocess_item_content'),
  35. 'help' => 'http://www.rssboard.org/media-rss#media-content',
  36. );
  37. $elements['media:title'] = array(
  38. 'description' => t('The title of the particular media object.'),
  39. 'preprocess functions' => array(
  40. 'views_rss_htmlspecialchars',
  41. 'views_rss_media_preprocess_item_text',
  42. ),
  43. 'help' => 'http://www.rssboard.org/media-rss#media-title',
  44. );
  45. $elements['media:description'] = array(
  46. 'description' => t('Short description describing the media object typically a sentence in length.'),
  47. 'preprocess functions' => array(
  48. 'views_rss_htmlspecialchars',
  49. 'views_rss_media_preprocess_item_text',
  50. ),
  51. 'help' => 'http://www.rssboard.org/media-rss#media-description',
  52. );
  53. $elements['media:keywords'] = array(
  54. 'description' => t('Highly relevant keywords describing the media object with typically a maximum of 10 words. The keywords and phrases should be comma-delimited.'),
  55. 'help' => 'http://www.rssboard.org/media-rss#media-keywords',
  56. );
  57. $elements['media:thumbnail'] = array(
  58. 'description' => t('Allows particular images to be used as representative images for the media object.'),
  59. 'help' => 'http://www.rssboard.org/media-rss#media-thumbnails',
  60. );
  61. $elements['media:category'] = array(
  62. 'description' => t('Allows a taxonomy to be set that gives an indication of the type of media content, and its particular contents.'),
  63. 'preprocess functions' => array('views_rss_media_preprocess_item_category'),
  64. 'help' => 'http://www.rssboard.org/media-rss#media-category',
  65. );
  66. return $elements;
  67. }