You are here

function hook_scald_add_atom_count in Scald: Media Management made easy 7

Provides number of atoms available when a form is submitted.

Some widgets are able to create multiple atoms at a time. This hook is usually used to check number of atoms available in a form. If a provider does not support multiple atom creation, return 1.

@codingStandardsIgnoreStart

Parameters

array $form: The form array.

array $form_state: The form state array.

Related topics

4 functions implement hook_scald_add_atom_count()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

scald_audio_scald_add_atom_count in modules/providers/scald_audio/scald_audio.module
Implements hook_scald_add_atom_count().
scald_flash_scald_add_atom_count in modules/providers/scald_flash/scald_flash.module
Implements hook_scald_add_atom_count().
scald_image_scald_add_atom_count in modules/providers/scald_image/scald_image.module
Implements hook_scald_add_atom_count().
scald_video_scald_add_atom_count in modules/providers/scald_video/scald_video.module
Implements hook_scald_add_atom_count().

File

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

Code

function hook_scald_add_atom_count(&$form, &$form_state) {

  // @codingStandardsIgnoreEnd
  if (is_array($form_state['values']['file'])) {
    return max(count($form_state['values']['file']), 1);
  }
  return 1;
}