You are here

function filebrowser_form_metadata in Filebrowser 6.2

Same name and namespace in other branches
  1. 8 filebrowser.pages.inc \filebrowser_form_metadata()
  2. 7.4 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
Implementation of hook_menu().

File

./filebrowser.pages.inc, line 25

Code

function filebrowser_form_metadata($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' => FALSE,
        '#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;
}