You are here

function domain_conf_block_view in Domain Access 7.3

Same name and namespace in other branches
  1. 7.2 domain_conf/domain_conf.module \domain_conf_block_view()

Implements hook_block_view().

File

domain_conf/domain_conf.module, line 287
Domain manager configuration options.

Code

function domain_conf_block_view($delta = '') {

  // Dispatch to sub-function.
  if (empty($delta)) {
    return;
  }

  // Get the menu information.
  $menus = menu_get_menus();
  $string = str_replace('domain-', '', $delta);
  $name = str_replace('-links', '-menu', $string);
  $source = 'menu_' . str_replace('-', '_', $string) . '_source';
  $data = variable_get($source, $string);

  // Some domains can disable primary and secondary links.
  if (empty($data)) {
    return;
  }

  // In D7, secondary links may be children of main links.
  if ($delta == 'domain-secondary-links' && variable_get('menu_secondary_links_source', 'user-menu') == variable_get('menu_main_links_source', 'main-menu')) {

    // This does not work right now.
  }
  if (!isset($menus[$data])) {
    return;
  }

  // Output the block.
  $output = menu_tree($data);

  // Build the block.
  $block = array(
    'subject' => check_plain($menus[$data]),
    'content' => $output,
  );
  return $block;
}