theme_domain_nav_default

Definition

theme_domain_nav_default($options)
domain_nav/domain_nav.module, line 180

Description

Themes the domain list as a JavaScript selection form.

  • domain_id -- the unique identifier of this domain
  • subdomain -- the host path of the url for this domain
  • sitename -- the human-readable name of this domain
  • path -- the link path (a Drupal-formatted path)
  • active -- a boolean flag indicating the currently active domain
If hook_domainnav() is invoked, additonal elements may be present.

Parameters

$options An array of information about each domain. Options contain the following:

Code

function theme_domain_nav_default($options) {
  global $_domain;
  $current = $options[$_domain['domain_id']];
  $output = '<form class="domain-list" action="">';
  $output .= '<select onchange="if (this.value) location.href=this.value;">';
  $output .= '<option value="'. $current['path'] .'">'. t('Jump to...') .'</option>';
  foreach ($options as $key => $value) {
    ($value['active']) ? $selected = ' selected' : $selected = '';
    $output .= '<option value="'. $value['path'] .'"'. $selected .'>'. filter_xss_admin($value['sitename']) .'</option>';
  }
  $output .= '</select>';
  $output .= '</form>';
  return $output;
}