You are here

function comment_og_link in Comment OG 6

File

./comment_og.module, line 85

Code

function comment_og_link($type, $object, $teaser = FALSE) {
  $group = og_get_group_context();
  if ($type == 'comment' && node_comment_mode($object->nid) == COMMENT_NODE_READ_WRITE) {
    if (og_is_group_admin($group) && !comment_access('edit', $object)) {

      // we add the Group ID to the URL to determine group admin status later
      $links['comment_edit'] = array(
        'title' => t('edit'),
        'href' => "comment_og/edit/{$object->cid}/{$group->nid}",
      );
    }

    // this effectively makes sure the delete link doesn't already exist
    if (og_is_group_admin($group) && !user_access('administer comments') && user_access('post comments')) {
      $links['comment_delete'] = array(
        'title' => t('delete'),
        'href' => "comment/delete/{$object->cid}/{$group->nid}",
      );
    }
  }
  return $links;
}