function theme_filefield_source_attach_element in FileField Sources 7
Same name and namespace in other branches
- 6 sources/attach.inc \theme_filefield_source_attach_element()
Theme the output of the autocomplete field.
1 theme call to theme_filefield_source_attach_element()
- filefield_source_attach_process in sources/
attach.inc - A #process callback to extend the filefield_widget element type.
File
- sources/
attach.inc, line 272 - A FileField extension to allow use of files within a server directory.
Code
function theme_filefield_source_attach_element($variables) {
$element = $variables['element'];
if (isset($element['attach_message'])) {
$output = $element['attach_message']['#markup'];
}
else {
$select = '';
$size = !empty($element['filename']['#size']) ? ' size="' . $element['filename']['#size'] . '"' : '';
_form_set_class($element['filename'], array(
'form-select',
));
$multiple = !empty($element['#multiple']);
$output = '<select name="' . $element['filename']['#name'] . '' . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['filename']['#attributes']) . ' id="' . $element['filename']['#id'] . '" ' . $size . '>' . form_select_options($element['filename']) . '</select>';
}
$output .= drupal_render($element['attach']);
$element['#children'] = $output;
return '<div class="filefield-source filefield-source-attach clear-block">' . theme('form_element', array(
'element' => $element,
)) . '</div>';
}