You are here

function _shortener_url_settings in Shorten URLs 6

Same name and namespace in other branches
  1. 7.2 shortener/shortener.module \_shortener_url_settings()
  2. 7 shortener/shortener.module \_shortener_url_settings()

Builds the settings form for the input filter.

1 call to _shortener_url_settings()
shortener_filter in shortener/shortener.module
Implementation of hook_filter().

File

shortener/shortener.module, line 120
Provides an input filter that replaces URLs with a shortened version.

Code

function _shortener_url_settings($format) {
  $form['shortener_urlfilter'] = array(
    '#type' => 'fieldset',
    '#title' => t('URL shortener'),
    '#collapsible' => TRUE,
  );
  $form['shortener_urlfilter']['shortener_url_behavior_' . $format] = array(
    '#type' => 'radios',
    '#title' => t('Behavior'),
    '#default_value' => variable_get('shortener_url_behavior_' . $format, 'short'),
    '#options' => array(
      'short' => t('Display the shortened URL by default, and add an "(expand)"/"(shorten)" link'),
      'strict' => t('Display the shortened URL by default, and do not allow expanding it'),
      'long' => t('Display the full URL by default, and add a "(shorten)"/"(expand)" link'),
    ),
  );
  $form['shortener_urlfilter']['shortener_url_length_' . $format] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum link text length'),
    '#default_value' => variable_get('shortener_url_length_' . $format, 72),
    '#maxlength' => 4,
    '#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
  );
  return $form;
}