comment.views_default.inc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?php
  2. /**
  3. * @file
  4. * Bulk export of views_default objects generated by Bulk export module.
  5. */
  6. /**
  7. * Implementation of hook_views_default_views()
  8. */
  9. function comment_views_default_views() {
  10. $views = array();
  11. $view = new view;
  12. $view->name = 'comments_recent';
  13. $view->description = 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.';
  14. $view->tag = 'default';
  15. $view->base_table = 'comment';
  16. $view->human_name = 'Recent comments';
  17. $view->core = 0;
  18. $view->api_version = '3.0';
  19. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  20. /* Display: Master */
  21. $handler = $view->new_display('default', 'Master', 'default');
  22. $handler->display->display_options['title'] = 'Recent comments';
  23. $handler->display->display_options['use_more'] = TRUE;
  24. $handler->display->display_options['access']['type'] = 'none';
  25. $handler->display->display_options['cache']['type'] = 'none';
  26. $handler->display->display_options['query']['type'] = 'views_query';
  27. $handler->display->display_options['query']['options']['query_comment'] = FALSE;
  28. $handler->display->display_options['exposed_form']['type'] = 'basic';
  29. $handler->display->display_options['pager']['type'] = 'some';
  30. $handler->display->display_options['pager']['options']['items_per_page'] = 5;
  31. $handler->display->display_options['style_plugin'] = 'list';
  32. $handler->display->display_options['row_plugin'] = 'fields';
  33. /* Relationship: Comment: Content */
  34. $handler->display->display_options['relationships']['nid']['id'] = 'nid';
  35. $handler->display->display_options['relationships']['nid']['table'] = 'comment';
  36. $handler->display->display_options['relationships']['nid']['field'] = 'nid';
  37. /* Field: Comment: Title */
  38. $handler->display->display_options['fields']['subject']['id'] = 'subject';
  39. $handler->display->display_options['fields']['subject']['table'] = 'comment';
  40. $handler->display->display_options['fields']['subject']['field'] = 'subject';
  41. $handler->display->display_options['fields']['subject']['label'] = '';
  42. $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
  43. /* Field: Comment: Updated date */
  44. $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  45. $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
  46. $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
  47. $handler->display->display_options['fields']['timestamp']['label'] = '';
  48. $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
  49. /* Sort criterion: Comment: Updated date */
  50. $handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
  51. $handler->display->display_options['sorts']['timestamp']['table'] = 'comment';
  52. $handler->display->display_options['sorts']['timestamp']['field'] = 'changed';
  53. $handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
  54. /* Filter criterion: Content: Published or admin */
  55. $handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
  56. $handler->display->display_options['filters']['status_extra']['table'] = 'node';
  57. $handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
  58. $handler->display->display_options['filters']['status_extra']['relationship'] = 'nid';
  59. $handler->display->display_options['filters']['status_extra']['group'] = 0;
  60. /* Display: Page */
  61. $handler = $view->new_display('page', 'Page', 'page');
  62. $handler->display->display_options['defaults']['style_plugin'] = FALSE;
  63. $handler->display->display_options['style_plugin'] = 'list';
  64. $handler->display->display_options['defaults']['style_options'] = FALSE;
  65. $handler->display->display_options['defaults']['row_plugin'] = FALSE;
  66. $handler->display->display_options['row_plugin'] = 'fields';
  67. $handler->display->display_options['row_options']['inline'] = array(
  68. 'title' => 'title',
  69. 'timestamp' => 'timestamp',
  70. );
  71. $handler->display->display_options['row_options']['separator'] = '&nbsp;';
  72. $handler->display->display_options['defaults']['row_options'] = FALSE;
  73. $handler->display->display_options['defaults']['fields'] = FALSE;
  74. /* Field: Content: Title */
  75. $handler->display->display_options['fields']['title']['id'] = 'title';
  76. $handler->display->display_options['fields']['title']['table'] = 'node';
  77. $handler->display->display_options['fields']['title']['field'] = 'title';
  78. $handler->display->display_options['fields']['title']['relationship'] = 'nid';
  79. $handler->display->display_options['fields']['title']['label'] = 'Reply to';
  80. $handler->display->display_options['fields']['title']['link_to_node'] = 1;
  81. /* Field: Comment: Updated date */
  82. $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  83. $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
  84. $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
  85. $handler->display->display_options['fields']['timestamp']['label'] = '';
  86. $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
  87. /* Field: Comment: Title */
  88. $handler->display->display_options['fields']['subject']['id'] = 'subject';
  89. $handler->display->display_options['fields']['subject']['table'] = 'comment';
  90. $handler->display->display_options['fields']['subject']['field'] = 'subject';
  91. $handler->display->display_options['fields']['subject']['label'] = '';
  92. $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
  93. /* Field: Comment: Comment */
  94. $handler->display->display_options['fields']['comment']['id'] = 'comment';
  95. $handler->display->display_options['fields']['comment']['table'] = 'field_data_comment_body';
  96. $handler->display->display_options['fields']['comment']['field'] = 'comment_body';
  97. $handler->display->display_options['fields']['comment']['label'] = '';
  98. $handler->display->display_options['path'] = 'comments/recent';
  99. /* Display: Block */
  100. $handler = $view->new_display('block', 'Block', 'block');
  101. $translatables['comments_recent'] = array(
  102. t('Master'),
  103. t('Recent comments'),
  104. t('more'),
  105. t('Apply'),
  106. t('Reset'),
  107. t('Sort by'),
  108. t('Asc'),
  109. t('Desc'),
  110. t('Content'),
  111. t('Page'),
  112. t('Reply to'),
  113. t('Block'),
  114. );
  115. $views['comments_recent'] = $view;
  116. $view = new view;
  117. $view->name = 'tracker';
  118. $view->description = 'Shows all new activity on system.';
  119. $view->tag = 'default';
  120. $view->base_table = 'node';
  121. $view->human_name = 'Tracker';
  122. $view->core = 0;
  123. $view->api_version = '3.0';
  124. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  125. /* Display: Master */
  126. $handler = $view->new_display('default', 'Master', 'default');
  127. $handler->display->display_options['title'] = 'Recent posts';
  128. $handler->display->display_options['access']['type'] = 'none';
  129. $handler->display->display_options['cache']['type'] = 'none';
  130. $handler->display->display_options['query']['type'] = 'views_query';
  131. $handler->display->display_options['query']['options']['query_comment'] = FALSE;
  132. $handler->display->display_options['exposed_form']['type'] = 'basic';
  133. $handler->display->display_options['pager']['type'] = 'full';
  134. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  135. $handler->display->display_options['style_plugin'] = 'table';
  136. $handler->display->display_options['style_options']['columns'] = array(
  137. 'type' => 'type',
  138. 'title' => 'title',
  139. 'name' => 'name',
  140. 'comment_count' => 'comment_count',
  141. 'last_comment_timestamp' => 'last_comment_timestamp',
  142. 'timestamp' => 'title',
  143. 'new_comments' => 'comment_count',
  144. );
  145. $handler->display->display_options['style_options']['default'] = 'last_comment_timestamp';
  146. $handler->display->display_options['style_options']['info'] = array(
  147. 'type' => array(
  148. 'sortable' => 1,
  149. 'separator' => '',
  150. ),
  151. 'title' => array(
  152. 'sortable' => 1,
  153. 'separator' => '&nbsp;',
  154. ),
  155. 'name' => array(
  156. 'sortable' => 1,
  157. 'separator' => '',
  158. ),
  159. 'comment_count' => array(
  160. 'sortable' => 1,
  161. 'separator' => '<br />',
  162. ),
  163. 'last_comment_timestamp' => array(
  164. 'sortable' => 1,
  165. 'separator' => '&nbsp;',
  166. ),
  167. 'timestamp' => array(
  168. 'separator' => '',
  169. ),
  170. 'new_comments' => array(
  171. 'separator' => '',
  172. ),
  173. );
  174. $handler->display->display_options['style_options']['override'] = 1;
  175. $handler->display->display_options['style_options']['order'] = 'desc';
  176. /* Relationship: Content: Author */
  177. $handler->display->display_options['relationships']['uid']['id'] = 'uid';
  178. $handler->display->display_options['relationships']['uid']['table'] = 'node';
  179. $handler->display->display_options['relationships']['uid']['field'] = 'uid';
  180. /* Field: Content: Type */
  181. $handler->display->display_options['fields']['type']['id'] = 'type';
  182. $handler->display->display_options['fields']['type']['table'] = 'node';
  183. $handler->display->display_options['fields']['type']['field'] = 'type';
  184. /* Field: Content: Title */
  185. $handler->display->display_options['fields']['title']['id'] = 'title';
  186. $handler->display->display_options['fields']['title']['table'] = 'node';
  187. $handler->display->display_options['fields']['title']['field'] = 'title';
  188. /* Field: User: Name */
  189. $handler->display->display_options['fields']['name']['id'] = 'name';
  190. $handler->display->display_options['fields']['name']['table'] = 'users';
  191. $handler->display->display_options['fields']['name']['field'] = 'name';
  192. $handler->display->display_options['fields']['name']['relationship'] = 'uid';
  193. $handler->display->display_options['fields']['name']['label'] = 'Author';
  194. /* Field: Content: Comment count */
  195. $handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
  196. $handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
  197. $handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
  198. $handler->display->display_options['fields']['comment_count']['label'] = 'Replies';
  199. /* Field: Content: Last comment time */
  200. $handler->display->display_options['fields']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
  201. $handler->display->display_options['fields']['last_comment_timestamp']['table'] = 'node_comment_statistics';
  202. $handler->display->display_options['fields']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
  203. $handler->display->display_options['fields']['last_comment_timestamp']['label'] = 'Last Post';
  204. /* Field: Content: Has new content */
  205. $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
  206. $handler->display->display_options['fields']['timestamp']['table'] = 'history';
  207. $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
  208. $handler->display->display_options['fields']['timestamp']['label'] = '';
  209. $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
  210. $handler->display->display_options['fields']['timestamp']['comments'] = 1;
  211. /* Field: Content: New comments */
  212. $handler->display->display_options['fields']['new_comments']['id'] = 'new_comments';
  213. $handler->display->display_options['fields']['new_comments']['table'] = 'node';
  214. $handler->display->display_options['fields']['new_comments']['field'] = 'new_comments';
  215. $handler->display->display_options['fields']['new_comments']['label'] = '';
  216. $handler->display->display_options['fields']['new_comments']['hide_empty'] = TRUE;
  217. $handler->display->display_options['fields']['new_comments']['suffix'] = ' new';
  218. $handler->display->display_options['fields']['new_comments']['link_to_comment'] = 1;
  219. /* Sort criterion: Content: Last comment time */
  220. $handler->display->display_options['sorts']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
  221. $handler->display->display_options['sorts']['last_comment_timestamp']['table'] = 'node_comment_statistics';
  222. $handler->display->display_options['sorts']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
  223. /* Contextual filter: Content: User posted or commented */
  224. $handler->display->display_options['arguments']['uid_touch']['id'] = 'uid_touch';
  225. $handler->display->display_options['arguments']['uid_touch']['table'] = 'node';
  226. $handler->display->display_options['arguments']['uid_touch']['field'] = 'uid_touch';
  227. $handler->display->display_options['arguments']['uid_touch']['exception']['title_enable'] = 1;
  228. $handler->display->display_options['arguments']['uid_touch']['title_enable'] = 1;
  229. $handler->display->display_options['arguments']['uid_touch']['title'] = 'Recent posts for %1';
  230. $handler->display->display_options['arguments']['uid_touch']['default_argument_type'] = 'fixed';
  231. $handler->display->display_options['arguments']['uid_touch']['summary']['format'] = 'default_summary';
  232. $handler->display->display_options['arguments']['uid_touch']['specify_validation'] = 1;
  233. /* Filter criterion: Content: Published */
  234. $handler->display->display_options['filters']['status']['id'] = 'status';
  235. $handler->display->display_options['filters']['status']['table'] = 'node';
  236. $handler->display->display_options['filters']['status']['field'] = 'status';
  237. $handler->display->display_options['filters']['status']['value'] = '1';
  238. $handler->display->display_options['filters']['status']['group'] = 0;
  239. $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
  240. /* Display: Page */
  241. $handler = $view->new_display('page', 'Page', 'page');
  242. $handler->display->display_options['path'] = 'tracker';
  243. $handler->display->display_options['menu']['type'] = 'normal';
  244. $handler->display->display_options['menu']['title'] = 'Recent posts';
  245. $translatables['tracker'] = array(
  246. t('Master'),
  247. t('Recent posts'),
  248. t('more'),
  249. t('Apply'),
  250. t('Reset'),
  251. t('Sort by'),
  252. t('Asc'),
  253. t('Desc'),
  254. t('Items per page'),
  255. t('- All -'),
  256. t('Offset'),
  257. t('Type'),
  258. t('Title'),
  259. t('Author'),
  260. t('Replies'),
  261. t('.'),
  262. t(','),
  263. t('Last Post'),
  264. t(' new'),
  265. t('All'),
  266. t('Recent posts for %1'),
  267. t('Page'),
  268. );
  269. $views['tracker'] = $view;
  270. return $views;
  271. }