You are here

function party_user_user_view in Party 7

Same name and namespace in other branches
  1. 8.2 modules/party_user/party_user.module \party_user_user_view()

Implements hook_user_view().

Add party action links to the user.

File

modules/party_user/party_user.module, line 181
Support for linking users to parties

Code

function party_user_user_view($account, $view_mode, $langcode) {
  if ($view_mode == 'party') {
    $party = party_user_get_party($account);
    $data_set_controller = $party
      ->getDataSetController('user');
    $account->content['party_actions'] = array(
      '#theme' => 'links',
      '#links' => $data_set_controller
        ->getActions($party->pid, $account->uid),
      '#attributes' => array(
        'class' => array(
          'links inline crm-set-action-links',
        ),
      ),
      '#weight' => 100,
    );
  }
}