You are here

function apachesolr_attachments_settings in Apache Solr Attachments 7

Same name and namespace in other branches
  1. 5 apachesolr_attachments.module \apachesolr_attachments_settings()
  2. 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_settings()
  3. 6 apachesolr_attachments.admin.inc \apachesolr_attachments_settings()
  4. 6.2 apachesolr_attachments.admin.inc \apachesolr_attachments_settings()

Displays the Attachment Settings Form.

See also

apachesolr_attachments_settings_validate()

apachesolr_attachments_settings_submit()

1 string reference to 'apachesolr_attachments_settings'
apachesolr_attachments_admin_page in ./apachesolr_attachments.admin.inc
Menu callback: Apache Solr Attachments settings tab.

File

./apachesolr_attachments.admin.inc, line 30
Provides a file attachment search implementation for use with the Apache Solr module

Code

function apachesolr_attachments_settings($form, &$form_state, $env_id) {
  $default = implode(' ', apachesolr_attachments_default_excluded());
  $form['apachesolr_attachments_excluded_extensions'] = array(
    '#type' => 'textfield',
    '#title' => t('Excluded file extensions'),
    '#default_value' => variable_get('apachesolr_attachments_excluded_extensions', $default),
    '#size' => 80,
    '#maxlength' => 255,
    '#description' => t('File extensions that are excluded from indexing. Separate extensions with a space and do not include the leading dot. Extensions are internally mapped to a MIME type, so it is not necessary to put variations that map to the same type (e.g. tif is sufficient for tif and tiff)'),
  );
  $form['apachesolr_attachments_extract_using'] = array(
    '#type' => 'radios',
    '#title' => t('Extract using'),
    '#options' => array(
      'tika' => t('Tika (local java application)'),
      'solr' => t('Solr (remote server)'),
    ),
    '#description' => t("Extraction will be faster if run locally using tika."),
    '#default_value' => variable_get('apachesolr_attachments_extract_using', 'tika'),
  );
  $form['apachesolr_attachments_filesize_limit'] = array(
    '#type' => 'textfield',
    '#title' => t('File size limit (in bytes) for files to be indexed'),
    '#size' => 10,
    '#description' => t('If a file is larger than this limit, do not index it. Default is 41943040 bytes (40MB).'),
    '#default_value' => variable_get('apachesolr_attachments_filesize_limit', '41943040'),
  );
  $form['apachesolr_attachments_tika_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Tika directory path'),
    '#size' => 80,
    '#maxlength' => 100,
    '#description' => t("The full path to the tika directory. All library jars must be in the same directory. If on Windows, use forward slashes in the path."),
    '#default_value' => variable_get('apachesolr_attachments_tika_path', ''),
  );
  $form['apachesolr_attachments_tika_jar'] = array(
    '#type' => 'textfield',
    '#title' => t('Tika jar file'),
    '#size' => 20,
    '#description' => t("The name of the tika CLI application jar file, e.g. tika-app-1.1.jar."),
    '#default_value' => variable_get('apachesolr_attachments_tika_jar', 'tika-app-1.1.jar'),
  );
  $form = system_settings_form($form);
  $form['#validate'][] = 'apachesolr_attachments_settings_validate';
  $form['#submit'][] = 'apachesolr_attachments_settings_submit';
  return $form;
}