Applied D6LTS contrib patch SA-CONTRIB-2016-036

This commit is contained in:
Manuel Cillero 2018-05-08 13:12:03 +02:00
parent 17454ca200
commit ed9947609d
3 changed files with 51 additions and 3 deletions

View file

@ -36,7 +36,7 @@ function statistics_views_data() {
'help' => t('The total number of times the node has been viewed.'), 'help' => t('The total number of times the node has been viewed.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'handler' => 'views_handler_field_statistics_numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'filter' => array( 'filter' => array(
@ -53,7 +53,7 @@ function statistics_views_data() {
'help' => t('The total number of times the node has been viewed today.'), 'help' => t('The total number of times the node has been viewed today.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_numeric', 'handler' => 'views_handler_field_statistics_numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'filter' => array( 'filter' => array(
@ -70,7 +70,7 @@ function statistics_views_data() {
'help' => t('The most recent time the node has been viewed.'), 'help' => t('The most recent time the node has been viewed.'),
'field' => array( 'field' => array(
'handler' => 'views_handler_field_date', 'handler' => 'views_handler_field_node_counter_timestamp',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ),
'filter' => array( 'filter' => array(
@ -258,6 +258,12 @@ function statistics_views_handlers() {
'views_handler_field_accesslog_path' => array( 'views_handler_field_accesslog_path' => array(
'parent' => 'views_handler_field', 'parent' => 'views_handler_field',
), ),
'views_handler_field_statistics_numeric' => array(
'parent' => 'views_handler_field_numeric',
),
'views_handler_field_node_counter_timestamp' => array(
'parent' => 'views_handler_field_date',
),
), ),
); );
} }

View file

@ -0,0 +1,21 @@
<?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');
}
}

View file

@ -0,0 +1,21 @@
<?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');
}
}