comment.views_default.inc 14 KB

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