You are here

public function dsRegionToBlock::plugin_form in Display Suite 6.3

plugin_form().

File

plugins/ds_extension/regiontoblock.inc, line 27

Class

dsRegionToBlock

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_get_regions($display_settings['layout']);
  foreach ($regions as $key => $region) {
    if ($key != DS_DISABLED_REGION) {
      $default_value = ds_default_value($display_settings, 'regiontoblock', 'block', $key, '');
      $form['regiontoblock']['region-block-' . $key] = array(
        '#title' => $region['#name'],
        '#type' => 'checkbox',
        '#default_value' => $default_value,
      );
      if ($default_value == TRUE) {
        $form['#regions'][$key] .= ' - ' . t('assigned to block');
      }
    }
  }
}