summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
blob: 4840a1e5cb511f65f00f7ae330ac197f51ca8cce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

/**
 * @file
 * Definition of views_handler_field_comment_depth.
 */

/**
 * Field handler to display the depth of a comment.
 *
 * @ingroup views_field_handlers
 */
class views_handler_field_comment_depth extends views_handler_field {
  /**
   * Work out the depth of this comment
   */
  function render($values) {
    $comment_thread = $this->get_value($values);
    return count(explode('.', $comment_thread)) - 1;
  }
}