You are here

function backup_migrate_destination_dropbox::edit_form in Backup and Migrate Dropbox 7

Same name and namespace in other branches
  1. 6.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::edit_form()
  2. 6 destinations.dropbox.inc \backup_migrate_destination_dropbox::edit_form()
  3. 7.3 destinations.dropbox.inc \backup_migrate_destination_dropbox::edit_form()
  4. 7.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::edit_form()

Get the form for the settings for this filter.

File

./destinations.dropbox.inc, line 50
destinations.dropbox.inc

Class

backup_migrate_destination_dropbox
A destination for sending database backups to a Dropbox account.

Code

function edit_form() {
  $form = parent::edit_form();
  $form['description'] = array(
    '#type' => 'markup',
    '#weight' => -999,
    '#markup' => t('<p>In order to use your DropBox account as a Backup and Migrate destination,
        you must create a DropBox App and obtain an application token and enter it below.
        <ol>
          <li>Create a DropBox App by logging into your DropBox account and going to
              <a href="https://www.dropbox.com/developers/apps">https://www.dropbox.com/developers/apps</a>.</li>
          <li>Click the button to "Create an app". Be sure to give your app a descriptive name,
              as the name you give it will be part of the path within your DropBox folder. For example,
              if you create an app called "kittens", then DropBox will create a DropBox/Apps/kittens
              directory in your DropBox folder.</li>
          <li>In the OAuth 2 section of your app settings you will see a button that says "Generate Access Token".
              Click this button. Copy the entire token and paste it into the Token below.</li>
        </ol></p>'),
  );
  $form['name']['#description'] = t('Enter a "friendly" name for this destination. Only appears as a descriptor in the Backup and Migrate administration screens.');
  $form['scheme'] = array(
    '#type' => 'value',
    '#value' => 'https',
  );
  $form['host'] = array(
    '#type' => 'value',
    '#value' => 'www.dropbox.com',
  );
  $form['path']['#description'] = t('A relative folder inside your Dropbox App folder. For example, Dropbox/Apps/(your app name)/(whatever path you enter here). Do not you slashes before or after the path.');
  $form['path']['#required'] = FALSE;
  $form['user'] = array(
    '#type' => 'value',
    '#value' => '',
  );
  $form['old_password'] = array(
    '#type' => 'value',
    '#value' => '',
  );
  $form['pass'] = array(
    '#type' => 'value',
    '#value' => '',
  );
  $form['settings']['token'] = array(
    '#type' => 'textfield',
    '#title' => 'Dropbox App Token',
    '#description' => 'Generated access token from your app. <b>Do not</b> use the secret key.',
    '#required' => TRUE,
    "#default_value" => $this
      ->settings('token'),
  );
  $form['settings']['#weight'] = 60;
  return $form;
}