You are here

function search_files_helper_add_form in Search Files 6.2

generate form to add a helper app to the system

Return value

(array) $form

1 call to search_files_helper_add_form()
search_files_helper_edit in ./search_files.module
fetch the helper add form, alter the form for use as an edit form, populate the #default_values fields and return the form
1 string reference to 'search_files_helper_add_form'
search_files_menu in ./search_files.module
Implementation of hook_menu().

File

./search_files.module, line 313
Used to index files in attachments and directories

Code

function search_files_helper_add_form() {
  $form['search_files_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Helper name'),
    '#size' => 50,
    '#maxlength' => 50,
    '#default_value' => 'Foo extractor',
    '#required' => TRUE,
    '#description' => t('A name for this helper configuration.'),
  );
  $form['search_files_extension'] = array(
    '#type' => 'textfield',
    '#title' => t('Extension'),
    '#size' => 10,
    '#maxlength' => 10,
    '#default_value' => 'foo',
    '#required' => TRUE,
    '#description' => t('Enter the extension for the files that you want the helper application to process. Do not include the period.'),
  );
  $form['search_files_helper_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Helper path'),
    '#size' => 100,
    '#maxlength' => 255,
    '#default_value' => '/opt/bin/foo-extract %file%',
    '#validate' => array(
      'search_files_helpers_validate_add_edit' => array(),
    ),
    '#required' => TRUE,
    '#description' => t('Enter the path to the helper application installed on your server. "%file%" is a placeholder for the path of the attachment file and is required. Include any command-line parameters as well (for example, pdftotext requires a - after the file to be processed).'),
  );
  $form['submit_done'] = array(
    '#type' => 'submit',
    '#value' => 'Save and Done',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save add another',
  );
  return $form;
}