variable_views.views.inc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * @file
  4. * Views hooks for variables.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function variable_views_views_data() {
  10. // Basic table information.
  11. // Define the base group of this table.
  12. $data['variable']['table']['group'] = t('Variable');
  13. // Advertise this table as a possible base table.
  14. $data['variable']['table']['base'] = array(
  15. 'field' => 'name',
  16. 'title' => t('Variable'),
  17. 'help' => t('Variables from the system variable table.'),
  18. );
  19. // Variable name
  20. $data['variable']['name'] = array(
  21. 'title' => t('Name'),
  22. 'help' => t('The low level name of the variable.'),
  23. 'field' => array(
  24. 'handler' => 'views_handler_field',
  25. 'click sortable' => TRUE,
  26. ),
  27. 'argument' => array(
  28. 'handler' => 'views_handler_argument_string',
  29. ),
  30. 'filter' => array(
  31. 'handler' => 'views_handler_filter_string',
  32. ),
  33. 'sort' => array(
  34. 'handler' => 'views_handler_sort',
  35. ),
  36. );
  37. // Varaible value
  38. $data['variable']['value'] = array(
  39. 'title' => t('Value'),
  40. 'help' => t('The value of the variable.'),
  41. 'field' => array(
  42. 'handler' => 'views_handler_field_variable_value',
  43. ),
  44. 'argument' => array(
  45. 'handler' => 'views_handler_argument_string',
  46. ),
  47. 'filter' => array(
  48. 'handler' => 'views_handler_filter',
  49. ),
  50. 'sort' => array(
  51. 'handler' => 'views_handler_sort',
  52. ),
  53. );
  54. // Variable title
  55. $data['variable']['title'] = array(
  56. 'group' => t('Variable'),
  57. 'real field' => 'name',
  58. 'field' => array(
  59. 'title' => t('Title'),
  60. 'help' => t('Human readable variable name.'),
  61. 'handler' => 'views_handler_field_variable_title',
  62. ),
  63. );
  64. return $data;
  65. }