You are here

function biblio_user in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 biblio.module \biblio_user()
  2. 6 biblio.module \biblio_user()

Implementation of hook_user().

File

./biblio.module, line 165

Code

function biblio_user($type, &$edit, &$user, $category = NULL) {
  if ($type == 'view' && isset($user->biblio_show_profile) && $user->biblio_show_profile == 1 && isset($user->biblio_show_profile_tab) && $user->biblio_show_profile_tab == 0 && variable_get('biblio_show_profile', '0') == 1 && variable_get('biblio_show_profile_tab', '0') == 0) {
    $items['biblio'] = array(
      'title' => '',
      'value' => _biblio_get_user_pubs($user, 'profile'),
      'class' => 'biblio',
    );
    return array(
      t('My publications') => $items,
    );
  }
  if ($type == 'form' && $category == 'account' && (variable_get('biblio_show_profile', '0') || variable_get('biblio_my_pubs_menu', '0'))) {
    $form = array();
    _biblio_get_user_profile_form($form, $user);
    return $form;
  }
  if ($type == 'validate' && $category == 'account') {
    if (($edit['biblio_profile_uid'] == 'lastname' || $edit['biblio_profile_uid'] == 'uid_lastname') && $edit['biblio_lastname'] == '') {
      $message = t('You did not supply a value in the "My last name" field of the "My publications" section.');
      form_set_error('category', $message);
    }
  }
  if ($type == 'submit' && $category == 'account') {
    return;
  }
  if ($type == 'delete') {
    return;
  }
  return;
}