You are here

function scald_youtube_extra_options_save_handler in Scald YouTube 7

Handler to store any extra options in the atom Entity.

1 string reference to 'scald_youtube_extra_options_save_handler'
scald_youtube_form_scald_atom_add_form_options_alter in ./scald_youtube.module
Implements hook_form_FORM_ID_alter().

File

./scald_youtube.module, line 255
Defines a YouTube provider for Scald.

Code

function scald_youtube_extra_options_save_handler(&$form, &$form_state) {
  foreach ($form as $key => $data) {
    if (strpos($key, 'atom') === 0) {
      $index = intval(substr($key, 4));
      $form_state['scald']['atoms'][$index]->data['show_related'] = $form_state['values'][$key]['scald_youtube_show_related'];
      $form_state['scald']['atoms'][$index]->data['youtube_autoplay'] = $form_state['values'][$key]['scald_youtube_autoplay'];
      $form_state['scald']['atoms'][$index]->data['youtube_mute'] = $form_state['values'][$key]['scald_youtube_mute'];
    }
  }
}