print.views.inc

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).

Printer-friendly version Views integration

Functions

Namesort descending Description
print_views_data Implements hook_views_data().

File

sites/all/modules/local_contrib/print/print.views.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Printer-friendly version Views integration
  5. *
  6. * @ingroup print
  7. */
  8. /**
  9. * Implements hook_views_data().
  10. */
  11. function print_views_data() {
  12. // The 'group' index will be used as a prefix in the UI for any of this
  13. // table's fields, sort criteria, etc. so it's easy to tell where they came
  14. // from.
  15. $data['print_node_conf']['table']['group'] = t('Printer-friendly version');
  16. $data['print_page_counter']['table']['group'] = t('Printer-friendly version');
  17. // This table references the {node} table. The declaration below creates an
  18. // 'implicit' relationship to the node table, so that when 'node' is the base
  19. // table, the fields are automatically available.
  20. $data['print_node_conf']['table']['join']['node'] = array(
  21. // 'left_field' is the primary key in the referenced table.
  22. // 'field' is the foreign key in this table.
  23. 'left_field' => 'nid',
  24. 'field' => 'nid',
  25. // 'type' => 'INNER',
  26. );
  27. $data['print_page_counter']['table']['join']['node'] = array(
  28. // 'left_field' is the primary key in the referenced table.
  29. // 'field' is the foreign key in this table.
  30. 'left_field' => 'nid',
  31. 'field' => 'path',
  32. // 'type' => 'INNER',
  33. 'handler' => 'print_join_page_counter',
  34. );
  35. // print_node_conf fields
  36. $data['print_node_conf']['link'] = array(
  37. 'title' => t('Web: Show link'),
  38. 'help' => t('Whether to show the printer-friendly version link.'),
  39. 'field' => array(
  40. 'handler' => 'views_handler_field_boolean',
  41. 'click sortable' => TRUE,
  42. ),
  43. 'filter' => array(
  44. 'handler' => 'views_handler_filter_boolean_operator',
  45. 'label' => t('Active'),
  46. 'type' => 'yes-no',
  47. ),
  48. 'sort' => array(
  49. 'handler' => 'views_handler_sort',
  50. ),
  51. );
  52. $data['print_node_conf']['comments'] = array(
  53. 'title' => t('Web: Show link in individual comments'),
  54. 'help' => t('Whether to show the printer-friendly version link in individual comments.'),
  55. 'field' => array(
  56. 'handler' => 'views_handler_field_boolean',
  57. 'click sortable' => TRUE,
  58. ),
  59. 'filter' => array(
  60. 'handler' => 'views_handler_filter_boolean_operator',
  61. 'label' => t('Active'),
  62. 'type' => 'yes-no',
  63. ),
  64. 'sort' => array(
  65. 'handler' => 'views_handler_sort',
  66. ),
  67. );
  68. $data['print_node_conf']['url_list'] = array(
  69. 'title' => t('Web: Show Printer-friendly URLs list'),
  70. 'help' => t('Whether to show the URL list.'),
  71. 'field' => array(
  72. 'handler' => 'views_handler_field_boolean',
  73. 'click sortable' => TRUE,
  74. ),
  75. 'filter' => array(
  76. 'handler' => 'views_handler_filter_boolean_operator',
  77. 'label' => t('Active'),
  78. 'type' => 'yes-no',
  79. ),
  80. 'sort' => array(
  81. 'handler' => 'views_handler_sort',
  82. ),
  83. );
  84. // print_page_counter fields
  85. $data['print_page_counter']['totalcount'] = array(
  86. 'title' => t('Web: Number of page accesses'),
  87. 'help' => t('Counter of accesses to the printer-friendly version for this node.'),
  88. 'field' => array(
  89. 'handler' => 'views_handler_field_numeric',
  90. 'click sortable' => TRUE,
  91. ),
  92. 'sort' => array(
  93. 'handler' => 'views_handler_sort',
  94. ),
  95. 'filter' => array(
  96. 'handler' => 'views_handler_filter_numeric',
  97. ),
  98. );
  99. $data['print_page_counter']['timestamp'] = array(
  100. 'title' => t('Web: Last access'),
  101. 'help' => t("The date of the last access to the node's printer-friendly version."),
  102. 'field' => array(
  103. 'handler' => 'views_handler_field_date',
  104. 'click sortable' => TRUE,
  105. ),
  106. 'sort' => array(
  107. 'handler' => 'views_handler_sort_date',
  108. ),
  109. 'filter' => array(
  110. 'handler' => 'views_handler_filter_date',
  111. ),
  112. );
  113. return $data;
  114. }

Related topics

Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.