You are here

public function ds_emptyregionrender::execute in Display Suite 6

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

execute().

File

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

Class

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

Code

public function execute(&$vars, &$display, $display_settings, $object_type, $module) {
  $themed_regions = array();
  foreach ($display->all_regions as $region_name => $region_title) {
    $render = ds_default_value($display_settings, $display->build_mode, 'emptyregionrender', 'render', $region_name, FALSE);
    if ($render == TRUE && !isset($display->themed_regions[$region_name])) {

      // Add content for this region, simply a whitespace.
      $themed_regions[$region_name] = array(
        'content' => ' ',
        'count' => 1,
      );
      if ($region_name == 'left' || $region_name == 'right') {
        $display->region_classes[$region_name] = $region_name;
      }
    }
    elseif (isset($display->themed_regions[$region_name])) {
      $themed_regions[$region_name] = $display->themed_regions[$region_name];
    }
  }
  $display->themed_regions = $themed_regions;
}