You are here

function backup_migrate_destination_nodesquirrel::edit_form in Backup and Migrate 7.2

Same name and namespace in other branches
  1. 8.3 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::edit_form()
  2. 6.3 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::edit_form()
  3. 6.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 315
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 = l('nodesquirrel.com/activate', variable_get('nodesquirrel_activate_url', 'http://manage.nodesquirrel.com/activate'), array(
    'query' => array(
      'url' => url('', array(
        'absolute' => TRUE,
      )),
      'email' => variable_get('site_mail', ''),
      'configure' => url($_GET['q'], array(
        'absolute' => TRUE,
      )),
    ),
  ));

  // 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?'),
    '#markup' => t('Visit !nodesquirrel.', array(
      '!nodesquirrel' => $activate_link,
    )),
  );
  return $form;
}