feedback.views.inc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. /**
  3. * @file
  4. * Provides views integration.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function feedback_views_data() {
  10. $data['feedback']['table']['group'] = t('Feedback');
  11. $data['feedback']['table']['base'] = array(
  12. 'field' => 'fid',
  13. 'title' => t('Feedback'),
  14. 'help' => t('Feedback messages submitted to the site.'),
  15. );
  16. $data['feedback']['table']['join']['users'] = array(
  17. 'left_field' => 'uid',
  18. 'field' => 'uid',
  19. );
  20. $data['feedback']['fid'] = array(
  21. 'title' => t('Feedback ID'),
  22. 'help' => t('The primary identifier for a feedback message.'),
  23. 'field' => array(
  24. 'handler' => 'views_handler_field_numeric',
  25. ),
  26. 'filter' => array(
  27. 'handler' => 'views_handler_filter_numeric',
  28. ),
  29. 'argument' => array(
  30. 'handler' => 'views_handler_argument_numeric',
  31. ),
  32. 'sort' => array(
  33. 'handler' => 'views_handler_sort_numeric',
  34. ),
  35. );
  36. $data['feedback']['view_entry'] = array(
  37. 'field' => array(
  38. 'title' => t('Link'),
  39. 'help' => t('Provide a simple link to the feedback entry.'),
  40. 'handler' => 'feedback_handler_field_feedback_link',
  41. ),
  42. );
  43. $data['feedback']['view_entry_delete'] = array(
  44. 'field' => array(
  45. 'title' => t('Delete entry'),
  46. 'help' => t('Provide a simple link to delete the feedback entry.'),
  47. 'handler' => 'feedback_handler_field_feedback_link_delete',
  48. ),
  49. );
  50. $data['feedback']['view_entry_edit'] = array(
  51. 'field' => array(
  52. 'title' => t('Edit entry'),
  53. 'help' => t('Provide a simple link to the edit feedback entry.'),
  54. 'handler' => 'feedback_handler_field_feedback_link_edit',
  55. ),
  56. );
  57. $data['feedback']['uid'] = array(
  58. 'title' => t('User Id'),
  59. 'help' => t('The user id of the author of a feedback message.'),
  60. 'relationship' => array(
  61. 'base' => 'users',
  62. 'base field' => 'uid',
  63. 'handler' => 'views_handler_relationship',
  64. 'label' => t('User'),
  65. ),
  66. );
  67. $data['feedback']['status'] = array(
  68. 'title' => t('Status'),
  69. 'help' => t('The status of a feedback message.'),
  70. 'field' => array(
  71. 'handler' => 'views_handler_field_boolean',
  72. 'click sortable' => TRUE,
  73. ),
  74. 'filter' => array(
  75. 'handler' => 'views_handler_filter_boolean_operator',
  76. 'label' => t('Feedback status is processed'),
  77. 'type' => 'yes-no',
  78. ),
  79. 'argument' => array(
  80. 'handler' => 'views_handler_argument_boolean',
  81. ),
  82. 'sort' => array(
  83. 'handler' => 'views_handler_sort',
  84. ),
  85. );
  86. $data['feedback']['message'] = array(
  87. 'title' => t('Message'),
  88. 'help' => t('The actual feedback message.'),
  89. 'field' => array(
  90. 'handler' => 'views_handler_field',
  91. ),
  92. 'filter' => array(
  93. 'handler' => 'views_handler_filter_string',
  94. ),
  95. 'sort' => array(
  96. 'handler' => 'views_handler_sort',
  97. ),
  98. );
  99. $data['feedback']['location'] = array(
  100. 'title' => t('Location'),
  101. 'help' => t('The internal Drupal path of the page the feedback message was submitted on.'),
  102. 'field' => array(
  103. 'handler' => 'views_handler_field_url',
  104. 'click sortable' => TRUE,
  105. ),
  106. 'filter' => array(
  107. 'handler' => 'views_handler_filter_string',
  108. ),
  109. 'argument' => array(
  110. 'handler' => 'views_handler_argument_string',
  111. ),
  112. 'sort' => array(
  113. 'handler' => 'views_handler_sort',
  114. ),
  115. );
  116. $data['feedback']['location_masked'] = array(
  117. 'title' => t('Location Masked'),
  118. 'help' => t('The masked Drupal path of the page the feedback message was submitted on.'),
  119. 'field' => array(
  120. 'handler' => 'views_handler_field_url',
  121. 'click sortable' => TRUE,
  122. ),
  123. 'filter' => array(
  124. 'handler' => 'views_handler_filter_string',
  125. ),
  126. 'argument' => array(
  127. 'handler' => 'views_handler_argument_string',
  128. ),
  129. 'sort' => array(
  130. 'handler' => 'views_handler_sort',
  131. ),
  132. );
  133. $data['feedback']['url'] = array(
  134. 'title' => t('URL'),
  135. 'help' => t('The absolute URL of the page the feedback message was submitted on.'),
  136. 'field' => array(
  137. 'handler' => 'views_handler_field_url',
  138. 'click sortable' => TRUE,
  139. ),
  140. 'filter' => array(
  141. 'handler' => 'views_handler_filter_string',
  142. ),
  143. 'argument' => array(
  144. 'handler' => 'views_handler_argument_string',
  145. ),
  146. 'sort' => array(
  147. 'handler' => 'views_handler_sort',
  148. ),
  149. );
  150. $data['feedback']['useragent'] = array(
  151. 'title' => t('User agent'),
  152. 'help' => t('The user agent of the feedback message author.'),
  153. 'field' => array(
  154. 'handler' => 'views_handler_field',
  155. 'click sortable' => TRUE,
  156. ),
  157. 'filter' => array(
  158. 'handler' => 'views_handler_filter_string',
  159. ),
  160. 'sort' => array(
  161. 'handler' => 'views_handler_sort',
  162. ),
  163. );
  164. $data['feedback']['timestamp'] = array(
  165. 'title' => t('Timestamp'),
  166. 'help' => t('The UNIX timestamp when the feedback message was created.'),
  167. 'field' => array(
  168. 'click sortable' => TRUE,
  169. 'handler' => 'views_handler_field_date',
  170. ),
  171. 'filter' => array(
  172. 'handler' => 'views_handler_filter_date',
  173. ),
  174. 'argument' => array(
  175. 'handler' => 'views_handler_argument_date',
  176. ),
  177. 'sort' => array(
  178. 'handler' => 'views_handler_sort_date',
  179. ),
  180. );
  181. return $data;
  182. }