You are here

function _backup_migrate_ui_backup_settings_form in Backup and Migrate 7.2

Same name and namespace in other branches
  1. 8.2 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()
  2. 8.3 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()
  3. 5.2 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()
  4. 6.3 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()
  5. 6.2 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()
  6. 7.3 includes/profiles.inc \_backup_migrate_ui_backup_settings_form()

Get a form to configure the profile.

2 calls to _backup_migrate_ui_backup_settings_form()
backup_migrate_profile::edit_form in includes/profiles.inc
Get the edit form.
backup_migrate_ui_manual_backup_form in ./backup_migrate.module
The backup/export form.

File

includes/profiles.inc, line 73

Code

function _backup_migrate_ui_backup_settings_form($profile) {
  drupal_add_js(array(
    'backup_migrate' => array(
      'checkboxLinkText' => t('View as checkboxes'),
    ),
  ), array(
    'type' => 'setting',
  ));
  drupal_add_js(drupal_get_path('module', 'backup_migrate') . '/backup_migrate.js', array(
    'type' => 'file',
    'scope' => 'footer',
  ));
  drupal_add_css(drupal_get_path('module', 'backup_migrate') . '/backup_migrate.css');
  backup_migrate_include('files', 'destinations', 'filters');
  $form = array();
  $form['file'] = array(
    "#type" => "fieldset",
    "#title" => t("Backup File"),
    "#collapsible" => TRUE,
    "#collapsed" => FALSE,
    "#tree" => FALSE,
  );
  $form['file']['filename'] = array(
    "#type" => "textfield",
    "#title" => t("Backup file name"),
    "#default_value" => $profile->filename,
  );
  if (module_exists('token')) {
    $form['file']['filename']['#description'] = t('You can use tokens in the file name.');
    $form['file']['token_help'] = array(
      '#title' => t('Replacement patterns'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['file']['token_help']['help'] = array(
      '#theme' => 'token_tree',
      '#token_types' => array(
        'current-date',
        'site',
      ),
      '#global_types' => FALSE,
    );
  }
  $form['file']['append_timestamp'] = array(
    "#type" => "checkbox",
    "#title" => t("Append a timestamp."),
    "#default_value" => $profile->append_timestamp,
  );
  $form['file']['timestamp_format'] = array(
    "#type" => "textfield",
    "#title" => t("Timestamp format"),
    "#default_value" => $profile->timestamp_format,
    "#description" => t('Should be a PHP <a href="!url">date()</a> format string.', array(
      '!url' => 'http://www.php.net/date',
    )),
  );
  $form['advanced'] = array(
    '#weight' => 10,
  );
  $form = array_merge_recursive($form, backup_migrate_filters_settings_form($profile->filters, 'backup'));

  // Add the advanced fieldset if there are any fields in it.
  if ($form['advanced']) {
    $form['advanced']['#type'] = 'fieldset';
    $form['advanced']['#title'] = t('Advanced Options');
    $form['advanced']['#collapsed'] = true;
    $form['advanced']['#collapsible'] = true;
  }
  $form['#validate'][] = '_backup_migrate_ui_backup_settings_form_validate';
  $form['#submit'][] = '_backup_migrate_ui_backup_settings_form_submit';
  return $form;
}