You are here

public function ds_cssoverrider::execute in Display Suite 6.2

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

process().

File

plugins/ds_cssoverrider.inc, line 71
DS_CSSOverrider: plugin to override css per region.

Class

ds_cssoverrider
@file DS_CSSOverrider: plugin to override css per region.

Code

public function execute($vars, &$display, $display_settings, $object_type, $module) {
  foreach ($display->themed_regions as $region_name => $region_data) {
    $classes = ds_default_value($display_settings, 'cssoverrider', 'class', $region_name, '');
    $inline = ds_default_value($display_settings, 'cssoverrider', 'inline', $region_name, '');
    if (!empty($classes)) {
      $display->themed_regions[$region_name]['extra_class'] .= ' ' . $classes;
    }
    if (!empty($inline)) {
      $display->themed_regions[$region_name]['inline_css'] = 'style="' . $inline . '"';
    }
  }
}