You are here

public function HeartbeatActivityCommentsPlugin::renderButtons in Heartbeat 7

renderButtons().

Overrides iHeartbeatPlugin::renderButtons

File

modules/heartbeat_comments/plugins/activitycomments.inc, line 332
Defines activity comments.

Class

HeartbeatActivityCommentsPlugin
Class HeartbeatFlagAttachmentPlugin.

Code

public function renderButtons(HeartbeatActivity $heartbeatActivity) {
  if (!$this->canComment) {
    return;
  }
  $label = heartbeat_comments_get_count_label($this->commentCount);
  $output = l($label, 'heartbeat/message/' . $heartbeatActivity->uaid, array(
    'attributes' => array(
      'title' => t('comment'),
      'onclick' => 'javascript:Drupal.heartbeat.comments.toggleComments(this, ' . $heartbeatActivity->uaid . '); return false;',
    ),
  ));
  $heartbeatActivity
    ->add_button('<span class="heartbeat-attachment-button">' . $output . '</span>');
}