You are here

function views_handler_area_block::options_form in Views block area 7

Default options form that provides the label widget that all fields should have.

Overrides views_handler_area::options_form

File

views/handlers/views_handler_area_block.inc, line 23
Block area handlers. Insert a block inside of an area.

Class

views_handler_area_block
@file Block area handlers. Insert a block inside of an area.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  // Get a full list of blocks
  module_load_include('inc', 'block', 'block.admin');
  global $theme_key;
  $block_info = block_admin_display_prepare_blocks($theme_key);

  // Convert the list into a dropdown box, keyed by module & delta.
  $options = array();
  foreach ($block_info as $block) {
    $options[$block['module'] . ':' . $block['delta']] = $block['info'];
  }
  $form['block_to_insert'] = array(
    '#type' => 'select',
    '#title' => t('Block to insert'),
    '#default_value' => $this->options['block_to_insert'],
    '#description' => t('The block to insert into this area.'),
    '#options' => $options,
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Block title'),
    '#default_value' => $this->options['title'],
    '#description' => t('Override the title for the block. Use <none> to display no title, or leave blank to use the block title from block settings.'),
  );
}