You are here

function domain_content_view in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_content/domain_content.admin.inc \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.module, line 147
Editorial overview module.

Code

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

  // For users with limited privileges, we have to be on the same server
  // as the content we are looking up.  Will return -1 if it fails.
  $domain = domain_lookup($domain_id);
  domain_goto($domain);

  // 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;
}