diff -r 439aa0d4c0b5 filebrowser.module
--- a/filebrowser.module	Tue Mar 18 11:49:55 2008 +0300
+++ b/filebrowser.module	Tue Mar 18 12:23:14 2008 +0300
@@ -98,7 +98,8 @@ function filebrowser_page($path) {
     }
   }
 
-  $output = theme('table', array(t('Name'), t('Size')), $files);
+  $header = array(t('Name'), t('Size'));
+  $output = theme('filebrowser_page', $files, $header);
 
   $output .= '<p>'. t('Contains @fc files totaling @ds in size', array('@fc' => count($files), '@ds' => format_size($total_size))) .'</p>';
 
@@ -275,6 +276,9 @@ function theme_filebrowser_admin_setting
  */
 function filebrowser_theme() {
   return array(
+    'filebrowser_page' => array(
+      'arguments' => array('files' => NULL, 'header' => NULL)
+    ),
     'filebrowser_admin_settings' => array(
       'arguments' => array('form' => NULL)
     )
@@ -308,4 +312,18 @@ function _filebrowser_dir_stats($dir) {
   }
 
   return array('file_count' => $file_count, 'total_size' => $total_size);
+}
+
+/**
+ * Theme a filebrowser page, if files are available or not.
+ * Here you have some possibility to reformat the data or the table layout.
+ */
+function theme_filebrowser_page(&$files, $header = NULL) {
+  if ($files) {
+    // CSS can hook on this ID to style table elements differently
+    return '<div id="filebrowser-page">' . theme("table", $header, $files) . '</div>';
+  }
+  else {
+    return '';
+  }
 }
