You are here

function emaudio_embed_form in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 5 contrib/emaudio/emaudio.module \emaudio_embed_form()
  2. 6.3 contrib/emaudio/emaudio.module \emaudio_embed_form()
  3. 6 contrib/emaudio/emaudio.module \emaudio_embed_form()
1 string reference to 'emaudio_embed_form'
theme_emaudio_audio_embed in contrib/emaudio/emaudio.theme.inc
@file This defines the various theme functions for Embedded Audio Field (emaudio).

File

contrib/emaudio/emaudio.module, line 297
Embedded Audio module is a handler for mp3 and similar audio files, hosted on 3rd party sites.

Code

function emaudio_embed_form($field, $item, $formatter, $node, $options = array()) {
  $embed = $item['value'];
  $width = $options['width'] ? $options['width'] : $field['widget']['audio_width'];
  $height = $options['height'] ? $options['height'] : $field['widget']['audio_height'];
  $autoplay = $options['autoplay'] ? $options['autoplay'] : $field['widget']['audio_autoplay'];
  $description = $options['description'] ? $options['description'] : t('To embed this audio on your own site, simply copy and paste the html code from this text area.');
  $title = $options['title'] ? $options['title'] : t('Embed Code');
  $text = module_invoke('emfield', 'include_invoke', 'emaudio', $item['provider'], 'audio', $embed, $width, $height, $field, $item, $autoplay);
  $form = array();
  $form['emaudio_embed'] = array(
    '#type' => 'textarea',
    '#title' => $title,
    '#description' => $description,
    '#default_value' => $text,
  );
  return $form;
}