domain_content_view

Versions
domain
domain_content_view($domain_id = NULL, $all_affiliates = FALSE)

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.

Code

domain_content/domain_content.admin.inc, line 105

<?php
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'));
  }

  // KILLSWITCH CASE: returns an error
  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;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List