You are here

public function dsRegionToBlock::execute in Display Suite 6.3

execute().

File

plugins/ds_extension/regiontoblock.inc, line 124

Class

dsRegionToBlock

Code

public function execute($vars, &$display, $display_settings, $object_type, $module) {
  $object = $vars[$object_type];
  foreach ($display->regions as $region_name => $region) {
    if ($display
      ->regionIsActive($region_name)) {
      $region_to_block = ds_default_value($display_settings, 'regiontoblock', 'block', $region_name, FALSE);
      if (isset($region_to_block) && $region_to_block == TRUE) {
        $key = 'ds_regiontoblock_' . $module . '_' . $object_type . '_' . $display->build_mode . '_' . $region_name;
        $data = new stdClass();
        $data->content = $display->regions[$region_name]['#field_content'];
        $data->object = $vars[$object_type];
        ds_static_variables($key, $data);
        $display
          ->regionHide($region_name);
      }
    }
  }
}