You are here

public function ds_emptyregionrender::plugin_form in Display Suite 6.2

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

plugin_form().

File

plugins/ds_emptyregionrender.inc, line 20
DS_EmptyRegionRender: Plugin to render an empty region.

Class

ds_emptyregionrender
@file DS_EmptyRegionRender: Plugin to render an empty region.

Code

public function plugin_form(&$form, $display_settings) {
  $form['emptyregionrender'] = array(
    '#type' => 'fieldset',
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#description' => t('Toggle regions you want to render when there are no fields in it or when field values are empty.'),
  );
  $build_mode = $form['#build_mode'];
  $regions = ds_regions();
  foreach ($regions as $region => $title) {
    if ($region != 'disabled') {
      $form['emptyregionrender']['region-render-' . $region] = array(
        '#title' => $title,
        '#type' => 'checkbox',
        '#default_value' => ds_default_value($display_settings, 'emptyregionrender', 'render', $region, ''),
      );
    }
  }
}