You are here

function og_access_node_access_explain in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_access.module \og_access_node_access_explain()
  2. 5 og_access.module \og_access_node_access_explain()
  3. 5.3 og_access.module \og_access_node_access_explain()
  4. 5.7 og_access.module \og_access_node_access_explain()
  5. 6.2 modules/og_access/og_access.module \og_access_node_access_explain()

Implementation of hook_node_access_explain.

File

modules/og_access/og_access.module, line 322

Code

function og_access_node_access_explain($row) {
  if ($row->realm == 'og_public') {
    return t('All users may view this node.');
  }
  elseif ($row->realm == 'og_subscriber') {
    $node = node_load((int) $row->gid);
    return t('Members of <a href="@group-node">@group-name</a> may view this node.', array(
      '@group-node' => url('node/' . $row->gid),
      '@group-name' => $node->title,
    ));
  }
  elseif ($row->realm == 'og_admin') {
    $node = node_load((int) $row->gid);
    return t('Group admins of <a href="@group-node">@group-name</a> may view/edit/delete this node.', array(
      '@group-node' => url('node/' . $row->gid),
      '@group-name' => $node->title,
    ));
  }
}