You are here

function workspace_user_view in Workspace 7

Implements hook_user_view().

Place link to user's workspace on user's profile page.

File

./workspace.module, line 796
Presents a user-centric view of content.

Code

function workspace_user_view($account) {
  if (workspace_access($account)) {
    $variables['%username'] = $account->name;
    $link_title = variable_get('workspace_user_profile_link', t('View recent content'));
    $link = l(strtr($link_title, $variables), 'workspace/' . $account->uid);
    if (!isset($account->content['workspace'])) {
      $account->content['workspace'] = array();
    }
    $account->content['workspace'] += array(
      '#type' => 'user_profile_category',
      '#title' => variable_get('workspace_user_profile_title', t('Content')),
    );
    if (!isset($account->content['workspace']['link'])) {
      $account->content['workspace']['link'] = array();
    }
    $account->content['workspace']['link'] += array(
      '#type' => 'user_profile_item',
      '#title' => '',
      '#markup' => $link,
    );
  }
}