tracker.views.inc

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

Provide views data and handlers for tracker.module.

Functions

Namesort descending Description
tracker_views_data Implementation of hook_views_data().
tracker_views_data_alter Implementation of hook_views_data_alter().

File

sites/all/modules/ulmus/views/modules/tracker.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Provide views data and handlers for tracker.module.
  5. *
  6. * @ingroup views_module_handlers
  7. */
  8. /**
  9. * Implementation of hook_views_data().
  10. */
  11. function tracker_views_data() {
  12. $data = array();
  13. $data['tracker_node']['table']['group'] = t('Tracker');
  14. $data['tracker_node']['table']['join'] = array(
  15. 'node' => array(
  16. 'type' => 'INNER',
  17. 'left_field' => 'nid',
  18. 'field' => 'nid',
  19. ),
  20. );
  21. $data['tracker_node']['nid'] = array(
  22. 'title' => t('Nid'),
  23. 'help' => t('The node ID of the node.'),
  24. 'field' => array(
  25. 'handler' => 'views_handler_field_node',
  26. 'click sortable' => TRUE,
  27. ),
  28. 'argument' => array(
  29. 'handler' => 'views_handler_argument_node_nid',
  30. 'name field' => 'title',
  31. 'numeric' => TRUE,
  32. 'validate type' => 'nid',
  33. ),
  34. 'filter' => array(
  35. 'handler' => 'views_handler_filter_numeric',
  36. ),
  37. 'sort' => array(
  38. 'handler' => 'views_handler_sort',
  39. ),
  40. );
  41. $data['tracker_node']['changed'] = array(
  42. 'title' => t('Updated date'),
  43. 'help' => t('The date the node was last updated.'),
  44. 'field' => array(
  45. 'handler' => 'views_handler_field_date',
  46. 'click sortable' => TRUE,
  47. ),
  48. 'sort' => array(
  49. 'handler' => 'views_handler_sort_date',
  50. ),
  51. 'filter' => array(
  52. 'handler' => 'views_handler_filter_date',
  53. ),
  54. );
  55. $data['tracker_node']['published'] = array(
  56. 'title' => t('Published'),
  57. 'help' => t('Whether or not the node is published.'),
  58. 'field' => array(
  59. 'handler' => 'views_handler_field_boolean',
  60. 'click sortable' => TRUE,
  61. ),
  62. 'filter' => array(
  63. 'handler' => 'views_handler_filter_tracker_boolean_operator',
  64. 'label' => t('Published'),
  65. 'type' => 'yes-no',
  66. ),
  67. 'sort' => array(
  68. 'handler' => 'views_handler_sort',
  69. ),
  70. );
  71. $data['tracker_user']['table']['group'] = t('Tracker - User');
  72. $data['tracker_user']['table']['join'] = array(
  73. 'node' => array(
  74. 'type' => 'INNER',
  75. 'left_field' => 'nid',
  76. 'field' => 'nid',
  77. ),
  78. 'user' => array(
  79. 'type' => 'INNER',
  80. 'left_field' => 'uid',
  81. 'field' => 'uid',
  82. ),
  83. );
  84. $data['tracker_user']['nid'] = array(
  85. 'title' => t('Nid'),
  86. 'help' => t('The node ID of the node a user created or commented on. You must use an argument or filter on UID or you will get misleading results using this field.'),
  87. 'field' => array(
  88. 'handler' => 'views_handler_field_node',
  89. 'click sortable' => TRUE,
  90. ),
  91. 'argument' => array(
  92. 'handler' => 'views_handler_argument_node_nid',
  93. 'name field' => 'title',
  94. 'numeric' => TRUE,
  95. 'validate type' => 'nid',
  96. ),
  97. 'filter' => array(
  98. 'handler' => 'views_handler_filter_numeric',
  99. ),
  100. 'sort' => array(
  101. 'handler' => 'views_handler_sort',
  102. ),
  103. );
  104. $data['tracker_user']['uid'] = array(
  105. 'title' => t('Uid'),
  106. 'help' => t('The user ID of a user who touched the node (either created or commented on it).'),
  107. 'field' => array(
  108. 'handler' => 'views_handler_field_user',
  109. 'click sortable' => TRUE,
  110. ),
  111. 'argument' => array(
  112. 'handler' => 'views_handler_argument_user_uid',
  113. 'name field' => 'name',
  114. ),
  115. 'filter' => array(
  116. 'title' => t('Name'),
  117. 'handler' => 'views_handler_filter_user_name',
  118. ),
  119. 'sort' => array(
  120. 'handler' => 'views_handler_sort',
  121. ),
  122. );
  123. $data['tracker_user']['changed'] = array(
  124. 'title' => t('Updated date'),
  125. 'help' => t('The date the node was last updated or commented on. You must use an argument or filter on UID or you will get misleading results using this field.'),
  126. 'field' => array(
  127. 'handler' => 'views_handler_field_date',
  128. 'click sortable' => TRUE,
  129. ),
  130. 'sort' => array(
  131. 'handler' => 'views_handler_sort_date',
  132. ),
  133. 'filter' => array(
  134. 'handler' => 'views_handler_filter_date',
  135. ),
  136. );
  137. $data['tracker_user']['published'] = array(
  138. 'title' => t('Published'),
  139. 'help' => t('Whether or not the node is published. You must use an argument or filter on UID or you will get misleading results using this field.'),
  140. 'field' => array(
  141. 'handler' => 'views_handler_field_boolean',
  142. 'click sortable' => TRUE,
  143. ),
  144. 'filter' => array(
  145. 'handler' => 'views_handler_filter_tracker_boolean_operator',
  146. 'label' => t('Published'),
  147. 'type' => 'yes-no',
  148. ),
  149. 'sort' => array(
  150. 'handler' => 'views_handler_sort',
  151. ),
  152. );
  153. return $data;
  154. }
  155. /**
  156. * Implementation of hook_views_data_alter().
  157. */
  158. function tracker_views_data_alter(&$data) {
  159. // Provide additional uid_touch handlers which are handled by tracker
  160. $data['node']['uid_touch_tracker'] = array(
  161. 'group' => t('Tracker - User'),
  162. 'title' => t('User posted or commented'),
  163. 'help' => t('Display nodes only if a user posted the node or commented on the node.'),
  164. 'argument' => array(
  165. 'field' => 'uid',
  166. 'name table' => 'users',
  167. 'name field' => 'name',
  168. 'handler' => 'views_handler_argument_tracker_comment_user_uid',
  169. 'no group by' => TRUE,
  170. ),
  171. 'filter' => array(
  172. 'field' => 'uid',
  173. 'name table' => 'users',
  174. 'name field' => 'name',
  175. 'handler' => 'views_handler_filter_tracker_comment_user_uid'
  176. ),
  177. );
  178. }

Related topics