You are here

function domain_content_view in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain_content/domain_content.module \domain_content_view()
  2. 7.3 domain_content/domain_content.admin.inc \domain_content_view()
  3. 7.2 domain_content/domain_content.admin.inc \domain_content_view()

Content administration for a specific domain. This callback puts the user on the current domain and then fetches the appropirate content for batch editing.

Parameters

$domain_id: The unique identifier for the currently active domain.

$all_affiliates: A boolean flag that indicates whether to grant the domain_site node access realm for this content view.

Return value

A link group for each domain the user can access.

1 string reference to 'domain_content_view'
domain_content_menu in domain_content/domain_content.module
Implement hook_menu()

File

domain_content/domain_content.admin.inc, line 105
Administration pages for Domain Content.

Code

function domain_content_view($domain_id = NULL, $all_affiliates = FALSE) {
  global $_domain;

  // Load the active domain, which is not necessarily the current domain.
  if (!is_null($domain_id) && $domain_id != $_domain['domain_id']) {
    domain_set_domain($domain_id);
  }
  $output = '';

  // Override the $_domain global so we can see the appropriate content
  if (!is_null($domain_id)) {
    $_domain['site_grant'] = FALSE;
    drupal_set_title(t('Content for @domain', array(
      '@domain' => $_domain['sitename'],
    )));
  }
  else {
    if ($all_affiliates) {
      $_domain['site_grant'] = TRUE;
      drupal_set_title(t('Content for all affiliate sites'));
    }
    else {
      drupal_set_message(t('Invalid request'), 'error');
      $output .= t('<p>The specified domain does not exist.</p>');
      return $output;
    }
  }
  $output .= domain_content_admin();
  return $output;
}