You are here

function autosave_admin_settings in Autosave 7

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.2 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 48
Does background saves of node being edited.

Code

function autosave_admin_settings($form, &$form_state) {
  if (!file_exists(AUTOSAVE_PATH . '/jquery.field.js')) {
    drupal_set_message(t('Unable to find the jQuery Field Plugin in !path. Please <a href="http://plugins.jquery.com/files/jquery.field.js_4.txt">download jquery.field.js</a>
      and place it into !path.', array(
      '!path' => $path,
    )), 'error');
  }
  $form['autosave_period'] = array(
    '#type' => 'textfield',
    '#title' => t('Autosave after this amount seconds has passed'),
    '#default_value' => variable_get('autosave_period', 10),
  );
  $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>",
  );
  return system_settings_form($form);
}