<?php 

/**
 * TODO.
 *
 * @param 
 *   TODO
 * @return
 *   TODO.
 */
function vote_migrate_form_vote_admin_settings_form_alter(&$form, &$form_state) { 
  $form['settings']['actions']['migrate'] = array(
    '#type' => 'submit',
    '#value' => t('Migrate vote data'),
    '#submit' => array('vote_migrate_migration'),
  );
}

/**
 * TODO.
 *
 * @param 
 *   TODO
 * @return
 *   TODO.
 */
function vote_migrate_migration($form, &$form_state) {
  $form_state['redirect'] = 'admin/structure/vote/settings/migrate';
}

/**
 * TODO.
 *
 * @param 
 *   TODO
 * @return
 *   TODO.
 */
function vote_migrate_migration_confirm($form, &$form_state) {
  return confirm_form(array(),
    t('This action cannot be undone.'),
    'admin/structure/vote/settings',
    t('Warning: This will truncate all tables that are involved with the Vote module before migrating any data from VotingAPI. This action cannot be undone.'),
    t('Migrate'),
    t('Cancel')
  );
}

/**
 * TODO.
 *
 * @param 
 *   TODO
 * @return
 *   TODO.
 */
function vote_migrate_migration_confirm_submit($form, &$form_state) {
  //TODO: Insert a batch process for migrating data from VotingAPI to Vote.
  
  $form_state['redirect'] = 'admin/structure/vote/settings';
}