Is it possible to change the "Activity privacy settings" tab on User Profile from Primary Tab to Secondary Tab? For example, it would display as secondary tab when user clicks on "edit tab" in their user profile... the "activity privacy settings" tab would display alongside the "account" tab and any other secondary tabs during editing...

Comments

Scott Reynolds’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

artycul’s picture

here's a snippet
this goes into sites/all/modules/yourmodule/yourmodule.module

/**
* Implementation of hook_user().
*/
function yourmodule_user($op, &$edit, &$account, $category = NULL) {
  switch($op) {
    case 'categories':
      $categories = array();
      $categories[] = array(
        'name' => 'privacy',
        'title' => 'Activity Privacy',
        'weight' => 1,);
      return $categories;
      break;
  }
}

/**
* Implementation of hook_menu_alter().
*/
function yourmodule_menu_alter(&$items) {
    $edit_privacy = $items['user/%user/activity/settings'];
    $edit_privacy['title'] = 'Activity Privacy';
    $edit_privacy['load arguments'] = array(0, 1);                    //for user_category_load()
    $items['user/%user/activity/settings']['type'] = MENU_CALLBACK;   //hide original menu entry
    $items['user/%user_category/edit/privacy'] = $edit_privacy;
}

According to #356209: Disappearing MENU_LOCAL_TASK items and different Wildcard Loader Arguments, you have to go through hook_user for user/edit local_tasks in order to prevent the 'edit'-tab from disappearing.