You are here

function _invisimail_settings in Invisimail 6

Helper function for the invisimail configuration form.

Parameters

$format: The key of the format we are defining a setting for. For the CCK formatter, this will be "formatter". For input filters, it will be an integer.

Return value

A form fragment.

2 calls to _invisimail_settings()
invisimail_filter in ./invisimail.module
Implementation of hook_filter().
invisimail_formatter_settings in ./invisimail.module
Settings form for the invisimail CCK formatter.

File

./invisimail.module, line 364
This module provides a filter that will search content for email addresses and replace them with their ascii equivalents before display. This is not a complete protection from spam harvesters, but it is some help.

Code

function _invisimail_settings($format) {
  $form['invisimail_js_' . $format] = array(
    '#type' => 'radios',
    '#title' => t('JavaScript'),
    '#default_value' => variable_get('invisimail_js_' . $format, 0),
    '#options' => array(
      0 => t('No JavaScript - greater compatibility'),
      1 => t('Use JavaScript - greater security'),
    ),
    '#description' => t('Selecting "Use JavaScript" will nearly guarantee protection from spam harvesters. However email addresses will not appear for browsers without JavaScript capability.'),
  );
  $form['invisimail_link_' . $format] = array(
    '#type' => 'radios',
    '#title' => t('Auto-link Emails'),
    '#default_value' => variable_get('invisimail_link_' . $format, 0),
    '#options' => array(
      0 => t('Do not create links.'),
      1 => t('Automatically create links from email addresses.'),
    ),
    '#description' => t('Selecting "Automatically create links" will convert email addresses into a clickable "mailto:" link.'),
  );
  $form['invisimail_chunk_' . $format] = array(
    '#type' => 'checkbox',
    '#title' => t('Break up text for filtering'),
    '#default_value' => variable_get('invisimail_chunk_' . $format, TRUE),
    '#description' => t('Break up the text to be filtered into chunks with and
                          without anchor tags.  Selecting this option may slow
                          down the filtering of text slightly, but will provide
                          better error messages in the <em>Recent log entries</em>
                          should content not render as you expect it when there
                          are e-mail addresses to obfuscate.'),
  );
  return $form;
}