You are here

function entityform_anonymous_form_entityform_type_form_alter in Entityform 7.2

Implements hook_form_FORM_ID_alter(): entityform_type_form.

Add Anonymous Tracking field set.

File

entityform_anonymous/entityform_anonymous.module, line 177
Main functions and hook implementations

Code

function entityform_anonymous_form_entityform_type_form_alter(&$form, &$form_state, $form_id) {
  $entityform_type = $form['#entityform_type'];
  $form['data']['anonymous_set'] = array(
    '#type' => 'fieldset',
    '#title' => t('Anonymous Tracking'),
    '#description' => t('<strong>Warning</strong>: these features are still experimental and should be throughly tested.'),
    '#collapsible' => TRUE,
    '#group' => 'additional_settings',
    '#weight' => 150,
  );
  $form['data']['anonymous_set']['anonymous_links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Provide Anonymous Links'),
    '#default_value' => !empty($entityform_type->data['anonymous_links']),
    '#description' => t('Allow entityform submissions to be accessible via anonymous links. These links will be available as tokens. <strong>Warning</strong> anyone with access to these links will be able to access connected submissions.'),
  );
  $form['data']['anonymous_set']['session_save'] = array(
    '#type' => 'checkbox',
    '#title' => t('Save session id with Submission'),
    '#default_value' => !empty($entityform_type->data['session_save']),
    '#description' => t('Save the session id with the Entityform Submission. This will allow anonymous users to edit their submissions. <strong>Warning</strong> submissions will remain connected to browser sessions.'),
  );
  $form['#validate'][] = 'entityform_anonymous_entityform_type_form_validate';
}