You are here

function autoupload_custom_combo in AutoUpload 7

Function to return a textbox combo form.

1 call to autoupload_custom_combo()
autoupload_admin_form in ./autoupload.admin.inc
Form builder for the autoupload settings page.

File

./autoupload.admin.inc, line 110
Contains the administrative functions of the autoupload module.

Code

function autoupload_custom_combo($delta = 0, $enabled = NULL, $name = '', $settings = array()) {
  $form['#tree'] = TRUE;
  $form['enabled'] = array(
    '#type' => 'checkbox',
    '#default_value' => $enabled === NULL ? TRUE : $enabled,
  );
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#default_value' => $name,
  );
  $form['context'] = array(
    '#type' => 'textfield',
    '#title' => t('Context'),
    '#description' => t('Selector for the field container.'),
    '#default_value' => isset($settings['context']) ? $settings['context'] : '',
  );
  $form['file_input'] = array(
    '#type' => 'textfield',
    '#title' => t('File Input Selector'),
    '#description' => t('Selector for the file input.'),
    '#default_value' => isset($settings['file_input']) ? $settings['file_input'] : '',
  );
  $form['file_event'] = array(
    '#type' => 'textfield',
    '#title' => t('File Event'),
    '#description' => t('Event on the file input that should trigger the submit event.'),
    '#default_value' => isset($settings['file_event']) ? $settings['file_event'] : '',
  );
  $form['submit_input'] = array(
    '#type' => 'textfield',
    '#title' => t('Submit Input Selector'),
    '#description' => t('Selector for the submit input.'),
    '#default_value' => isset($settings['submit_input']) ? $settings['submit_input'] : '',
  );
  $form['submit_event'] = array(
    '#type' => 'textfield',
    '#title' => t('Submit Event'),
    '#description' => t('Event on the submit input that should be triggered to start the upload.'),
    '#default_value' => isset($settings['submit_event']) ? $settings['submit_event'] : '',
  );
  $form['error'] = array(
    '#type' => 'textfield',
    '#title' => t('Error Element Selector'),
    '#description' => t('Selector for error element. Before upload, a check is done. If element is found, submit will not trigger.'),
    '#default_value' => isset($settings['error']) ? $settings['error'] : '',
  );
  $form['error_remove'] = array(
    '#type' => 'select',
    '#title' => t('Error removal handling'),
    '#description' => t('Choose the type of removal for the element that matches the selector above.'),
    '#default_value' => isset($settings['error_remove']) ? $settings['error_remove'] : '',
    '#options' => array(
      '' => t('None; error removal is handled already'),
      'id' => t('Remove the ID'),
      'class' => t('Remove the class'),
      'element' => t('Remove the entire element'),
    ),
  );
  $form['delete'] = array(
    '#type' => 'checkbox',
    '#default_value' => FALSE,
  );
  return $form;
}