You are here

function _pathfilter_settings in Path Filter 6

Same name and namespace in other branches
  1. 5.2 pathfilter.module \_pathfilter_settings()
  2. 5 pathfilter.module \_pathfilter_settings()
  3. 6.2 pathfilter.module \_pathfilter_settings()
  4. 7 pathfilter.module \_pathfilter_settings()

Helper settings function for hook_filter('settings').

1 call to _pathfilter_settings()
pathfilter_filter in ./pathfilter.module
Implementation of hook_filter().

File

./pathfilter.module, line 139
This filter takes internal Drupal paths in double quotes, written as e.g. "internal:node/99", and replaces them with the appropriate absolute http URL using Drupal's url() function [1]. E.g. for a site located at http://example.com/mysite

Code

function _pathfilter_settings($format) {
  $form = array();
  $form['pathfilter'] = array(
    '#type' => 'fieldset',
    '#title' => t('Internal path filter'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['pathfilter']['pathfilter_link_absolute_' . $format] = array(
    '#type' => 'radios',
    '#title' => t('Convert internal paths to'),
    '#options' => array(
      1 => t('Absolute URL (including http://www.example.com)'),
      0 => t('Absolute path (relative to document root)'),
    ),
    '#default_value' => variable_get('pathfilter_link_absolute_' . $format, 1),
    '#description' => t('Should internal paths be transformed to absolute URLs, such as %absolute_url or absolute paths, like %absolute_path. Note that your changes may not appear until the cache has been cleared.', array(
      '%absolute_url' => 'http://www.example.com/my-page',
      '%absolute_path' => '/my-page',
    )),
  );
  return $form;
}