feeds.plugins.inc 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. /**
  3. * @file
  4. * CTools plugins declarations.
  5. */
  6. /**
  7. * Break out for feeds_feed_plugins().
  8. */
  9. function _feeds_feeds_plugins() {
  10. $path = drupal_get_path('module', 'feeds') . '/plugins';
  11. $info = array();
  12. $info['FeedsPlugin'] = array(
  13. 'hidden' => TRUE,
  14. 'handler' => array(
  15. 'class' => 'FeedsPlugin',
  16. 'file' => 'FeedsPlugin.inc',
  17. 'path' => $path,
  18. ),
  19. );
  20. $info['FeedsMissingPlugin'] = array(
  21. 'name' => 'Missing plugin',
  22. 'description' => 'There is a problem with your configuration.',
  23. 'handler' => array(
  24. 'class' => 'FeedsMissingPlugin',
  25. 'file' => 'FeedsPlugin.inc',
  26. 'path' => $path,
  27. ),
  28. );
  29. $info['FeedsFetcher'] = array(
  30. 'hidden' => TRUE,
  31. 'handler' => array(
  32. 'parent' => 'FeedsPlugin',
  33. 'class' => 'FeedsFetcher',
  34. 'file' => 'FeedsFetcher.inc',
  35. 'path' => $path,
  36. ),
  37. );
  38. $info['FeedsParser'] = array(
  39. 'hidden' => TRUE,
  40. 'handler' => array(
  41. 'parent' => 'FeedsPlugin',
  42. 'class' => 'FeedsParser',
  43. 'file' => 'FeedsParser.inc',
  44. 'path' => $path,
  45. ),
  46. );
  47. $info['FeedsProcessor'] = array(
  48. 'hidden' => TRUE,
  49. 'handler' => array(
  50. 'parent' => 'FeedsPlugin',
  51. 'class' => 'FeedsProcessor',
  52. 'file' => 'FeedsProcessor.inc',
  53. 'path' => $path,
  54. ),
  55. );
  56. $info['FeedsHTTPFetcher'] = array(
  57. 'name' => 'HTTP Fetcher',
  58. 'description' => 'Download content from a URL.',
  59. 'handler' => array(
  60. 'parent' => 'FeedsFetcher', // This is the key name, not the class name.
  61. 'class' => 'FeedsHTTPFetcher',
  62. 'file' => 'FeedsHTTPFetcher.inc',
  63. 'path' => $path,
  64. ),
  65. );
  66. $info['FeedsFileFetcher'] = array(
  67. 'name' => 'File upload',
  68. 'description' => 'Upload content from a local file.',
  69. 'handler' => array(
  70. 'parent' => 'FeedsFetcher',
  71. 'class' => 'FeedsFileFetcher',
  72. 'file' => 'FeedsFileFetcher.inc',
  73. 'path' => $path,
  74. ),
  75. );
  76. $info['FeedsCSVParser'] = array(
  77. 'name' => 'CSV parser',
  78. 'description' => 'Parse data in Comma Separated Value format.',
  79. 'handler' => array(
  80. 'parent' => 'FeedsParser',
  81. 'class' => 'FeedsCSVParser',
  82. 'file' => 'FeedsCSVParser.inc',
  83. 'path' => $path,
  84. ),
  85. );
  86. if (extension_loaded('SimpleXML')) {
  87. $info['FeedsSyndicationParser'] = array(
  88. 'name' => 'Common syndication parser',
  89. 'description' => 'Parse RSS and Atom feeds.',
  90. 'help' => 'Parse XML feeds in RSS 1, RSS 2 and Atom format.',
  91. 'handler' => array(
  92. 'parent' => 'FeedsParser',
  93. 'class' => 'FeedsSyndicationParser',
  94. 'file' => 'FeedsSyndicationParser.inc',
  95. 'path' => $path,
  96. ),
  97. );
  98. }
  99. $info['FeedsOPMLParser'] = array(
  100. 'name' => 'OPML parser',
  101. 'description' => 'Parse OPML files.',
  102. 'handler' => array(
  103. 'parent' => 'FeedsParser',
  104. 'class' => 'FeedsOPMLParser',
  105. 'file' => 'FeedsOPMLParser.inc',
  106. 'path' => $path,
  107. ),
  108. );
  109. if (feeds_simplepie_exists()) {
  110. $info['FeedsSimplePieParser'] = array(
  111. 'name' => 'SimplePie parser',
  112. 'description' => 'Parse RSS and Atom feeds.',
  113. 'help' => 'Use <a href="http://simplepie.org">SimplePie</a> to parse XML feeds in RSS 1, RSS 2 and Atom format.',
  114. 'handler' => array(
  115. 'parent' => 'FeedsParser',
  116. 'class' => 'FeedsSimplePieParser',
  117. 'file' => 'FeedsSimplePieParser.inc',
  118. 'path' => $path,
  119. ),
  120. );
  121. }
  122. $info['FeedsSitemapParser'] = array(
  123. 'name' => 'Sitemap parser',
  124. 'description' => 'Parse Sitemap XML format feeds.',
  125. 'handler' => array(
  126. 'parent' => 'FeedsParser',
  127. 'class' => 'FeedsSitemapParser',
  128. 'file' => 'FeedsSitemapParser.inc',
  129. 'path' => $path,
  130. ),
  131. );
  132. $info['FeedsNodeProcessor'] = array(
  133. 'name' => 'Node processor',
  134. 'description' => 'Create and update nodes.',
  135. 'help' => 'Create and update nodes from parsed content.',
  136. 'handler' => array(
  137. 'parent' => 'FeedsProcessor',
  138. 'class' => 'FeedsNodeProcessor',
  139. 'file' => 'FeedsNodeProcessor.inc',
  140. 'path' => $path,
  141. ),
  142. );
  143. $info['FeedsUserProcessor'] = array(
  144. 'name' => 'User processor',
  145. 'description' => 'Create users.',
  146. 'help' => 'Create users from parsed content.',
  147. 'handler' => array(
  148. 'parent' => 'FeedsProcessor',
  149. 'class' => 'FeedsUserProcessor',
  150. 'file' => 'FeedsUserProcessor.inc',
  151. 'path' => $path,
  152. ),
  153. );
  154. if (module_exists('taxonomy')) {
  155. $info['FeedsTermProcessor'] = array(
  156. 'name' => 'Taxonomy term processor',
  157. 'description' => 'Create taxonomy terms.',
  158. 'help' => 'Create taxonomy terms from parsed content.',
  159. 'handler' => array(
  160. 'parent' => 'FeedsProcessor',
  161. 'class' => 'FeedsTermProcessor',
  162. 'file' => 'FeedsTermProcessor.inc',
  163. 'path' => $path,
  164. ),
  165. );
  166. }
  167. return $info;
  168. }