function theme_domain_alias_block in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain_alias/domain_alias.module \theme_domain_alias_block()
- 7.2 domain_alias/domain_alias.module \theme_domain_alias_block()
Theme element for the Domain Alias switcher block.
Parameters
$domains: The array of active domains defined by domain_domains().
Return value
HTML output.
1 theme call to theme_domain_alias_block()
- domain_alias_block in domain_alias/
domain_alias.module - Implement hook_block().
File
- domain_alias/
domain_alias.module, line 387 - Interface for advanced domain matching for Domain Access.
Code
function theme_domain_alias_block($domains) {
global $_domain;
$output = '';
$items = array();
$msg = FALSE;
$i = 0;
$active = NULL;
foreach ($domains as $domain) {
if ($domain['valid']) {
$title = $domain['sitename'];
$allow = TRUE;
}
else {
$title = $domain['sitename'] . ' *';
$allow = FALSE;
if (user_access('access inactive domains')) {
$msg = TRUE;
$allow = TRUE;
}
}
if ($allow) {
if ($domain['domain_id'] == $_domain['domain_id']) {
$title = '<strong>' . $title . '</strong>';
}
$items[$i]['data'] = l($title, domain_get_uri($domain), array(
'absolute' => TRUE,
'html' => TRUE,
));
if (!empty($domain['aliases'])) {
$request = array_reverse(explode('.', $_domain['subdomain']));
if (isset($_domain['active_alias_id'])) {
$active = $_domain['active_alias_id'];
}
foreach ($domain['aliases'] as $alias_id => $alias) {
$items[$i]['children'][] = _domain_alias_link($alias, $domain, $request, $active);
}
}
$i++;
}
}
$output .= theme('item_list', $items);
if ($msg) {
$output .= t('<em>* Inactive domain.</em>');
}
return $output;
}