You are here

function migrate_ui_registration_form in Migrate 6.2

Form for reviewing migrations.

1 string reference to 'migrate_ui_registration_form'
migrate_ui_registration in migrate_ui/migrate_ui.pages.inc
Menu callback

File

migrate_ui/migrate_ui.pages.inc, line 739

Code

function migrate_ui_registration_form() {
  $build = array();
  if (variable_get('migrate_disable_autoregistration', FALSE)) {
    $description = t('You currently have automatic class registration turned off.
      This means that any Migration classes, destination handler classes, or
      field handlers must be explicitly registered, either through hook_migrate_api()
      or by calling MigrationBase::registerMigration(). You may enable automatic
      class registration by clicking this button - however, it\'s important to
      note that in some environments registration may fail with errors like
      "<em>Class \'views_handler_field\' not found</em>".');
    $button_label = t('Enable automatic registration');
  }
  else {
    $description = t('You currently have automatic class registration turned on.
      This means that any Migration classes, destination handler classes, or
      field handlers not explicitly registered, either through hook_migrate_api()
      or by calling MigrationBase::registerMigration(), can be registered by
      clicking the <strong>Register</strong> button below. It\'s important to
      note that in some environments registration may fail with errors like
      "<em>Class \'views_handler_field\' not found</em>" - in those cases, you
      can click the <strong>Disable automatic registration</strong> button below,
      but you must be sure that your classes are explicitly registered.');
    $button_label = t('Disable automatic registration');
  }
  $build['registration'] = array(
    '#type' => 'fieldset',
    '#title' => t('Migration registration'),
    '#description' => $description,
  );
  $build['registration']['auto_register'] = array(
    '#type' => 'submit',
    '#value' => $button_label,
    '#submit' => array(
      'migrate_ui_configure_register_auto_register',
    ),
  );
  if (!variable_get('migrate_disable_autoregistration', FALSE)) {
    $build['registration']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Register'),
      '#submit' => array(
        'migrate_ui_configure_register_submit',
      ),
    );
  }
  return $build;
}