You are here

function configuration_ui_import_form_submit in Configuration Management 7.2

Submit handler for importing configs.

File

ui/configuration_ui.admin.inc, line 559
User interface functions for Configuration Management.

Code

function configuration_ui_import_form_submit($form, &$form_state) {
  $validators = array(
    'file_validate_extensions' => array(
      'tar',
    ),
  );
  if ($file = file_save_upload('import_configurations', $validators)) {
    $settings = ConfigurationManagement::importToActiveStoreFromTar($file->uri);
    file_delete($file);
    $imported = $settings
      ->getInfo('imported');
    if (!empty($imported)) {
      drupal_set_message(t('The following configurations have been migrated into the ActiveStore:'));
      $imported = $optionals = array(
        'items' => $imported,
      );
      drupal_set_message(filter_xss(theme('item_list', $imported), array(
        'ul',
        'li',
      )));
    }
  }
}