Index: account_profile.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/account_profile/account_profile.module,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 account_profile.module
--- account_profile.module	21 Jul 2010 11:29:32 -0000	1.1.2.6
+++ account_profile.module	2 Oct 2010 09:40:03 -0000
@@ -38,8 +38,13 @@
         }
     break;
     case $profile . '_node_form':
+      /* check, if module 'me' exist. */
+      if (module_exists('me')) {
+        global $user;
+        $me_exist = TRUE; 
+      }      
       /* integration with account form */
-      if (is_numeric(arg(1)) && $user = user_load(arg(1))) { // activate only on edit page (not on registration page)
+      if ((is_numeric(arg(1)) && $user = user_load(arg(1))) || $me_exist) { // activate only on edit page (not on registration page)
           module_load_include('pages.inc', 'user');
           $account_form = user_profile_form(array(), $user);
           unset($account_form['submit'], $account_form['delete']); // remove duplicated Save button and Delete
@@ -63,8 +68,15 @@
  * @return null
  */
 function account_profile_menu_alter(&$items) {
-    $profile = variable_get('account_profile_main_profile', key(content_profile_get_types('names'))); // get main profile name
-    $items['user/%user_category/edit/' . $profile]['type'] = MENU_CALLBACK; // remove content profile tab
+  $profile = variable_get('account_profile_main_profile', key(content_profile_get_types('names'))); // get main profile name
+  $items['user/%user_category/edit/' . $profile]['type'] = MENU_CALLBACK; // remove content profile tab
+  if (variable_get('account_profile_edit_tab', TRUE)) {
+    $items['user/%user_category/edit']['type'] = MENU_CALLBACK;
+    if (module_exists('me')) {    
+      $items['user/%me_category/edit']['type'] = MENU_CALLBACK;
+      $items['user/%me_category/edit/account']['type'] = MENU_CALLBACK;
+    }
+  }
 }
 
 /**
@@ -93,7 +105,7 @@
 function account_profile_form_submit($form, &$form_state) {
 
   $account = $form_state['values']['_account'];
-	// add username
+  // add username
   $username = $form_state['clicked_button']['#post']['name'];
   $form_state['values']['name'] = $username;
 
@@ -108,4 +120,3 @@
   drupal_set_message(t('The changes have been saved.'));
   return;
 }
-
