You are here

public function ds_regiontoblock::plugin_form in Display Suite 6.2

Same name and namespace in other branches
  1. 6 plugins/ds_regiontoblock.inc \ds_regiontoblock::plugin_form()

plugin_form().

File

plugins/ds_regiontoblock.inc, line 20
DS_RegionToBlock: Plugin to make a region available as a block.

Class

ds_regiontoblock
@file DS_RegionToBlock: Plugin to make a region available as a block.

Code

public function plugin_form(&$form, $display_settings) {
  $form['regiontoblock'] = array(
    '#type' => 'fieldset',
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#description' => t('Toggle regions you want to make available as a block.'),
  );
  $build_mode = $form['#build_mode'];
  $regions = ds_regions();
  foreach ($regions as $region => $title) {
    if ($region != 'disabled') {
      $default_value = ds_default_value($display_settings, 'regiontoblock', 'block', $region, '');
      $form['regiontoblock']['region-block-' . $region] = array(
        '#title' => $title,
        '#type' => 'checkbox',
        '#default_value' => $default_value,
      );
      if ($default_value == TRUE) {
        $form['#regions'][$region] .= ' - ' . t('assigned to block');
      }
    }
  }
}