You are here

function themekey_redirect_block_view in ThemeKey 7.3

Implements hook_block_view().

File

themekey_redirect/themekey_redirect.module, line 353
Define rules to redirect the user to a different domain. The common use-case is to setup sub-domains for mobile sites. In this case you can configure ThemeKey Redirect to detect mobile clients and redirect the user accordingly. In ThemeKey itself you…

Code

function themekey_redirect_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'domain_selector':
      if ($links = variable_get('themekey_redirect_domain_selector', array())) {
        $block['subject'] = t('You have been redirected automatically.');
        $block['content'] = theme('themekey_redirect_domain_selector_links', array(
          'links' => $links,
        ));
        if (variable_get('themekey_redirect_domain_selector_auto_hide', 1)) {
          drupal_add_css(drupal_get_path('module', 'themekey_redirect') . '/themekey_redirect_domain_selector.css');
        }
      }
      break;
  }
  return $block;
}