function profile_block_configure

Implements hook_block_configure().

File

modules/profile/profile.module, line 148

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.