function filebrowser_form_metadata in Filebrowser 8
Same name and namespace in other branches
- 6.2 filebrowser.pages.inc \filebrowser_form_metadata()
- 7.4 filebrowser.pages.inc \filebrowser_form_metadata()
- 7.2 filebrowser.pages.inc \filebrowser_form_metadata()
- 7.3 filebrowser.pages.inc \filebrowser_form_metadata()
File
- ./
filebrowser.pages.inc, line 98 - Several support functions for filebrowser
Code
function filebrowser_form_metadata($form, &$form_state, $fid) {
$content = _filebrowser_node_content_load($fid);
$node = node_load($content['nid']);
_filebrowser_load_files($node, $fid);
$form['#node'] = $node;
foreach ($node->file_listing as $name => &$file) {
if ($name != '.') {
$form[$file['fid']] = array(
'#type' => 'fieldset',
'#title' => $file['display-name'],
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#theme' => 'dir_listing_metadata_group',
);
$form[$file['fid']]['thumbnail'] = array(
'#type' => 'markup',
'#value' => _filebrowser_thumbnails_generate($node, $file),
);
foreach (_filebrowser_externals('metadata_info') as $name => $metadata) {
if (isset($metadata['writable']) && $metadata['writable']) {
$form[$file['fid']][$name] = array(
'#type' => 'textarea',
'#title' => $metadata['title'],
'#default_value' => $file[$name],
);
}
}
}
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('save'),
);
return $form;
}