You are here

function extlink_page_build in External Links 7

Implements hook_page_build().

File

./extlink.module, line 51
External Link module.

Code

function extlink_page_build(&$page) {
  $path = drupal_get_path('module', 'extlink');
  $page['content']['#attached']['js'][] = array(
    'type' => 'file',
    'data' => $path . '/js/extlink.js',
  );
  $page['content']['#attached']['js'][] = array(
    'type' => 'setting',
    'data' => array(
      'extlink' => array(
        'extTarget' => variable_get('extlink_target', 0),
        'extClass' => variable_get('extlink_class', 'ext'),
        'extLabel' => check_plain(variable_get('extlink_label', t('(link is external)'))),
        'extImgClass' => variable_get('extlink_img_class', 0),
        'extIconPlacement' => variable_get('extlink_icon_placement', 'append'),
        'extSubdomains' => variable_get('extlink_subdomains', 1),
        'extExclude' => implode('|', array_filter(array(
          variable_get('extlink_exclude', ''),
          variable_get('extlink_exclude_internal_pattern', ''),
        ))),
        'extInclude' => implode('|', array_filter(array(
          variable_get('extlink_include', ''),
          variable_get('extlink_include_internal_pattern', ''),
        ))),
        'extCssExclude' => variable_get('extlink_css_exclude', ''),
        'extCssExplicit' => variable_get('extlink_css_explicit', ''),
        'extAlert' => variable_get('extlink_alert', 0),
        'extAlertText' => variable_get('extlink_alert_text', 'This link will take you to an external web site. We are not responsible for their content.'),
        'mailtoClass' => variable_get('extlink_mailto_class', 'mailto'),
        'mailtoLabel' => check_plain(variable_get('extlink_mailto_label', t('(link sends e-mail)'))),
        'extUseFontAwesome' => variable_get('extlink_use_font_awesome', FALSE),
      ),
    ),
  );
}