1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_field_last_comment_timestamp.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Field handler to display the timestamp of a comment with the comments count.
|
10
|
*
|
11
|
* @ingroup views_field_handlers
|
12
|
*/
|
13
|
class views_handler_field_last_comment_timestamp extends views_handler_field_date {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function construct() {
|
19
|
parent::construct();
|
20
|
$this->additional_fields['comment_count'] = 'comment_count';
|
21
|
}
|
22
|
|
23
|
/**
|
24
|
* {@inheritdoc}
|
25
|
*/
|
26
|
public function render($values) {
|
27
|
$comment_count = $this->get_value($values, 'comment_count');
|
28
|
if (empty($this->options['empty_zero']) || $comment_count) {
|
29
|
return parent::render($values);
|
30
|
}
|
31
|
else {
|
32
|
return NULL;
|
33
|
}
|
34
|
}
|
35
|
|
36
|
}
|