New module 'Nodecomment'
This commit is contained in:
parent
09b74574f1
commit
3c2bb788b4
26 changed files with 3513 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Field handler to present a link for replying to a nodecomment.
|
||||
*/
|
||||
class views_handler_field_comment_link_reply extends views_handler_field_comment_link {
|
||||
function construct() {
|
||||
parent::construct();
|
||||
$this->additional_fields['type'] = array('table' => 'node', 'field' => 'type');
|
||||
}
|
||||
|
||||
function render($values) {
|
||||
//check for permission to reply to comments
|
||||
if (!user_access('post comments')) {
|
||||
return;
|
||||
}
|
||||
$comment_type = str_replace('_', '-', $values->{$this->aliases['type']});
|
||||
$text = !empty($this->options['text']) ? $this->options['text'] : t('reply');
|
||||
return l($text, 'node/add/'. $comment_type .'/' . $values->{$this->aliases['nid']} . '/' . $values->{$this->aliases['cid']});
|
||||
}
|
||||
}
|
Reference in a new issue