You are here

function search_files_helper_add in Search Files 5

generate form to add a helper app to the system

Return value

(array) $form

1 call to search_files_helper_add()
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'
search_files_menu in ./search_files.module
Implementation of hook_menu()

File

./search_files.module, line 510
Used to index all files in directory(s) on the server

Code

function search_files_helper_add() {
  $form['instructions'] = array(
    '#type' => 'markup',
    '#value' => $instruction_text,
  );
  $form['search_files_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Helper name'),
    '#size' => 50,
    '#maxlength' => 50,
    '#required' => TRUE,
    '#description' => t('A name for this helper configuration.'),
  );
  $form['search_files_extension'] = array(
    '#type' => 'textfield',
    '#title' => t('Extension'),
    '#size' => 10,
    '#maxlength' => 10,
    '#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' => 100,
    '#default_value' => '/path/to/helper/command %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;
}