You are here

function anonymous_publishing_pet_admin_privacy in Anonymous Publishing 7

Menu callback: Form to change privacy settings and flush queue.

Return value

array Form.

1 string reference to 'anonymous_publishing_pet_admin_privacy'
anonymous_publishing_pet_menu in modules/pet/anonymous_publishing_pet.module
Implements hook_menu().

File

modules/pet/anonymous_publishing_pet.module, line 136
Main hooks for Anonymous Publishing PET module.

Code

function anonymous_publishing_pet_admin_privacy($form, &$form_state) {
  $period = array(
    0 => t('Delete ASAP'),
    3600 => format_interval(3600),
    21600 => format_interval(21600),
    43200 => format_interval(43200),
    86400 => format_interval(86400),
    259200 => format_interval(259200),
    604800 => format_interval(604800),
    2592000 => format_interval(2592000),
    -1 => t('Indefinitely'),
  );
  $form = array();
  $form['anonymous_publishing_privacy'] = array(
    '#markup' => t('<p>For enhanced privacy, you can set a limited retention period for the real name records, or purge this information instantly.</p>'),
  );
  $form['apperiod'] = array(
    '#type' => 'fieldset',
    '#title' => t('Retention period'),
    '#collapsible' => FALSE,
  );
  $form['apperiod']['anonymous_publishing_pet_period'] = array(
    '#type' => 'select',
    '#title' => t('Maximum period to retain real name records:'),
    '#default_value' => variable_get('anonymous_publishing_pet_period', -1),
    '#options' => $period,
    '#description' => t('Select “Indefinitely” to make the real name records persistent.'),
  );
  $form['apperiod']['submit'] = array(
    '#type' => 'submit',
    '#disabled' => FALSE,
    '#value' => t('Save setting'),
  );
  $form['appurge'] = array(
    '#type' => 'fieldset',
    '#title' => t('Purge'),
    '#collapsible' => FALSE,
  );
  $form['appurge']['info'] = array(
    '#markup' => t('<p>Press button below to immediately purge all real name records.  This operation can not be reversed.</p>'),
  );
  $form['appurge']['submit'] = array(
    '#type' => 'submit',
    '#disabled' => FALSE,
    '#value' => t('Purge now'),
  );
  return $form;
}