You are here

function filebrowser_form_metadata in Filebrowser 7.4

Same name and namespace in other branches
  1. 8 filebrowser.pages.inc \filebrowser_form_metadata()
  2. 6.2 filebrowser.pages.inc \filebrowser_form_metadata()
  3. 7.2 filebrowser.pages.inc \filebrowser_form_metadata()
  4. 7.3 filebrowser.pages.inc \filebrowser_form_metadata()
1 string reference to 'filebrowser_form_metadata'
filebrowser_menu in ./filebrowser.module

File

./filebrowser.pages.inc, line 126
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,
      );
      $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;
}