You are here

function og_handler_field_subscribe in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og_views.inc \og_handler_field_subscribe()
  2. 5.2 og_views.inc \og_handler_field_subscribe()
  3. 5.3 og_views.inc \og_handler_field_subscribe()
  4. 5.7 og_views.inc \og_handler_field_subscribe()

Views handler to display the subscribe link

1 string reference to 'og_handler_field_subscribe'
og_views_tables in ./og_views.inc
Implementation of the hook_views_tables()

File

./og_views.inc, line 1327

Code

function og_handler_field_subscribe($fieldinfo, $fielddata, $value, $data) {
  global $user;
  if (!in_array($data->nid, array_keys($user->og_groups))) {
    switch ($data->og_selective) {
      case OG_CLOSED:
        return '<em>' . t('Closed') . '</em>';
      case OG_INVITE_ONLY:
        return '<em>' . t('Invite only') . '</em>';
      default:
        return og_subscribe_link($data);
    }
  }
}