You are here

function emimage_embed_form in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emimage/emimage.module \emimage_embed_form()
  2. 6.2 contrib/emimage/emimage.module \emimage_embed_form()
1 string reference to 'emimage_embed_form'
theme_emimage_image_embed in contrib/emimage/emimage.theme.inc
Place the 'embed' code for the image in a form element.

File

contrib/emimage/emimage.module, line 278
Embedded Image module is a handler for images hosted on an external site.

Code

function emimage_embed_form($field, $item, $formatter, $node) {
  $embed = $item['value'];
  $width = $field['widget']['full_width'];
  $height = $field['widget']['full_height'];
  $text = module_invoke('emfield', 'include_invoke', 'emimage', $item['provider'], 'image_full', $embed, $width, $height, $field, $item);
  $form = array();
  $form['emimage_embed'] = array(
    '#type' => 'textarea',
    '#title' => t('Embed Code'),
    '#description' => t('To embed this image on your own site, simply copy and paste the html code from this text area.'),
    '#default_value' => $text,
  );
  return $form;
}