You are here

function domain_block_view_information in Domain Access 7.3

Same name and namespace in other branches
  1. 7.2 domain.blocks.inc \domain_block_view_information()

Prints information about the current node.

See also

domain_block_view()

File

./domain.blocks.inc, line 51
Block view functions for Domain Access.

Code

function domain_block_view_information() {
  $output = '';
  $node = menu_get_object();
  if (empty($node->nid)) {
    return;
  }

  // Print the assigned domains.
  if (!empty($node->subdomains)) {
    $output .= theme('item_list', array(
      'items' => $node->subdomains,
      'title' => t('Assigned domains'),
    ));
  }

  // Print the link source domain.
  $this_domain = domain_get_node_match($node->nid);
  $output .= theme('item_list', array(
    'items' => array(
      check_plain($this_domain['sitename']),
    ),
    'title' => t('Source domain'),
  ));
  if (empty($output)) {
    $output = t('This node is not assigned to a domain.');
  }
  else {
    $output = '<p>' . t('%node is published with the following Domain Access rules:', array(
      '%node' => $node->title,
    )) . '</p>' . $output;
  }
  $block = array(
    'subject' => t('Domain access information'),
    'content' => array(
      '#markup' => $output,
    ),
  );
  return $block;
}