You are here

function backup_migrate_destination_nodesquirrel::edit_form in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::edit_form()
  2. 6.2 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::edit_form()
  3. 7.2 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::edit_form()

Get the form for the settings for this destination.

Overrides backup_migrate_destination::edit_form

File

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

Class

backup_migrate_destination_nodesquirrel
A destination for sending database backups to the NodeSquirel backup service.

Code

function edit_form() {
  $form = parent::edit_form();
  $form['settings'] = array(
    '#tree' => TRUE,
  );
  $activate_link = nodesquirrel_get_activate_link();

  // Retrieve the key from the settings or get it from the get string if this is an auto-config action.
  $key = $this
    ->settings('secret_key');
  if (!empty($_GET['key']) && preg_match(NODESQUIRREL_SECRET_KEY_PATTERN, $_GET['key'])) {
    $key = $_GET['key'];
  }
  $form['settings']['secret_key'] = array(
    '#type' => 'textfield',
    '#title' => t('Secret Key'),
    '#default_value' => $key,
  );
  $form['settings']['location'] = array(
    '#type' => 'value',
    '#value' => '',
  );
  $form['settings']['secret_key_help'] = array(
    '#type' => 'item',
    '#title' => t('Need a Secret Key?'),
    '#value' => t('Visit !nodesquirrel.', array(
      '!nodesquirrel' => $activate_link,
    )),
  );
  return $form;
}