Index: myaccount_alter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/myaccount_alter/myaccount_alter.module,v
retrieving revision 1.1.2.3.2.2
diff -u -p -r1.1.2.3.2.2 myaccount_alter.module
--- myaccount_alter.module	12 Nov 2008 15:00:20 -0000	1.1.2.3.2.2
+++ myaccount_alter.module	30 Dec 2008 23:05:22 -0000
@@ -20,44 +20,44 @@ function myaccount_alter_perm() {
  */
 function myaccount_alter_menu() {
   $items = array();
-    //settings page
-    $items['admin/user/myaccount-alter'] = array(
-      'title' => t('My Account Alter'),
-      'description' => t('Disable or re-order any of the fields on the my account page.'),
-      'page callback' => 'drupal_get_form',
-      'page arguments' => array('myaccount_alter_settings'),
-      'access arguments' => array('administer myaccount_alter'),
-      );
+  //settings page
+  $items['admin/user/myaccount-alter'] = array(
+    'title' => 'My account alter',
+    'description' => 'Disable or re-order any of the fields on the my account page.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('myaccount_alter_settings'),
+    'access arguments' => array('administer myaccount_alter'),
+  );
   return $items;
 }
 
 
 /**
- * Menu callback.  Settings page.
+ * Menu callback. Settings page.
  */
 function myaccount_alter_settings() {
   if (module_exists('i18n')) {
-    drupal_set_message(t('You are using i18n module.  If you are using multiple languages you need to set these settings separately while in each language mode.'));
+    drupal_set_message(t('You are using i18n module. If you are using multiple languages you need to set these settings separately while in each language mode.'));
   }
   $form = array();
   $form['help'] = array(
-    '#value' => 'Uncheck any field which you would like to hide from the my account page.',
-    ); 
+    '#value' => t('Uncheck any field which you would like to hide from the my account page.'),
+  );
   global $user;
-  // We fetch the applicable fields shown to the user who is doing this administration 
+  // We fetch the applicable fields shown to the user who is doing this administration.
   foreach (module_list() as $module) {
     module_invoke($module, 'user', 'view', array(), $user);
   }
- if ($user->content) {
-   foreach ($user->content as $category => $items) {
-      if ($items['#type'] == 'user_profile_category') {
+  if ($user->content) {
+    foreach ($user->content as $category => $items) {
+      if (isset($items['#type']) and $items['#type'] == 'user_profile_category') {
         $cat_class = 'myaccount_alter_'. str_replace(" ", "", $category);
         $form[$cat_class] = array(
           '#type' => 'fieldset',
-          '#collapsible' => true,
-          '#collapsed' => false,
+          '#collapsible' => TRUE,
+          '#collapsed' => FALSE,
           '#title' => $items['#title'],
-          );
+        );
         foreach ($items as $key => $item) {
           if (!element_property($key)) {
             $class = $cat_class .'_'. str_replace(" ", "", $key);
@@ -66,31 +66,30 @@ function myaccount_alter_settings() {
               '#title' => $item['#title'],
               '#return_value' => 1,
               '#default_value' => variable_get($class, 1),
-              );
+            );
 
-             $form[$cat_class][$class .'_example'] = array(
+            $form[$cat_class][$class .'_example'] = array(
               '#type' => 'fieldset',
-              '#collapsible' => true,
-              '#collapsed' => true,
+              '#collapsible' => TRUE,
+              '#collapsed' => TRUE,
               '#title' => 'example',
             );
             $form[$cat_class][$class .'_example']['content'] = array(
               '#value' => '<h3>'. $item['#title'] .'</h3><p>'. $item['#value'] .'</p>',
-              );
+            );
           }
-        } 
+        }
         $form[$cat_class][$cat_class .'_order'] = array(
-           '#type' => 'weight',
-           '#title' => t('!category weight', array('!category' => $items['#title'])),
-           '#default_value' => variable_get($cat_class .'_order', 0),
-           );
+          '#type' => 'weight',
+          '#title' => t('!category weight', array('!category' => $items['#title'])),
+          '#default_value' => variable_get($cat_class .'_order', 0),
+        );
       }
-    }  
-  } 
+    }
+  }
   return system_settings_form($form);
 }
 
-
 /**
  * Implementation of hook_profile_alter().
  */
@@ -100,7 +99,7 @@ function myaccount_alter_profile_alter(&
     foreach ($account->content AS $category => $items) {
       $cat_class = 'myaccount_alter_'. str_replace(" ", "", $category);
       foreach ($items as $key => $item) {
-        if(variable_get($cat_class .'_'. str_replace(" ", "", $key), 1) == 0) {
+        if (variable_get($cat_class .'_'. str_replace(" ", "", $key), 1) == 0) {
           //unset disabled fields
           unset($account->content[$category][$key]);
           //reorder sections
