+ // TODO, do we need to check for more than the mere presence of a module?

+ elseif ($missing_module) {

+ $options['missing'][$field_name] = $data;

+ }

+ else {

+ $options['available'][$field_name] = $data;

+ }

+ }

+

+ $header = array(t('Field'), t('Field type'), t('Content type(s)'));

+ $form['#tree'] = TRUE;

+ $form['available'] = array(

+ '#type' => 'fieldset',

+ '#collapsible' => TRUE,

+ '#collapsed' => count($options['available']) < 1,

+ '#title' => t('Available fields'),

+ '#description' => t('Fields that have not yet been migrated but are available for migration.'),

+ );

+ $form['available']['data'] = array(

+ '#type' => 'tableselect',

+ '#header' => $header,

+ '#options' => $options['available'],

+ '#empty' => t('No fields are available to be migrated.'),

+ );

+ $form['available']['submit'] = array(

+ '#type' => 'submit',

+ '#value' => t('Migrate selected fields'),

+ '#submit' => array('content_migrate_select_submit'),

+ );

+

+ $form['converted'] = array(

+ '#type' => 'fieldset',

+ '#collapsible' => TRUE,

+ '#collapsed' => count($options['converted']) < 1,

+ '#title' => t('Converted fields'),

+ '#description' => '<p>'. t('Fields that have already been converted. You can choose to roll them back if the conversion did not work correctly. Note that rolling fields back will completely destroy the new field tables.') . ' <span class="error"><strong>' . t('This operation cannot be undone!') . '</strong></span>',

+ );

+ $form['converted']['data'] = array(

+ '#type' => 'tableselect',

+ '#header' => $header,

+ '#options' => $options['converted'],

+ '#empty' => t('No fields are already converted.'),

+ );

+ $form['converted']['submit'] = array(

+ '#type' => 'submit',

+ '#value' => t('Roll back selected fields'),

+ '#submit' => array('content_migrate_rollback_submit'),

+ );

+

+ $form['missing'] = array(

+ '#type' => 'fieldset',

+ '#collapsible' => TRUE,

+ '#collapsed' => count($options['missing']) < 1,

+ '#title' => t('Unavailable fields'),

+ '#description' => t('Fields that cannot be migrated because some modules are missing.'),