You are here

function author_pane_block_configure in Author Pane 7.2

Implements hook_block_configure().

File

./author_pane.module, line 57
Gathers information from user related modules into one template.

Code

function author_pane_block_configure($delta) {

  // Get a list of all node types.
  $types = node_type_get_types();
  $options = array();
  foreach ($types as $type) {
    $options[$type->type] = $type->name;
  }

  // Allow user to choose which node types will display the block.
  $form['author_pane_block_display_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Node types to display on'),
    '#options' => $options,
    '#default_value' => variable_get('author_pane_block_display_types', array()),
  );

  // Settings for which date type to use to format the join date.
  $join_date_options = array();
  foreach (system_get_date_types() as $date_type) {
    $join_date_options[$date_type['type']] = $date_type['title'];
  }
  $form['author_pane_block_join_date_type'] = array(
    '#type' => 'select',
    '#title' => t('Join date, date type'),
    '#options' => $join_date_options,
    '#default_value' => variable_get('author_pane_block_join_date_type', 'short'),
    '#description' => t('Select which <a href="@date-type-url">date type</a> to use for displaying the join date.', array(
      '@date-type-url' => url('admin/config/regional/date-time'),
    )),
  );
  if (module_exists('image')) {

    // Get all the imagecache presets on the site.
    $options = array(
      '' => '',
    );
    $styles = image_styles();
    foreach ($styles as $style) {
      $options[$style['name']] = $style['name'];
    }

    // Allow the user to choose a preset to use.
    $form['author_pane_block_user_picture_preset'] = array(
      '#type' => 'select',
      '#title' => t('User picture preset'),
      '#options' => $options,
      '#description' => t('Imagecache preset to use for the user picture on this block. Leave blank to not use this feature.'),
      '#default_value' => variable_get('author_pane_block_user_picture_preset', ''),
    );
  }
  return $form;
}