You are here

function template_preprocess_extlink_extra_leaving in External Links Extra 7

File

./extlink_extra.module, line 80
This module adds some extra functionality to the External Links module.

Code

function template_preprocess_extlink_extra_leaving(&$vars) {
  $eat_default = variable_get('extlink_alert_text', array(
    'value' => 'This link will take you to an external web site. We are not responsible for their content.',
    'format' => NULL,
  ));
  if (variable_get('extlink_cache_fix', 0)) {
    $vars['external_url'] = 'external-url-placeholder';
    $vars['back_url'] = 'back-url-placeholder';
  }
  else {
    $vars['external_url'] = isset($_COOKIE['external_url']) ? filter_xss($_COOKIE['external_url']) : NULL;
    $vars['back_url'] = isset($_COOKIE['back_url']) ? filter_xss($_COOKIE['back_url']) : NULL;
  }
  $extlink_token_data = array(
    'extlink' => array(
      'external_url' => url($vars['external_url']),
      'back_url' => url($vars['back_url']),
    ),
  );
  $vars['alert_text'] = check_markup(token_replace($eat_default['value'], $extlink_token_data), $eat_default['format']);
  $vars['page_title'] = token_replace(variable_get('extlink_page_title', NULL), $extlink_token_data);
  drupal_set_title($vars['page_title']);
  $vars['timer'] = extlink_extra_timer_markup();
}