You are here

function block_example_block_configure in Examples for Developers 7

Implements hook_block_configure().

This hook declares configuration options for blocks provided by this module.

Related topics

File

block_example/block_example.module, line 91
Module file for block_example.

Code

function block_example_block_configure($delta = '') {
  $form = array();

  // The $delta parameter tells us which block is being configured.
  // In this example, we'll allow the administrator to customize
  // the text of the 'configurable text string' block defined in this module.
  if ($delta == 'example_configurable_text') {

    // All we need to provide is the specific configuration options for our
    // block. Drupal will take care of the standard block configuration options
    // (block title, page visibility, etc.) and the save button.
    $form['block_example_string'] = array(
      '#type' => 'textfield',
      '#title' => t('Block contents'),
      '#size' => 60,
      '#description' => t('This text will appear in the example block.'),
      '#default_value' => variable_get('block_example_string', t('Some example content.')),
    );
  }
  return $form;
}