You are here

backup_migrate_dropbox.module in Backup and Migrate Dropbox 7.3

Functions to define the dropbox backup destination.

@todo: keep the .info file cache on a restore.

File

backup_migrate_dropbox.module
View source
<?php

/**
 * @file
 * Functions to define the dropbox backup destination.
 *
 * @todo: keep the .info file cache on a restore.
 */

/**
 * Implements hook_backup_migrate_destination_subtypes().
 */
function backup_migrate_dropbox_backup_migrate_destination_subtypes() {
  return array(
    'dropbox' => array(
      'type_name' => t('Dropbox'),
      'description' => t('Save the backup files to a !link account.', array(
        '!link' => l(t('Dropbox'), 'https://www.dropbox.com/'),
      )),
      'file' => drupal_get_path('module', 'backup_migrate_dropbox') . '/destinations.dropbox.inc',
      'class' => 'backup_migrate_destination_dropbox',
      'can_create' => TRUE,
      'remote' => TRUE,
    ),
  );
}
function backup_migrate_dropbox_form_backup_migrate_crud_edit_form_alter(&$form, &$form_state) {
  if (!empty($form['item']['#value']) && get_class($form['item']['#value']) === 'backup_migrate_destination_dropbox') {

    // If we just created a new code_verifier, we cache the form, to have the
    // code verifier available on form submit.
    if (!empty($form['#cache'])) {
      $form_state['cache'] = TRUE;
      unset($form['#cache']);
    }
  }
}