This repository has been archived on 2025-06-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
suitedesk/modules/nodecomment/views/views_handler_field_comment_depth.inc

17 lines
401 B
PHP

<?php
/**
* Field handler to display the depth of a comment
*/
class views_handler_field_comment_depth extends views_handler_field {
function construct() {
parent::construct();
$this->additional_fields['thread'] = 'thread';
}
/**
* Work out the depth of this comment
*/
function render($values) {
return count(explode('.', $values->{$this->aliases['thread']})) - 1;
}
}