You are here

function autosave_admin_settings in Autosave 7.2

Same name and namespace in other branches
  1. 5.3 autosave.module \autosave_admin_settings()
  2. 5 autosave.module \autosave_admin_settings()
  3. 5.2 autosave.module \autosave_admin_settings()
  4. 6.2 autosave.module \autosave_admin_settings()
  5. 6 autosave.module \autosave_admin_settings()
  6. 7 autosave.module \autosave_admin_settings()

Menu callback; return the autosave module settings form.

1 string reference to 'autosave_admin_settings'
autosave_menu in ./autosave.module
Implements hook_menu().

File

./autosave.module, line 116
Does background saves of node being edited.

Code

function autosave_admin_settings($form, &$form_state) {
  $form['autosave_period'] = array(
    '#type' => 'textfield',
    '#title' => t('Autosave after this amount of seconds has passed'),
    '#default_value' => variable_get('autosave_period', 10),
  );
  $form['autosave_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Autosave timeout'),
    '#description' => t('No autosaving happens while the Ignore/Restore popup is shown. Here you can set the amount of seconds to show this popup for. Set this to 0 to hide it only if the user clicks either Ignore or Restore.'),
    '#default_value' => variable_get('autosave_timeout', 0),
  );
  $form['autosave_hidden'] = array(
    '#prefix' => '<div class="form-item"><label for="edit-autosave-hidden">' . t('Stealth Mode') . '</label>',
    '#type' => 'checkbox',
    '#title' => t('Run in stealth mode'),
    '#description' => t('If this check box is selected no popup will appear notifying user that the form has been autosaved.'),
    '#default_value' => variable_get('autosave_hidden', 0),
    '#suffix' => "</div>",
  );
  $form['autosave_ignore_behavior'] = array(
    '#type' => 'checkbox',
    '#title' => t('Remove autosaved form when clicking \'Ignore\''),
    '#description' => t('If this checkbox is selected the autosaved form will be deleted from the database when clicking the Ignore button.'),
    '#default_value' => variable_get('autosave_ignore_behavior', 0),
  );
  $form['autosave_form_ids'] = array(
    '#type' => 'textarea',
    '#default_value' => variable_get('autosave_form_ids', ''),
    '#title' => t('Form ids to autosave'),
    '#description' => t('Add the form ids that autosave should apply to. Each form id should go into a separate line. Note that node form autosaving can also be enabled on the node type admin form. The form id of a form is the \'value\' attribute of the hidden &lt;input&gt; HTML element with the name \'form_id\' in the &lt;form&gt;.'),
  );
  return system_settings_form($form);
}