--- webfm_views.inc.orig	2008-02-09 23:47:40.000000000 +0100
+++ webfm_views.inc	2008-02-10 00:56:35.000000000 +0100
@@ -48,6 +48,20 @@
                                      'sortable' => false,
                                      'help' => t('Display ALL the files that have been attached a node via WebFM (with or without links to the files themselves).  All files are displayed in a single field per node.'),
                                     ),
+                                   'all_files_titles_list' => array(
+                                     'name' => t('WebFM: List of all files by title'),
+                                     'notafield' => true,
+                                     'handler' => 'webfm_views_handler_file_list_all_titles',
+                                     'option' => array(
+                                       '#type' => 'select',
+                                       '#options' => array(
+                                         'link' => t('With links'),
+                                         'nolink' => t('Without links'),
+                                       )
+                                     ),
+                                     'sortable' => false,
+                                     'help' => t('Display ALL the file titles that have been attached a node via WebFM (with or without links to the files themselves).  All file titles are displayed as unordered list.'),
+                                    ),
                                     'fname' => array(
                                       'name' => t('WebFM: File name'),
                                       'handler' => array (
@@ -209,6 +223,30 @@
   return implode(' | ', $links);
 }
 
+function webfm_views_handler_file_list_all_titles($fieldinfo, $fielddata, $value, $data){
+  //global $base_url;
+  $links = array();
+
+  $query = "SELECT wf.* FROM {webfm_file} wf INNER JOIN {webfm_attach} wa ON wf.fid = wa.fid WHERE wa.nid = %d ORDER BY %s";
+  $result = db_query($query, $data->nid, 'wa.weight');
+    while ($file = db_fetch_object($result)) {
+    if ($fielddata['options'] == 'nolink') {
+      $links[] = check_plain(urldecode($file->ftitle));
+    }
+    else {
+      $links[] = l(check_plain(urldecode($file->ftitle)), 'webfm_send/'.$file->fid);
+    }
+  }
+  
+  $output = '<ul>';
+  foreach($links as $link) {
+    $output = $output.'<li>'.$link.'</li>';
+  }
+  $output = $output.'</ul>';
+
+  return $output;  
+}
+
 function webfm_views_handler_file_filename($fieldinfo, $fielddata, $value, $data){
   return $value;
 }
