You are here

function views_plugin_display_block::options_form in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_display_block.inc \views_plugin_display_block::options_form()
  2. 7.3 plugins/views_plugin_display_block.inc \views_plugin_display_block::options_form()

Provide the default form for setting options.

Overrides views_plugin_display::options_form

File

plugins/views_plugin_display_block.inc, line 128
Contains the block display plugin.

Class

views_plugin_display_block
The plugin that handles a block.

Code

function options_form(&$form, &$form_state) {

  // It is very important to call the parent function here:
  parent::options_form($form, $form_state);
  switch ($form_state['section']) {
    case 'block_description':
      $form['#title'] .= t('Block admin description');
      $form['block_description'] = array(
        '#type' => 'textfield',
        '#description' => t('This will appear as the name of this block in administer >> site building >> blocks.'),
        '#default_value' => $this
          ->get_option('block_description'),
      );
      break;
    case 'block_caching':
      $form['#title'] .= t('Block caching type');
      $form['block_caching'] = array(
        '#type' => 'radios',
        '#description' => t("This sets the default status for Drupal's built-in block caching method; this requires that caching be turned on in block administration, and be careful because you have little control over when this cache is flushed."),
        '#options' => $this
          ->block_caching_modes(),
        '#default_value' => $this
          ->get_cache_type(),
      );
      break;
  }
}