materio-base-legacy/modules/comment/views_handler_field_last_comment_timestamp.inc
bachy b20b38f514 first import
Signed-off-by: bachy <git@g-u-i.net>
2013-01-09 10:53:26 +01:00

29 lines
662 B
PHP

<?php
/**
* @file
* Definition of views_handler_field_last_comment_timestamp.
*/
/**
* Field handler to display the timestamp of a comment with the count of comments.
*
* @ingroup views_field_handlers
*/
class views_handler_field_last_comment_timestamp extends views_handler_field_date {
function construct() {
parent::construct();
$this->additional_fields['comment_count'] = 'comment_count';
}
function render($values) {
$comment_count = $this->get_value($values, 'comment_count');
if (empty($this->options['empty_zero']) || $comment_count) {
return parent::render($values);
}
else {
return NULL;
}
}
}