You are here

function apachesolr_attachments_settings in Apache Solr Attachments 6

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.2 apachesolr_attachments.admin.inc \apachesolr_attachments_settings()
  4. 7 apachesolr_attachments.admin.inc \apachesolr_attachments_settings()

Displays the Attachment Settings Form.

1 string reference to 'apachesolr_attachments_settings'
apachesolr_attachments_admin_page in ./apachesolr_attachments.admin.inc

File

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

Code

function apachesolr_attachments_settings() {
  $default = implode(' ', apachesolr_attachments_default_excluded());
  $form['apachesolr_attachment_excluded_extensions'] = array(
    '#type' => 'textfield',
    '#title' => t('Excluded file extensions'),
    '#default_value' => variable_get('apachesolr_attachment_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_exclude_types'] = array(
    '#type' => 'radios',
    '#title' => t('Exclude files attached to a node of a type excluded by Apache Solr Search'),
    '#options' => array(
      '0' => t('No'),
      '1' => t('Yes'),
    ),
    '#default_value' => variable_get('apachesolr_attachments_exclude_types', 1),
  );
  $form['apachesolr_attachment_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_attachment_extract_using', 'tika'),
  );
  $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-0.3.jar or tika-app-0.4.jar."),
    '#default_value' => variable_get('apachesolr_attachments_tika_jar', 'tika-0.3.jar'),
  );
  $form['apachesolr_attachments-cron-settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Cron settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['apachesolr_attachments-cron-settings']['apachesolr_attachments_cron_limit'] = array(
    '#type' => 'select',
    '#title' => t('Maximum number of nodes to examine'),
    '#default_value' => variable_get('apachesolr_attachments_cron_limit', 100),
    '#options' => drupal_map_assoc(array(
      10,
      20,
      50,
      100,
      200,
    )),
  );
  $form['apachesolr_attachments-cron-settings']['apachesolr_attachements_cron_time_limit'] = array(
    '#type' => 'select',
    '#title' => t('Maximum time to expend (sec)'),
    '#default_value' => variable_get('apachesolr_attachements_cron_time_limit', 15),
    '#options' => drupal_map_assoc(array(
      5,
      10,
      15,
      20,
      25,
      30,
      45,
      60,
    )),
  );
  $form = system_settings_form($form);
  $form['#validate'][] = 'apachesolr_attachments_settings_validate';
  $form['#submit'][] = 'apachesolr_attachments_settings_submit';
  return $form;
}