You are here

function themekey_redirect_block_configure in ThemeKey 7.3

Implements hook_block_configure().

File

themekey_redirect/themekey_redirect.module, line 289
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_configure($delta = '') {
  $form = array();
  switch ($delta) {
    case 'domain_selector':
      $form['domain_list'] = array(
        '#type' => 'textarea',
        '#title' => t('Domain Targets'),
        '#description' => t('One entry per line, format: url|link title. The url must include the protocol. Example: http://www.example.com|My Example Site'),
        '#default_value' => themekey_redirect_encode_domain_selector(variable_get('themekey_redirect_domain_selector', array())),
        '#element_validate' => array(
          'themekey_redirect_domain_list_validate',
        ),
        '#required' => TRUE,
      );
      $form['auto_hide'] = array(
        '#type' => 'checkbox',
        '#title' => t('Auto hide'),
        '#description' => t('If selected the user will only be asked once to return to a previous URL after the redirect.'),
        '#default_value' => variable_get('themekey_redirect_domain_selector_auto_hide', 1),
      );
      break;
  }
  $form['#validate'][] = 'themekey_redirect_block_validate';
  return $form;
}