You are here

function backup_migrate_nodesquirrel_settings_form in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/destinations.nodesquirrel.inc \backup_migrate_nodesquirrel_settings_form()

NodeSquirrel settings form.

1 string reference to 'backup_migrate_nodesquirrel_settings_form'
backup_migrate_nodesquirrel_settings in includes/destinations.nodesquirrel.inc
NodeSquirrel settings page callback.

File

includes/destinations.nodesquirrel.inc, line 98
Functions to handle the NodeSquirrel backup destination.

Code

function backup_migrate_nodesquirrel_settings_form($form_state) {
  _backup_migrate_message_callback('_backup_migrate_message_browser');
  $form = array();
  $key = variable_get('nodesquirrel_secret_key', '');
  $destination = nodesquirrel_check_secret_key($key);
  $form['nodesquirrel_status'] = array(
    '#type' => 'fieldset',
    '#title' => t('NodeSquirrel Status'),
  );
  $form['nodesquirrel_status']['status'] = array(
    '#type' => 'item',
    '#title' => t('NodeSquirrel Status'),
    '#value' => t('Not Configured'),
  );

  // Warn the user if the key they entered is invalid.
  if ($key && empty($destination)) {
    $form['nodesquirrel_status']['status']['#markup'] = t('Your secret key does not seem to be valid. Please check that you entered it correctly or visit !ns to generate a new key.', array(
      '!ns' => nodesquirrel_get_activate_link(),
    ));
  }
  else {
    if (!empty($destination)) {
      $form['nodesquirrel_status']['manage'] = array(
        '#type' => 'item',
        '#title' => t('Management Console'),
        '#value' => nodesquirrel_get_manage_link($destination),
        '#description' => t('You can use the NodeSquirrel management console to add and edit your sites, reset your secret key, download and delete backups, and modify your NodeSquirrel account.'),
      );
      $form['nodesquirrel_status']['status']['#value'] = t('Ready to Backup');
    }
  }
  $form += backup_migrate_nodesquirrel_credentials_settings_form($key);
  return system_settings_form($form);
}