You are here

function _backup_migrate_ui_action_form in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.3 backup_migrate.module \_backup_migrate_ui_action_form()
  2. 6.3 backup_migrate.module \_backup_migrate_ui_action_form()

Alters a B&M action (backup/restore) form to allow for filters to add steps.

2 calls to _backup_migrate_ui_action_form()
backup_migrate_ui_manual_backup_form in ./backup_migrate.module
The backup/export form.
backup_migrate_ui_manual_quick_backup_form in ./backup_migrate.module
The quick backup form.

File

./backup_migrate.module, line 1203
Backup and restore databases for Drupal.

Code

function _backup_migrate_ui_action_form($form, &$form_state, $op = 'backup') {
  $form['operation'] = array(
    '#type' => 'value',
    '#value' => $op,
  );

  // If the form has been submitted at least once then see if there are
  // additional form elements to add.
  if (!empty($form_state['storage']['values']) && !empty($form_state['values']['settings'])) {
    $page = _backup_migrate_filter_before_action_form($form_state['values']['settings'], $op);
    if (!empty($page)) {
      $page['#validate'] = $form['#validate'];
      $page['#submit'] = $form['#submit'];
      $page['submit'] = array(
        '#type' => 'submit',
        '#value' => isset($form_state['values']['op']) ? check_plain($form_state['values']['op']) : t('Continue'),
        '#weight' => 1,
      );
      $form = $page;
    }
  }

  // Add some pre and post processing functions to validate and submit.
  array_unshift($form['#validate'], 'backup_migrate_ui_action_form_pre_validate');
  array_push($form['#validate'], 'backup_migrate_ui_action_form_post_validate');
  array_unshift($form['#submit'], 'backup_migrate_ui_action_form_pre_submit');
  return $form;
}