You are here

function hook_scald_add_form_fill_alter in Scald: Media Management made easy 7

Alter atoms after the data being filled by provider.

Providers that do extra work to get more data (e.g. from external source) can leave the temporary data in `$atom->_info`. Other module can reuse the data to prefill atom fields to make them available in the next step.

@codingStandardsIgnoreStart

Parameters

array $atoms: Atoms created by the source hook_scald_add_form_fill() callback. For providers not implementing count this will still be an array but with one atom.

array $context: A keyed array with 'form', and 'form_state'.

Related topics

1 invocation of hook_scald_add_form_fill_alter()
scald_atom_add_form_add_submit in includes/scald.pages.inc
Handles the add step form submission.

File

./scald.api.php, line 608
Hooks related to Scald atoms and providers.

Code

function hook_scald_add_form_fill_alter(&$atoms, $context) {

  // @codingStandardsIgnoreEnd
  if ($context['form_state']['scald']['source'] == 'scald_soundcloud') {
    foreach ($atoms as $atom) {
      $atom->field_atom_license[LANGUAGE_NONE][0]['value'] = $atom->_info->license;
    }
  }
}