You are here

function theme_og_subscribe_link in Organic groups 6.2

Generate a link to join or request to join the specified group.

Parameters

$node: Node object of the group.

Return value

string

3 theme calls to theme_og_subscribe_link()
og_details_links in ./og.module
Create group-contextual links, such as the group details block.
og_subscribe_link in ./og.module
Generate a link to join or request to join the specified group.
og_views_handler_field_og_subscribe::render in modules/og_views/includes/og_views_handler_field_og_subscribe.inc

File

./og.module, line 2765
Code for the Organic Groups module.

Code

function theme_og_subscribe_link($node) {
  if ($node->og_selective == OG_MODERATED) {
    $txt = t('Request membership');
    if (og_is_pending_member($node->nid)) {
      return t('Awaiting approval');
    }
  }
  elseif ($node->og_selective == OG_OPEN) {
    $txt = t('Join');
  }
  if (isset($txt)) {
    return l($txt, "og/subscribe/{$node->nid}", array(
      'attributes' => array(
        'rel' => 'nofollow',
      ),
      'query' => drupal_get_destination(),
    ));
  }
}