function profile_block_configure

7.x profile.module profile_block_configure($delta = '')

Implements hook_block_configure().

File

drupal-7.x/modules/profile/profile.module, line 148
Support for configurable user profiles.

Code

function profile_block_configure($delta = '') {
  // Compile a list of fields to show
  $fields = array();
  $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
  foreach ($result as $record) {
    $fields[$record->name] = check_plain($record->title);
  }
  $fields['user_profile'] = t('Link to full user profile');
  $form['profile_block_author_fields'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Profile fields to display'),
    '#default_value' => variable_get('profile_block_author_fields', array()),
    '#options' => $fields,
    '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/config/people/profile'))),
  );
  return $form;
}