You are here

function theme_filefield_source_clipboard_element in FileField Sources 7

Theme the output of the clipboard field.

1 theme call to theme_filefield_source_clipboard_element()
filefield_source_clipboard_process in sources/clipboard.inc
A #process callback to extend the filefield_widget element type.

File

sources/clipboard.inc, line 181
A FileField extension to allow transfer of files through the clipboard.

Code

function theme_filefield_source_clipboard_element($variables) {
  $element = $variables['element'];
  $capture = '<div class="filefield-source-clipboard-capture" contenteditable="true"><span class="hint">example_filename.png</span></div>';
  $element['#field_suffix'] = drupal_render($element['upload']) . ' <span class="hint">' . t('ctrl + v') . '</span>';
  $element['#description'] = t('Enter a file name and paste an image from the clipboard. This feature only works in <a href="http://drupal.org/node/1775902">limited browsers</a>.');
  $element['#children'] = $capture . drupal_render_children($element);
  return '<div class="filefield-source filefield-source-clipboard clear-block">' . theme('form_element', array(
    'element' => $element,
  )) . '</div>';
}