You are here

function webform_block_configure in Webform 6.3

Same name and namespace in other branches
  1. 7.4 webform.module \webform_block_configure()
  2. 7.3 webform.module \webform_block_configure()

Implements hook_block_configure().

1 call to webform_block_configure()
webform_block in ./webform.module
Implements hook_block().

File

./webform.module, line 1669

Code

function webform_block_configure($delta = '') {

  // Load the block-specific configuration settings.
  $webform_blocks = variable_get('webform_blocks', array());
  $settings = isset($webform_blocks[$delta]) ? $webform_blocks[$delta] : array();
  $settings += array(
    'display' => 'form',
    'pages_block' => 0,
  );
  $form = array();
  $form['display'] = array(
    '#type' => 'radios',
    '#title' => t('Display mode'),
    '#default_value' => $settings['display'],
    '#options' => array(
      'form' => t('Form only'),
      'full' => t('Full node'),
      'teaser' => t('Teaser'),
    ),
    '#description' => t('The display mode determines how much of the webform to show within the block.'),
  );
  $form['pages_block'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show all webform pages in block'),
    '#default_value' => $settings['pages_block'],
    '#description' => t('By default multi-page webforms redirect to the node page for all pages after the first one. If checked, all pages will be shown in the block instead.'),
  );
  return $form;
}