feeds_news.views_default.inc 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * @file
  4. * feeds_news.views_default.inc
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. */
  9. function feeds_news_views_default_views() {
  10. $export = array();
  11. $view = new view();
  12. $view->name = 'feeds_defaults_feed_items';
  13. $view->description = 'Show feed items for a feed node. Use together with default importer configuration "Feed".';
  14. $view->tag = 'Feeds defaults';
  15. $view->base_table = 'node';
  16. $view->human_name = '';
  17. $view->core = 0;
  18. $view->api_version = '3.0';
  19. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  20. /* Display: Defaults */
  21. $handler = $view->new_display('default', 'Defaults', 'default');
  22. $handler->display->display_options['use_more_always'] = FALSE;
  23. $handler->display->display_options['access']['type'] = 'perm';
  24. $handler->display->display_options['cache']['type'] = 'none';
  25. $handler->display->display_options['query']['type'] = 'views_query';
  26. $handler->display->display_options['query']['options']['query_comment'] = FALSE;
  27. $handler->display->display_options['exposed_form']['type'] = 'basic';
  28. $handler->display->display_options['pager']['type'] = 'full';
  29. $handler->display->display_options['style_plugin'] = 'default';
  30. $handler->display->display_options['row_plugin'] = 'node';
  31. /* No results behavior: Global: Text area */
  32. $handler->display->display_options['empty']['text']['id'] = 'area';
  33. $handler->display->display_options['empty']['text']['table'] = 'views';
  34. $handler->display->display_options['empty']['text']['field'] = 'area';
  35. $handler->display->display_options['empty']['text']['content'] = 'There are no items for this feed at the moment.';
  36. $handler->display->display_options['empty']['text']['format'] = '1';
  37. /* Relationship: Feeds item: Owner feed */
  38. $handler->display->display_options['relationships']['feed_nid_1']['id'] = 'feed_nid_1';
  39. $handler->display->display_options['relationships']['feed_nid_1']['table'] = 'feeds_item';
  40. $handler->display->display_options['relationships']['feed_nid_1']['field'] = 'feed_nid';
  41. $handler->display->display_options['relationships']['feed_nid_1']['required'] = TRUE;
  42. /* Sort criterion: Content: Post date */
  43. $handler->display->display_options['sorts']['created']['id'] = 'created';
  44. $handler->display->display_options['sorts']['created']['table'] = 'node';
  45. $handler->display->display_options['sorts']['created']['field'] = 'created';
  46. $handler->display->display_options['sorts']['created']['order'] = 'DESC';
  47. /* Contextual filter: Content: Nid */
  48. $handler->display->display_options['arguments']['nid']['id'] = 'nid';
  49. $handler->display->display_options['arguments']['nid']['table'] = 'node';
  50. $handler->display->display_options['arguments']['nid']['field'] = 'nid';
  51. $handler->display->display_options['arguments']['nid']['relationship'] = 'feed_nid_1';
  52. $handler->display->display_options['arguments']['nid']['default_action'] = 'not found';
  53. $handler->display->display_options['arguments']['nid']['title_enable'] = TRUE;
  54. $handler->display->display_options['arguments']['nid']['title'] = 'Articles from %1';
  55. $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'fixed';
  56. $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
  57. $handler->display->display_options['arguments']['nid']['specify_validation'] = TRUE;
  58. $handler->display->display_options['arguments']['nid']['validate']['type'] = 'node';
  59. $handler->display->display_options['arguments']['nid']['validate_options']['types'] = array(
  60. 'feed' => 'feed',
  61. );
  62. /* Filter criterion: Content: Type */
  63. $handler->display->display_options['filters']['type']['id'] = 'type';
  64. $handler->display->display_options['filters']['type']['table'] = 'node';
  65. $handler->display->display_options['filters']['type']['field'] = 'type';
  66. $handler->display->display_options['filters']['type']['value'] = array(
  67. 'feed_item' => 'feed_item',
  68. );
  69. $handler->display->display_options['filters']['type']['expose']['operator'] = FALSE;
  70. /* Display: Page */
  71. $handler = $view->new_display('page', 'Page', 'page_1');
  72. $handler->display->display_options['path'] = 'node/%/feed-items';
  73. $handler->display->display_options['menu']['type'] = 'tab';
  74. $handler->display->display_options['menu']['title'] = 'View items';
  75. $handler->display->display_options['menu']['weight'] = '-9';
  76. $export['feeds_defaults_feed_items'] = $view;
  77. return $export;
  78. }