You are here

function biblio_ui_attach_biblio_fields_submit in Bibliography Module 7.3

Submit handler; Attach biblio fields to selected biblio types.

File

modules/biblio_ui/biblio_ui.module, line 828
Main functionality file for the biblio UI module.

Code

function biblio_ui_attach_biblio_fields_submit($form, $form_state) {

  // Import all the selected biblio types via batch api.
  $operations = array();
  foreach ($form_state['values']['biblio_types'] as $type) {
    $bundles = array(
      $type,
    );
    $operations[] = array(
      'biblio_create_fields_by_bundle',
      array(
        $bundles,
      ),
    );
  }
  $batch = array(
    'operations' => $operations,
    'title' => t('Attaching biblio fields to selected bundles.'),
    'progress_message' => t('Processed @current out of @total.'),
    'error_message' => t('Example Batch has encountered an error.'),
  );
  batch_set($batch);
  batch_process('admin/structure/biblio/attach-fields');
}