You are here

function og_home_empty in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og.module \og_home_empty()
  2. 5 og.module \og_home_empty()
  3. 5.2 og.module \og_home_empty()
  4. 5.3 og.module \og_home_empty()
  5. 5.7 og.module \og_home_empty()
  6. 6.2 og.module \og_home_empty()
1 call to og_home_empty()
og_views_view_group in modules/og_views/og_views.module
Embed the configured group homepage.

File

./og.module, line 1295

Code

function og_home_empty($node) {
  global $user;
  $dest = drupal_get_destination();
  if (og_is_group_member($node->nid)) {
    $msg = t('No posts in this group.');
  }
  else {
    if (!$user->uid) {
      $msg = t('No public posts in this group. You must <a href="!register">register</a> or <a href="!login">login</a> and become a member in order to post messages, and view any private posts.', array(
        '!register' => url("user/register", array(
          'query' => $dest,
        )),
        '!login' => url("user/login", array(
          'query' => $dest,
        )),
      ));
    }
    elseif ($node->og_selective < OG_INVITE_ONLY) {
      $msg = t('No public posts in this group. Consider <a href="!url">joining this group</a> in order to view its posts.', array(
        '!url' => url("og/subscribe/{$node->nid}", array(
          'query' => $dest,
        )),
      ));
    }
    else {
      $msg = t('No public posts in this group.');
    }
  }
  drupal_set_message($msg);
}