You are here

function heartbeat_comments_load_more_link in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 modules/heartbeat_comments/heartbeat_comments.module \heartbeat_comments_load_more_link()

Create a more link within the current context.

Parameters

$uaid Integer:

$node_comment Boolean:

$nid Integer:

Return value

String Link to all the comments.

1 call to heartbeat_comments_load_more_link()
theme_heartbeat_comments in modules/heartbeat_comments/heartbeat_comments.module
Theme function for heartbeat comments

File

modules/heartbeat_comments/heartbeat_comments.module, line 652
Heartbeat comments for activity.

Code

function heartbeat_comments_load_more_link($uaid, $node_comment, $nid = 0) {
  $attributes = array();
  $settings = heartbeat_plugins_get_plugin('activitycomments')
    ->getPlugin()
    ->getSettings();
  if ($settings['heartbeat_comments_load_more'] == 'ajax') {
    $attributes['onclick'] = 'javascript: Drupal.heartbeat.comments.load(' . $uaid . ', ' . (int) $node_comment . ', ' . $nid . '); return false;';
  }
  $attributes['class'] = array(
    'heartbeat-comment-more-' . $uaid,
  );
  if ($node_comment && $nid) {
    return l(t('More »'), 'node/' . $nid, array(
      'html' => TRUE,
      'attributes' => $attributes,
    ));
  }
  else {
    return l(t('More »'), 'heartbeat/message/' . $uaid, array(
      'alias' => TRUE,
      'html' => TRUE,
      'attributes' => $attributes,
    ));
  }
}