Index: filemanager.info
===================================================================
RCS file: filemanager.info
diff -N filemanager.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ filemanager.info	22 Nov 2006 03:44:41 -0000
@@ -0,0 +1,2 @@
+name = File Manager
+description = Provides a managed file repository for other modules
Index: filemanager.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/filemanager/filemanager.install,v
retrieving revision 1.2
diff -u -u -p -8 -r1.2 filemanager.install
--- filemanager.install	12 Sep 2006 17:34:06 -0000	1.2
+++ filemanager.install	22 Nov 2006 03:44:41 -0000
@@ -48,8 +48,17 @@ MYSQL_UPDATE
           working char(1) NOT NULL,
           private char(1) NOT NULL
         );
 PGSQL_UPDATE
       );
       break;
   }
 }
+
+
+/**
+ * Uninstall hook - remove database table
+ */
+function filemanager_uninstall() {
+  db_query('DROP TABLE {file}');
+}
+
Index: filemanager.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/filemanager/filemanager.module,v
retrieving revision 1.20
diff -u -u -p -8 -r1.20 filemanager.module
--- filemanager.module	19 Nov 2006 02:36:51 -0000	1.20
+++ filemanager.module	22 Nov 2006 03:44:41 -0000
@@ -609,37 +609,16 @@ function filemanager_transfer($file, $wo
   }
   else {
     // It's a public file so no auth check is required.
     return file_transfer($filepath, (is_array($headers)) ? $headers : $default_headers);
   }
 }
 
 /**
- * @}
- */
-
-function filemanager_menu($may_cache) {
-  $items = array();
-
-  if ($may_cache) {
-    $items[] = array('path' => 'filemanager/active', 'title' => t('file download'),
-      'callback' => 'filemanager_download_active',
-      'access' => TRUE,
-      'type' => MENU_CALLBACK);
-    $items[] = array('path' => 'filemanager/working', 'title' => t('file download'),
-      'callback' => 'filemanager_download_working',
-      'access' => TRUE,
-      'type' => MENU_CALLBACK);
-  }
-
-  return $items;
-}
-
-/**
  * Menu callback to download the latest active file
  */
 function filemanager_download_active() {
   $file = filemanager_get_file_info($_GET['fid']);
   if ($file) {
     filemanager_transfer($file, FALSE);
   }
   else {
@@ -658,17 +637,17 @@ function filemanager_download_working() 
   }
   else {
     drupal_not_found();
   }
 }
 
 function filemanager_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
+    case 'admin/help#filemanager':
       return t('Adds support for a managed file repository for other modules.');
   }
 }
 
 
 
 /**
  * Checks the existence of the directory specified in $form_element. If
@@ -678,20 +657,50 @@ function filemanager_help($section) {
  * @param $form_element
  *   The form element containing the name of the directory to check.
  */
 function _filemanager_settings_check_directory($form_element) {
   file_check_directory($form_element['#value'], 0, $form_element['#parents'][0]);
   return $form_element;
 }
 
+function filemanager_menu($may_cache) {
+  $items = array();
+
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'admin/settings/filemanager',
+      'title' => t('File Manager settings'),
+      'description' => t('Configure File Manager settings.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('filemanager_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM,
+    );
+    $items[] = array('path' => 'filemanager/active', 'title' => t('file download'),
+      'callback' => 'filemanager_download_active',
+      'access' => TRUE,
+      'type' => MENU_CALLBACK);
+    $items[] = array('path' => 'filemanager/working', 'title' => t('file download'),
+      'callback' => 'filemanager_download_working',
+      'access' => TRUE,
+      'type' => MENU_CALLBACK);
+  }
+
+  return $items;
+}
+
+function filemanager_perm() {
+  return array('administer filemanager');
+}
+
 /**
  * Displays filemanager admin screen
  */
-function filemanager_settings() {
+function filemanager_admin_settings() {
   global $base_url;
 
   $form['filemanager_public_path'] = array(
     '#type' => 'textfield',
     '#title' => t('Public file system path'),
     '#default_value' => variable_get('filemanager_public_path', 'files'),
     '#maxlength' => 255,
     '#after_build' => array('_filemanager_settings_check_directory'),
@@ -775,34 +784,34 @@ function filemanager_settings() {
           '#type' => 'checkbox',
           '#default_value' => variable_get('filemanager_force_private_' . $key, 0),
           '#return_value' => 1,
         ),
       ),
     );
   }
 
-  return $form;
+  return system_settings_form($form);
 }
 
 function theme_filemanager_fileareas_admin($form) {
-  $output = form_render($form['info']);
+  $output = drupal_render($form['info']);
 
   $header = array(t('Area'),t('Description'),t('Max size (Mb)'),t('Force Private'));
   foreach (element_children($form['areas']) as $key) {
     $row = array();
     $row[] = $form['areas'][$key]['#title'];
     $row[] = $form['areas'][$key]['#description'];
-    $row[] = form_render($form['areas'][$key]['limit']);
-    $row[] = form_render($form['areas'][$key]['force']);
+    $row[] = drupal_render($form['areas'][$key]['limit']);
+    $row[] = drupal_render($form['areas'][$key]['force']);
     $rows[] = $row;
   }
   $output .= theme('table', $header, $rows);
 
-  $output .= form_render($form);
+  $output .= drupal_render($form);
   return $output;
 }
 
 /**
  * Handle the submission of the admin/settings form. This is a bit unusual
  * since the settings form is normally handled automatically, but due to the
  * deep fileareas->areas array used for the file areas table, the
  * system_settings_form_submit can't handle all the values without some
