You are here

function _biblio_get_user_profile_form in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 includes/biblio.admin.inc \_biblio_get_user_profile_form()
  2. 6 biblio.admin.inc \_biblio_get_user_profile_form()
  3. 7 includes/biblio.admin.inc \_biblio_get_user_profile_form()
  4. 7.2 includes/biblio.admin.inc \_biblio_get_user_profile_form()
2 calls to _biblio_get_user_profile_form()
biblio_settings in ./biblio.module
Implementation of hook_settings().
biblio_user in ./biblio.module
Implementation of hook_user().

File

./biblio.module, line 214

Code

function _biblio_get_user_profile_form(&$form, $user = false) {
  $form['profile'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => $user ? FALSE : TRUE,
    '#title' => $user ? t('My publications') : t('Profile pages'),
  );
  $form['profile']['biblio_show_profile'] = array(
    '#type' => 'checkbox',
    '#title' => $user ? t('Show my publications on my profile page') : t('Show publications on users profile pages'),
    '#return_value' => 1,
    $profile_value,
    '#description' => $user ? t('Selecting this will create a listing of your publications on your profile page') : t('This sets the site wide default, users may change this in their profile'),
  );
  if ($user) {
    $form['profile']['biblio_show_profile']['#default_value'] = isset($user->biblio_show_profile) ? $user->biblio_show_profile : variable_get('biblio_show_profile', '0');
  }
  else {
    $form['profile']['biblio_show_profile']['#default_value'] = variable_get('biblio_show_profile', '0');
  }
  $form['profile']['biblio_show_profile_tab'] = array(
    '#type' => 'checkbox',
    '#title' => $user ? t('List my publications on a separate tab') : t('Show publications on a separate tab on users profile pages'),
    '#return_value' => 1,
    $profile_value,
    '#description' => $user ? t('Selecting this will create a listing of your publications on a separate tab on your profile page') : t('This sets the site wide default, users may change this in their profile'),
  );
  if ($user) {
    $form['profile']['biblio_show_profile_tab']['#default_value'] = isset($user->biblio_show_profile_tab) ? $user->biblio_show_profile_tab : variable_get('biblio_show_profile_tab', '0');
  }
  else {
    $form['profile']['biblio_show_profile_tab']['#default_value'] = variable_get('biblio_show_profile_tab', '0');
  }
  $form['profile']['biblio_my_pubs_menu'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show "My publications" item in the navigation menu'),
    '#return_value' => 1,
    '#description' => '',
  );
  if ($user) {
    $form['profile']['biblio_my_pubs_menu']['#default_value'] = isset($user->biblio_my_pubs_menu) ? $user->biblio_my_pubs_menu : 0;
  }
  else {
    $form['profile']['biblio_my_pubs_menu']['#default_value'] = variable_get('biblio_my_pubs_menu', '0');
  }
  if ($user) {
    $form['profile']['biblio_lastname'] = array(
      '#type' => 'textfield',
      '#title' => t('My last name'),
      '#default_value' => $user->biblio_lastname,
      '#description' => t('This may be ueed to determine which publications are mine'),
    );
  }
  $form['profile']['biblio_profile_uid'] = array(
    '#type' => 'radios',
    '#title' => t('Select publications by'),
    '#default_value' => isset($user->biblio_profile_uid) ? $user->biblio_profile_uid : variable_get('biblio_profile_uid', 'uid'),
    '#options' => array(
      'uid' => t('User ID'),
      'lastname' => $user ? t('My last name') : t('Last name'),
      'uid_lastname' => t('Both (Last name & User ID)'),
    ),
    '#description' => t('This defines the criteria used to select which publications will be listed on the users profile page'),
  );
}