Index: privacy.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privacy/privacy.admin.inc,v
retrieving revision 1.1
diff -u -p -r1.1 privacy.admin.inc
--- privacy.admin.inc	28 Jan 2009 23:38:34 -0000	1.1
+++ privacy.admin.inc	18 Aug 2010 21:50:12 -0000
@@ -6,20 +6,20 @@
  * Administration callbacks for the privacy module.
  */
 
-/*
- * Menu callback for building the admin page
+/**
+ * Menu callback for building the admin page.
  */
 function privacy_adminpage() {
-  $output = t('Select which fields should be able to keep private.  Only content types with extra cck fields are displayed .');
+  $output = t('Select which fields should be able to keep private.  Only content types with extra cck fields are displayed.');
 
-  //return the html of the admin form
+  // Return the html of the admin form.
   $output .= drupal_get_form('privacy_settings');
 
   return $output;
 }
 
-/*
- * Build form with content types and fields
+/**
+ * Build form with content types and fields.
  */
 function privacy_settings() {
   $types = content_types();
@@ -27,12 +27,12 @@ function privacy_settings() {
   foreach ( $types as $type ) {
     $fields = array();
     if (isset($type['fields'])) {
-      foreach ( $type['fields'] as $field_name => $field_properties ) {
+      foreach ($type['fields'] as $field_name => $field_properties) {
         $fields[$field_name] = check_plain($field_properties['widget']['label'] .' ('. $field_properties['field_name'] .')');
       }
     }
 
-    if ( count($fields) ) {
+    if (count($fields)) {
       $fieldset = 'privacy_'. $type['type'];
       $form[$fieldset] = array(
         '#title' => $type['name'],
Index: privacy.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privacy/privacy.install,v
retrieving revision 1.1
diff -u -p -r1.1 privacy.install
--- privacy.install	28 Jan 2009 23:38:34 -0000	1.1
+++ privacy.install	18 Aug 2010 21:50:12 -0000
@@ -18,11 +18,11 @@ function privacy_install() {
  * Implementation of hook_uninstall().
  */
 function privacy_uninstall() {
-  //remove database
+  // Remove database table.
   drupal_uninstall_schema('privacy');
-  //remove variables
+  // Remove variables.
   $types = content_types();
-  foreach ( $types as $type ) {
+  foreach ($types as $type) {
     variable_del('privacy_'. $type['type']);
   }
 }
Index: privacy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privacy/privacy.module,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 privacy.module
--- privacy.module	31 Jan 2009 12:35:49 -0000	1.1.2.1
+++ privacy.module	18 Aug 2010 21:50:13 -0000
@@ -37,34 +37,34 @@ function privacy_menu() {
  * Implementation of hook_form_alter().
  */
 function privacy_form_alter(&$form, &$form_state, $form_id) {
-  //only node forms
-  if ( $form['#id'] == 'node-form') {
+  // Only node forms.
+  if ($form['#id'] == 'node-form') {
     $type = $form['type']['#value'];
     $active_privacy_fields = privacy_get_active_fields($type);
-    //when active privacy fields => form alter
+    // When active privacy fields => form alter.
     foreach ($active_privacy_fields as $field) {
       privacy_form_alter_field($form, $field);
     }
   }
 }
 
-/*
- * Form alter a specific field
+/**
+ * Form alter a specific field.
  */
 function privacy_form_alter_field(&$form, $field) {
-  //get fieldset info
+  // Get fieldset info.
   $fieldset = $form['#field_info'][$field]['display_settings']['parent'];
 
-  //get weight info
+  // Get weight info.
   $weight = $form['#field_info'][$field]['display_settings']['weight'];
 
-  //get nid
+  // Get nid.
   $nid = ($form['nid']['#value'] != '') ? $form['nid']['#value'] : 0;
 
-  //get label
+  // Get label.
   $label = $form['#field_info'][$field]['widget']['label'];
 
-  //create privacy field settings
+  // Create privacy field settings.
   $subform = array(
     '#type'    => 'checkbox',
     '#title'   => t('Don\'t show !label in public', array('!label' => $label)),
@@ -72,7 +72,7 @@ function privacy_form_alter_field(&$form
     '#default_value' => privacy_is_private($field, $nid),
   );
 
-  if ( $fieldset != '' ) {
+  if ($fieldset != '') {
     $form[$fieldset]['privacy_'. $field] = $subform;
   }
   else {
@@ -80,6 +80,9 @@ function privacy_form_alter_field(&$form
   }
 }
 
+/**
+ * Implementation of hook_nodeapi().
+ */
 function privacy_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   global $user;
 
@@ -90,39 +93,40 @@ function privacy_nodeapi(&$node, $op, $a
       foreach ($active_privacy_fields as $field) {
         db_query("DELETE FROM {privacy} WHERE nid = %d AND field_name = '%s'", $node->nid, $field);
         $fieldname = 'privacy_'. $field;
-        if ( $node->$fieldname == 1 ) {
+        if ($node->$fieldname == 1) {
           db_query("INSERT INTO {privacy} (nid, field_name) VALUES (%d, '%s')", $node->nid, $field);
         }
       }
       break;
     case 'load':
       $result = db_query("SELECT field_name FROM {privacy} WHERE nid = %d ", $node->nid);
-      //are there any privacy fields activated ?
+      // Are there any privacy fields activated?
       if ($result) {
         $active_privacy_fields = privacy_get_active_fields($node->type);
-        //if access to privacy fields, add a status to the $node object
+        // If access to privacy fields, add a status to the $node object.
         if ($user->uid == $node->uid || user_access('view all privacy')) {
-          //set all fields visible
+          // Set all fields visible.
           $flip = array_flip($active_privacy_fields);
           foreach ($flip as $field => $value) {
             $flip[$field] = 0;
           }
-          //hide all privacy fields
+          // Hide all privacy fields.
           while ($permissions = db_fetch_object($result)) {
             $flip[$permissions->field_name] = 1;
           }
-          //put all fields in the $node object
+          // Put all fields in the $node object.
           foreach ($flip as $field => $value) {
             $fieldname = 'privacy_'. $field;
             $node->$fieldname = $value;
           }
         }
-        //if no access to privacy fields, remove them
-	//TODO : check if there is another (drupal) way to to this in stead of using unset
+        // If no access to privacy fields, remove them.
+        // TODO: check if there is another (drupal) way to to this in stead of
+        // using unset.
         else {
           while ($permissions = db_fetch_object($result)) {
             $field = $permissions->field_name;
-            //when field is private
+            // When field is private.
             if (in_array($field, $active_privacy_fields)) {
               unset($node->$field);
             }
@@ -134,7 +138,7 @@ function privacy_nodeapi(&$node, $op, $a
 }
 
 /**
- * Return an array with all acitve privacy fields
+ * Return an array with all acitve privacy fields.
  */
 function privacy_get_active_fields($type) {
   static $active_privacy_fields = array();
@@ -143,7 +147,7 @@ function privacy_get_active_fields($type
     $active_privacy_fields[$type] = array();
     $all_privacy_fields = variable_get('privacy_'. $type, array());
 
-    foreach ( $all_privacy_fields as $field ) {
+    foreach ($all_privacy_fields as $field) {
       if ($field !== 0) {
         $active_privacy_fields[$type][] = $field;
       }
@@ -153,13 +157,16 @@ function privacy_get_active_fields($type
   return $active_privacy_fields[$type];
 }
 
+/**
+ * Identify whether a field is private.
+ */
 function privacy_is_private($field, $nid) {
-  if ( $nid == 0 ) {
+  if ($nid == 0) {
     return FALSE;
   }
   else {
     $result = db_result(db_query("SELECT nid FROM {privacy} WHERE nid = %d AND field_name = '%s' ", $nid, $field));
-    if ( $result ) {
+    if ($result) {
       return TRUE;
     }
     else {
