function workspace_user in Workspace 6
Implementation of hook_user().
Place link to user's workspace on user's profile page.
File
- ./
workspace.module, line 562 - Presents a user-centric view of content.
Code
function workspace_user($op, &$edit, &$account) {
global $user;
if ($op == 'view') {
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);
$account->content['workspace'] = array(
'#type' => 'user_profile_category',
'#title' => variable_get('workspace_user_profile_title', t('Content')),
'link' => array(
'#value' => $link,
'#type' => 'user_profile_item',
),
'#weight' => -10,
);
}
}
}