You are here

public function dsEmptyRegionRender::execute in Display Suite 6.3

execute().

File

plugins/ds_extension/emptyregionrender.inc, line 68

Class

dsEmptyRegionRender

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, '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;
}