feeds.views.inc

  1. cis7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  2. cle7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  3. ecd7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  4. elmsmedia7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  5. harmony7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  6. icor7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  7. meedjum_blog7 sites/all/modules/ulmus/feeds/views/feeds.views.inc
  8. mooc7 sites/all/modules/ulmus/feeds/views/feeds.views.inc

Views integration for Feeds tables.

See also

http://drupal.org/project/views

Functions

Namesort descending Description
feeds_views_data Implements hook_views_data().

File

sites/all/modules/ulmus/feeds/views/feeds.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Views integration for Feeds tables.
  5. *
  6. * @see http://drupal.org/project/views
  7. */
  8. /**
  9. * Implements hook_views_data().
  10. */
  11. function feeds_views_data() {
  12. $data = array();
  13. /**
  14. * Expose feeds_source table to views.
  15. */
  16. $data['feeds_source']['table'] = array(
  17. 'group' => 'Feeds source',
  18. 'base' => array(
  19. 'field' => array('feed_nid', 'id'),
  20. 'title' => 'Feeds source',
  21. 'help' => 'The source information for a feed, for example its URL',
  22. ),
  23. );
  24. $data['feeds_source']['feed_nid'] = array(
  25. 'title' => 'Feed node id',
  26. 'help' => 'Contains the node id of a feed node if the feed\'s configuration is attached to a content type, otherwise contains 0.',
  27. 'field' => array(
  28. 'handler' => 'views_handler_field_numeric',
  29. 'click sortable' => TRUE,
  30. ),
  31. 'filter' => array(
  32. 'handler' => 'views_handler_filter_numeric',
  33. 'allow empty' => TRUE,
  34. 'help' => 'Filter on a Feeds Source\'s feed_nid field.',
  35. ),
  36. 'argument' => array(
  37. 'handler' => 'views_handler_argument_numeric',
  38. 'numeric' => TRUE,
  39. 'validate type' => 'nid',
  40. 'help' => 'Argument on a Feeds Source\'s feed_nid field.',
  41. ),
  42. 'sort' => array(
  43. 'handler' => 'views_handler_sort',
  44. 'help' => 'Sort Feeds Source\'s feed_nid field.',
  45. ),
  46. );
  47. $data['feeds_source']['config'] = array(
  48. 'title' => 'Source',
  49. 'help' => 'The resource identifier for this feed. For instance a URL.',
  50. 'field' => array(
  51. 'handler' => 'feeds_views_handler_field_source',
  52. 'click sortable' => FALSE,
  53. ),
  54. );
  55. $data['feeds_source']['table']['join'] = array(
  56. 'node' => array(
  57. 'left_field' => 'nid',
  58. 'field' => 'feed_nid',
  59. 'type' => 'LEFT',
  60. ),
  61. );
  62. /**
  63. * Expose feeds_node_item table to views.
  64. */
  65. $data['feeds_item']['table'] = array(
  66. 'group' => 'Feeds item',
  67. );
  68. $data['feeds_item']['feed_nid'] = array(
  69. 'title' => t('Owner feed nid'),
  70. 'help' => t('The node id of the owner feed node if available.'),
  71. 'field' => array(
  72. 'handler' => 'views_handler_field_numeric',
  73. 'click sortable' => TRUE,
  74. ),
  75. 'filter' => array(
  76. 'handler' => 'views_handler_filter_numeric',
  77. 'allow empty' => TRUE,
  78. 'help' => t('Filter on Feed Items by the Feed they were generated from using the Node Id of the Feed Node.'),
  79. ),
  80. 'argument' => array(
  81. 'handler' => 'views_handler_argument_numeric',
  82. 'numeric' => TRUE,
  83. 'validate type' => 'nid',
  84. 'help' => t('Argument on Feed Items by the Feed they were generated from using the Node Id of the Feed Node.'),
  85. ),
  86. 'sort' => array(
  87. 'help' => t('Sort Feed Items by the Feed they were generated from using the Node Id of the Feed Node.'),
  88. ),
  89. 'relationship' => array(
  90. 'title' => t('Owner feed'),
  91. 'help' => t('Relate a feed item to its owner feed node if available.'),
  92. 'label' => t('Owner feed'),
  93. 'base' => 'node',
  94. 'base field' => 'nid',
  95. ),
  96. );
  97. $data['feeds_item']['url'] = array(
  98. 'title' => t('Item URL'),
  99. 'help' => t('Contains the URL of the feed item.'),
  100. 'field' => array(
  101. 'handler' => 'views_handler_field_url',
  102. 'click sortable' => TRUE,
  103. ),
  104. 'filter' => array(
  105. 'handler' => 'views_handler_filter_string',
  106. 'allow empty' => TRUE,
  107. 'help' => t('Filter on a Feeds Item\'s URL field.'),
  108. ),
  109. 'argument' => array(
  110. 'handler' => 'views_handler_argument_string',
  111. 'numeric' => TRUE,
  112. 'validate type' => 'nid',
  113. 'help' => t('Argument on a Feeds Item\'s URL field.'),
  114. ),
  115. 'sort' => array(
  116. 'help' => t('Sort on a Feeds Item\'s URL field.'),
  117. ),
  118. );
  119. $data['feeds_item']['guid'] = array(
  120. 'title' => t('Item GUID'),
  121. 'help' => t('Contains the GUID of the feed item.'),
  122. 'field' => array(
  123. 'click sortable' => TRUE,
  124. ),
  125. 'filter' => array(
  126. 'handler' => 'views_handler_filter_string',
  127. 'allow empty' => TRUE,
  128. 'help' => t('Filter on a Feeds Item\'s GUID field.'),
  129. ),
  130. 'argument' => array(
  131. 'handler' => 'views_handler_argument_string',
  132. 'numeric' => TRUE,
  133. 'validate type' => 'nid',
  134. 'help' => t('Argument on a Feeds Item\'s GUID field.'),
  135. ),
  136. 'sort' => array(
  137. 'help' => t('Sort on a Feeds Item\'s GUID field.'),
  138. ),
  139. );
  140. $data['feeds_item']['imported'] = array(
  141. 'title' => t('Import date'),
  142. 'help' => t('Contains the import date of the feed item.'),
  143. 'field' => array(
  144. 'handler' => 'views_handler_field_date',
  145. 'click sortable' => TRUE,
  146. ),
  147. 'sort' => array(
  148. 'handler' => 'views_handler_sort_date',
  149. 'help' => t('Sort on a Feeds Item\'s import date field.'),
  150. ),
  151. 'filter' => array(
  152. 'handler' => 'views_handler_filter_date',
  153. 'help' => t('Filter on a Feeds Item\'s import date field.'),
  154. ),
  155. 'argument' => array(
  156. 'handler' => 'views_handler_argument_date',
  157. 'numeric' => TRUE,
  158. 'validate type' => 'nid',
  159. 'help' => t('Argument on a Feeds Item\'s import date field.'),
  160. ),
  161. );
  162. // Add a relationship for each entity type relating the entity's base table
  163. // to the feeds_item table whre feeds_item.entity_type = 'entity_type'.
  164. foreach (array('node', 'taxonomy_term', 'user') as $entity_type) {
  165. $info = entity_get_info($entity_type);
  166. $data['feeds_item']['table']['join'][$info['base table']] = array(
  167. 'left_field' => $info['entity keys']['id'],
  168. 'field' => 'entity_id',
  169. 'type' => 'LEFT',
  170. 'extra' => array(
  171. array(
  172. 'table' => 'feeds_item',
  173. 'field' => 'entity_type',
  174. 'value' => $entity_type,
  175. 'operator' => '=',
  176. ),
  177. ),
  178. );
  179. }
  180. /**
  181. * Expose feeds_log table to views.
  182. */
  183. $data['feeds_log']['table'] = array(
  184. 'group' => 'Feeds log',
  185. 'base' => array(
  186. 'field' => array('flid'),
  187. 'title' => 'Feeds log',
  188. 'help' => 'Logs events during importing, clearing, expiry.',
  189. ),
  190. );
  191. $data['feeds_log']['id'] = array(
  192. 'title' => 'Importer id',
  193. 'help' => 'The id of an importer.',
  194. 'field' => array(
  195. 'handler' => 'views_handler_field',
  196. 'click sortable' => TRUE,
  197. ),
  198. 'filter' => array(
  199. 'handler' => 'views_handler_filter_string',
  200. 'allow empty' => TRUE,
  201. 'help' => 'Filter on an importer id.',
  202. ),
  203. 'argument' => array(
  204. 'handler' => 'feeds_views_handler_argument_importer_id',
  205. 'help' => 'Filter on an importer id.',
  206. ),
  207. 'sort' => array(
  208. 'handler' => 'views_handler_sort',
  209. 'help' => 'Sort by importer id.',
  210. ),
  211. 'relationship' => array(
  212. 'title' => t('Importer'),
  213. 'help' => t('Relate a log entry to its importer if available.'),
  214. 'label' => t('Importer'),
  215. 'base' => 'feeds_importer',
  216. 'base field' => 'id',
  217. ),
  218. );
  219. $data['feeds_log']['importer_name'] = array(
  220. 'real field' => 'id',
  221. 'title' => 'Importer name',
  222. 'help' => 'The human readable name of an importer.',
  223. 'field' => array(
  224. 'handler' => 'feeds_views_handler_field_importer_name',
  225. ),
  226. );
  227. $data['feeds_log']['feed_nid'] = array(
  228. 'title' => 'Feed node id',
  229. 'help' => 'Contains the node id of a feed node if the feed\'s configuration is attached to a content type, otherwise contains 0.',
  230. 'field' => array(
  231. 'handler' => 'views_handler_field_numeric',
  232. 'click sortable' => TRUE,
  233. ),
  234. 'filter' => array(
  235. 'handler' => 'views_handler_filter_numeric',
  236. 'allow empty' => TRUE,
  237. 'help' => 'Filter on a Feeds Source\'s feed_nid field.',
  238. ),
  239. 'argument' => array(
  240. 'handler' => 'views_handler_argument_numeric',
  241. 'numeric' => TRUE,
  242. 'validate type' => 'nid',
  243. 'help' => 'Argument on a Feeds Source\'s feed_nid field.',
  244. ),
  245. 'sort' => array(
  246. 'handler' => 'views_handler_sort',
  247. 'help' => 'Sort Feeds Source\'s feed_nid field.',
  248. ),
  249. 'relationship' => array(
  250. 'title' => t('Feed node'),
  251. 'help' => t('Relate a log entry to its feed node if available.'),
  252. 'label' => t('Feed node'),
  253. 'base' => 'node',
  254. 'base field' => 'nid',
  255. ),
  256. );
  257. $data['feeds_log']['log_time'] = array(
  258. 'title' => t('Log time'),
  259. 'help' => t('The time of the event.'),
  260. 'field' => array(
  261. 'handler' => 'views_handler_field_date',
  262. 'click sortable' => TRUE,
  263. ),
  264. 'sort' => array(
  265. 'handler' => 'views_handler_sort_date',
  266. ),
  267. 'filter' => array(
  268. 'handler' => 'views_handler_filter_date',
  269. ),
  270. );
  271. $data['feeds_log']['request_time'] = array(
  272. 'title' => t('Request time'),
  273. 'help' => t('The time of the page request of an event.'),
  274. 'field' => array(
  275. 'handler' => 'views_handler_field_date',
  276. 'click sortable' => TRUE,
  277. ),
  278. 'sort' => array(
  279. 'handler' => 'views_handler_sort_date',
  280. ),
  281. 'filter' => array(
  282. 'handler' => 'views_handler_filter_date',
  283. ),
  284. );
  285. $data['feeds_log']['message'] = array(
  286. 'title' => 'Log message',
  287. 'help' => 'The message logged by the event.',
  288. 'field' => array(
  289. 'handler' => 'feeds_views_handler_field_log_message',
  290. 'click sortable' => FALSE,
  291. 'additional fields' => array(
  292. 'variables',
  293. ),
  294. ),
  295. );
  296. $data['feeds_log']['severity'] = array(
  297. 'title' => 'Severity',
  298. 'help' => 'The severity of the event logged.',
  299. 'field' => array(
  300. 'handler' => 'feeds_views_handler_field_severity',
  301. 'click sortable' => FALSE,
  302. ),
  303. 'filter' => array(
  304. 'handler' => 'feeds_views_handler_filter_severity',
  305. 'allow empty' => TRUE,
  306. 'help' => 'Filter on the severity of a log message.',
  307. ),
  308. );
  309. $data['feeds_log']['table']['join'] = array(
  310. 'node' => array(
  311. 'left_field' => 'nid',
  312. 'field' => 'feed_nid',
  313. 'type' => 'LEFT',
  314. ),
  315. );
  316. return $data;
  317. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.