Commit 485b6970 authored by Plazik's avatar Plazik Committed by dawehner

Adding field handlers for statistics fields

parent bebb2ffc
......@@ -32,7 +32,7 @@ function statistics_views_data() {
'help' => t('The total number of times the node has been viewed.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'handler' => 'views_handler_field_statistics_numeric',
'click sortable' => TRUE,
),
'filter' => array(
......@@ -49,7 +49,7 @@ function statistics_views_data() {
'help' => t('The total number of times the node has been viewed today.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'handler' => 'views_handler_field_statistics_numeric',
'click sortable' => TRUE,
),
'filter' => array(
......@@ -66,7 +66,7 @@ function statistics_views_data() {
'help' => t('The most recent time the node has been viewed.'),
'field' => array(
'handler' => 'views_handler_field_date',
'handler' => 'views_handler_field_node_counter_timestamp',
'click sortable' => TRUE,
),
'filter' => array(
......
<?php
/**
* @file
* Definition of views_handler_field_node_counter_timestamp.
*/
/**
* Field handler to present the most recent time the node has been viewed.
*
* @ingroup views_field_handlers
*/
class views_handler_field_node_counter_timestamp extends views_handler_field_date {
/**
* {@inheritdoc}
*/
public function access() {
// Needs permission to see total page views.
return user_access('view post access counter');
}
}
<?php
/**
* @file
* Definition of views_handler_field_statistics_numeric.
*/
/**
* Field handler to present numeric values from the statistics module.
*
* @ingroup views_field_handlers
*/
class views_handler_field_statistics_numeric extends views_handler_field_numeric {
/**
* {@inheritdoc}
*/
public function access() {
// Needs permission to see total page views.
return user_access('view post access counter');
}
}
......@@ -157,6 +157,8 @@ files[] = modules/search/views_handler_filter_search.inc
files[] = modules/search/views_handler_sort_search_score.inc
files[] = modules/search/views_plugin_row_search_view.inc
files[] = modules/statistics/views_handler_field_accesslog_path.inc
files[] = modules/statistics/views_handler_field_node_counter_timestamp.inc
files[] = modules/statistics/views_handler_field_statistics_numeric.inc
files[] = modules/system/views_handler_argument_file_fid.inc
files[] = modules/system/views_handler_field_file.inc
files[] = modules/system/views_handler_field_file_extension.inc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment