? terms_of_use-code-style-263781-1.patch
Index: terms_of_use.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/terms_of_use/terms_of_use.module,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 terms_of_use.module
--- terms_of_use.module	25 May 2008 18:31:51 -0000	1.1.2.1
+++ terms_of_use.module	28 May 2008 16:50:45 -0000
@@ -1,16 +1,19 @@
 <?php
 // $Id: terms_of_use.module,v 1.1.2.1 2008/05/25 18:31:51 chill35 Exp $
+
 /**
  * @file
- * Adds Terms of Use to the 'user_register' form
+ * Adds Terms of Use to the 'user_register' form.
  *
  * This module adds Terms of Use to the registration page.
  */
+
 /**
- * Implementation of hook_menu()
+ * Implementation of hook_menu().
  */
 function terms_of_use_menu() {
   $items = array();
+
   $items['admin/settings/terms_of_use'] = array(
     'description' => 'Add Terms of Use to the registration page.',
     'title' => 'Terms of Use',
@@ -18,8 +21,13 @@ function terms_of_use_menu() {
     'page arguments' => array('terms_of_use_admin_settings'),
     'access arguments' => array('administer site configuration'),
   );
+
   return $items;
 }
+
+/**
+ * Menu callback; show settings form.
+ */
 function terms_of_use_admin_settings() {
   $form['terms_of_use_node'] = array(
     '#type' => 'textfield',
@@ -39,20 +47,23 @@ function terms_of_use_admin_settings() {
     '#default_value' => variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')),
     '#description' => t('Type here something like "I agree with these terms." or "I CERTIFY THAT I AM OVER THE AGE OF 18 YEARS OLD.", without quotes.'),
   );
+
   return system_settings_form($form);
 }
-/*
- * Implementation of hook_form_alter
+
+/**
+ * Implementation of hook_form_alter().
  */
 function terms_of_use_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'user_register') {
-    // Adding the fieldset
+    // Adding the fieldset.
     $form['terms_of_use'] = array(
       '#type' => 'fieldset',
       '#title' => variable_get('terms_of_use_fieldset_name', t('Terms of Use')),
       '#weight' => 10,
     );
-    // Getting the node that contains the Terms of Use
+
+    // Getting the node that contains the Terms of Use.
     $node = node_load(variable_get('terms_of_use_node', ''));
     if (isset($node)) {
       // Adding the Terms of Use to the fieldset
@@ -62,19 +73,25 @@ function terms_of_use_form_alter(&$form,
         '#suffix' => '</div>',
       );
     }
-    // Adding the checkbox to the fieldset
+
+    // Adding the checkbox to the fieldset.
     $form['terms_of_use']['I_agree'] = array(
       '#type' => 'checkbox',
       '#title' => variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')) . '&nbsp;<span class="form-required" title="This field is required.">*</span>',
       '#required' => TRUE,
       '#element_validate' => array('_terms_of_use_validate_checkbox'),
-    );  
+    );
   }
+
   return $form;
 }
+
+/**
+ * Validation callback; verify that checkbox is checked.
+ */
 function _terms_of_use_validate_checkbox($form, &$form_state) {
   $value = $form_state['values']['I_agree'];
   if ($value == 0) {
     form_set_error('I_agree', t('You must agree with the !terms to get an account.', array('!terms' => variable_get('terms_of_use_fieldset_name', t('Terms of Use')))));
   }
-}
\ No newline at end of file
+}
