summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
new file mode 100644
index 0000000..8872a6a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_comment_depth.inc
@@ -0,0 +1,15 @@
+<?php
+/**
+ * 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;
+ }
+}