You are here

function domain_node_access_explain in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain.module \domain_node_access_explain()
  2. 7.3 domain.module \domain_node_access_explain()
  3. 7.2 domain.module \domain_node_access_explain()

Implement hook_node_access_explain for devel.module

File

./domain.module, line 1494
Core module functions for the Domain Access suite.

Code

function domain_node_access_explain($row) {
  global $_domain;
  $active = $_domain['subdomain'];
  $domain = domain_lookup($row->gid);
  $return = t('Domain Access -- ');
  switch ($row->realm) {
    case 'domain_all':
      if (domain_grant_all() == TRUE) {
        $return .= t('True: Allows content from all domains to be shown.');
      }
      else {
        $return .= t('False: Only allows content from the active domain (%domain) or from all affiliates.', array(
          '%domain' => $active,
        ));
      }
      break;
    case 'domain_site':
      $return .= t('Viewable on all affiliate sites.');
      break;
    case 'domain_id':
      $return .= t('Viewable on %domain.', array(
        '%domain' => $domain['subdomain'],
      ));
      break;
    case 'domain_editor':
      $return .= t('Editable by %domain editors.', array(
        '%domain' => $domain['subdomain'],
      ));
      break;
    default:

      // This is not our grant, do not return anything.
      $return = NULL;
      break;
  }
  return $return;
}