Index: util.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/util.module,v
retrieving revision 1.13
diff -u -r1.13 util.module
--- util.module	30 May 2008 15:26:00 -0000	1.13
+++ util.module	30 May 2008 17:24:34 -0000
@@ -1,6 +1,13 @@
 <?php
 // $Id: util.module,v 1.13 2008/05/30 15:26:00 litwol Exp $
 
+/**
+ * @file
+ */
+
+/**
+ * Implementation of hook_menu().
+ */
 function util_menu() {
   $menu['admin/settings/util'] = array(
     'title'         => 'Utilities',
Index: util.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/util.install,v
retrieving revision 1.5
diff -u -r1.5 util.install
--- util.install	30 May 2008 15:26:00 -0000	1.5
+++ util.install	30 May 2008 17:24:34 -0000
@@ -1,8 +1,12 @@
 <?php
-//$Id: util.install,v 1.5 2008/05/30 15:26:00 litwol Exp $
+// $Id: util.install,v 1.5 2008/05/30 15:26:00 litwol Exp $
 
 /**
- * hook_uninstall()
+ * @file
+ */
+
+/**
+ * Implementation of hook_uninstall().
  */
 function util_uninstall() {
   db_query("DELETE FROM {variable} WHERE name LIKE '%s%%'", 'util_');
Index: perms_fieldsets.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/perms_fieldsets.module,v
retrieving revision 1.4
diff -u -r1.4 perms_fieldsets.module
--- perms_fieldsets.module	30 May 2008 15:26:00 -0000	1.4
+++ perms_fieldsets.module	30 May 2008 17:24:34 -0000
@@ -1,6 +1,13 @@
 <?php
 // $Id: perms_fieldsets.module,v 1.4 2008/05/30 15:26:00 litwol Exp $
 
+/**
+ * @file
+ */
+
+/**
+ * Implementation of hook_menu().
+ */
 function perms_fieldsets_menu() {
   $menu['admin/settings/util/apfm'] = array(
     'title'          => 'Manage Access Permissions Fieldsets',
@@ -8,11 +15,14 @@
     'page callback'  => 'drupal_get_form',
     'page arguments' => array('perms_fieldsets_settings'),
     'access arguments' => array('administer site configuration'),
+    'type' => MENU_LOCAL_TASK,
   );
   return $menu;
 }
 
-// the theme registry
+/**
+ * Implementation of hook_theme().
+ */
 function perms_fieldsets_theme() {
   return array(
     'perms_fieldsets_theme' => array(
@@ -21,6 +31,12 @@
   );
 }
 
+/**
+ * Form builder; generate settings form.
+ *
+ * @ingroup forms
+ * @see system_settings_form()
+ */
 function perms_fieldsets_settings() {
   $form['todo'] = array(
     '#type'     => 'fieldset',
@@ -34,9 +50,12 @@
     '#type'     => 'item',
     '#value'    => 'Enable permission counter per role ( administrator[3/10] )',
   );
-  return $form;
+  return system_settings_form($form);
 }
 
+/**
+ * Implementation of hook_form_alter().
+ */
 function perms_fieldsets_form_alter(&$form, $form_state, $form_id) {
 //  drupal_set_message($form_id);
 //  drupal_set_message('<pre>'. print_r($form, 1) .'</pre>');
@@ -52,10 +71,10 @@
 }
 
 function theme_perms_fieldsets_theme($form) {
-  $header[] = array('data' =>t('Permission'), 'width' => '100%');
+  $header[] = array('data' => t('Permission'), 'width' => '100%');
   foreach (element_children($form['role_names']) as $rid) {
     if (is_array($form['role_names'][$rid])) {
-      $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox', 'nowrap'=>'nowrap');
+      $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox', 'nowrap' => 'nowrap');
     }
   }
   //This is my custom fieldset-enabled form
Index: system_module.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/system_module.module,v
retrieving revision 1.6
diff -u -r1.6 system_module.module
--- system_module.module	30 May 2008 15:26:00 -0000	1.6
+++ system_module.module	30 May 2008 17:24:34 -0000
@@ -1,6 +1,13 @@
 <?php
 // $Id: system_module.module,v 1.6 2008/05/30 15:26:00 litwol Exp $
 
+/**
+ * @file
+ */
+
+/**
+ * Implementation of hook_menu().
+ */
 function system_module_menu() {
   $menu['admin/settings/util/sysmods'] = array(
     'title'          => 'System Modules Settings',
@@ -8,10 +15,16 @@
     'page callback'  => 'drupal_get_form',
     'page arguments' => array('system_module_settings'),
     'access arguments' => array('administer site configuration'),
+    'type' => MENU_LOCAL_TASK,
   );
   return $menu;
 }
 
+/**
+ * Form builder; generate settings form.
+ *
+ * @ingroup forms
+ */
 function system_module_settings() {
   global $user;
   //get all available packages
@@ -25,9 +38,8 @@
   ksort($packages);
   //build settings form
 
- $result = db_fetch_array(db_query("SELECT data FROM {system_module_users} WHERE uid = %d}", $user->uid));
- $result = unserialize($result['data']);
-
+  $result = db_fetch_array(db_query("SELECT data FROM {system_module_users} WHERE uid = %d}", $user->uid));
+  $result = unserialize($result['data']);
 
   $form['system_module_cfg'] = array(
     '#type' => 'checkboxes',
@@ -43,6 +55,9 @@
   return $form;
 }
 
+/**
+ * Process system_module_settings form submissions.
+ */
 function system_module_settings_submit($form, &$form_state) {
   global $user;
 
@@ -65,7 +80,9 @@
   user_save($user, array('system_module_cfg' => $values['system_module_cfg']));
 }
 
-// the theme registry
+/**
+ * Implementation of hook_theme().
+ */
 function system_module_theme() {
   return array(
     'system_modules_theme' => array(
@@ -74,6 +91,9 @@
   );
 }
 
+/**
+ * Implementation of hook_form_alter().
+ */
 function system_module_form_alter(&$form, $form_state, $form_id) {
   switch ($form_id) {
     case 'system_modules':
@@ -84,13 +104,12 @@
   }
 }
 
-function system_module_disable() {
-  drupal_rebuild_theme_registry();
-}
-
-//most of this function was copied from system.module
+/**
+ * Most of this function was copied from system.module
+ */
 function theme_system_modules_theme($form) {
-  global $user;   //needed to enable
+  global $user; // Needed to enable.
+
   if (isset($form['confirm'])) {
     return drupal_render($form);
   }
Index: system_module.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/system_module.install,v
retrieving revision 1.2
diff -u -r1.2 system_module.install
--- system_module.install	30 May 2008 15:26:00 -0000	1.2
+++ system_module.install	30 May 2008 17:24:34 -0000
@@ -1,15 +1,28 @@
 <?php
 // $Id: system_module.install,v 1.2 2008/05/30 15:26:00 litwol Exp $
 
+/**
+ * @file
+ */
+
+/**
+ * Implementation of hook_install().
+ */
 function system_module_install() {
-  drupal_install_schema('system_module_users');
+  drupal_install_schema('system_module');
 }
 
+/**
+ * Implementation of hook_uninstall().
+ */
 function system_module_uninstall() {
-  drupal_uninstall_schema('system_module_users');
+  drupal_uninstall_schema('system_module');
 }
 
-function system_module_users_schema() {
+/**
+ * Implementation of hook_schema().
+ */
+function system_module_schema() {
   //this is not used very much yet.
   //settings are still saved in user.data field.
   //in next update this module will move away from using user.data and instead use
@@ -35,3 +48,10 @@
   );
   return $schema;
 }
+
+/**
+ * Implementation of hook_disable().
+ */
+function system_module_disable() {
+  drupal_rebuild_theme_registry();
+}
Index: module_weights.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/util/module_weights.module,v
retrieving revision 1.3
diff -u -r1.3 module_weights.module
--- module_weights.module	30 May 2008 15:26:00 -0000	1.3
+++ module_weights.module	30 May 2008 17:24:34 -0000
@@ -2,6 +2,10 @@
 // $Id: module_weights.module,v 1.3 2008/05/30 15:26:00 litwol Exp $
 
 /**
+ * @file
+ */
+
+/**
  * Implementation of hook_help().
  */
 function module_weights_help($path, $arg) {
@@ -21,7 +25,7 @@
 }
 
 function module_weights_system_module_weights_alter(&$row, $module, &$form) {
-  array_unshift($row, drupal_render($form['weights'][$module]));  
+  array_unshift($row, drupal_render($form['weights'][$module]));
   //CLEANUP what we added in hook_form_alter()
   unset($form['weights'][$module]);
 }
@@ -34,11 +38,11 @@
   if (empty($module_weights)) {
     $query = "SELECT filename, name, type, owner, status, throttle, bootstrap, schema_version, weight FROM {system} WHERE type = 'module' AND status = 1 ORDER BY name";
     $result = db_query($query);
-    while( $row = db_fetch_object($result)) {
+    while ($row = db_fetch_object($result)) {
       $module_weights[$row->name] = $row->weight;
     }
   }
-  
+
   if ($name === NULL) {
     return $module_weights;
   }
@@ -50,6 +54,9 @@
   }
 }
 
+/**
+ * Implementation of hook_form_alter().
+ */
 function module_weights_form_alter(&$form, $form_state, $form_id) {
   switch ($form_id) {
     case 'system_modules':
@@ -66,12 +73,15 @@
       }
       // Do my #submit before system.module's so all the rebuilding
       // operations in system_module_submit use the new weights.
-      array_unshift($form['#submit'],'module_weights_system_module_submit');
-      $form['#validate'][]  = 'module_weights_system_module_validate';
+      array_unshift($form['#submit'], 'module_weights_system_module_submit');
+      $form['#validate'][] = 'module_weights_system_module_validate';
       break;
   }
 }
 
+/**
+ * Validate system_modules form submissions.
+ */
 function module_weights_system_module_validate($form, &$form_state) {
   $weights = fetch_module_weights();
   foreach ($weights as $name => $weight) {
@@ -85,6 +95,9 @@
   }
 }
 
+/**
+ * Process system_modules form submissions.
+ */
 function module_weights_system_module_submit($form, &$form_state) {
   foreach ($form_state['values']['weights'] as $name => $weight) {
     //extra step of optimization, update only weights that changed
