You are here

public function ds_cssoverrider::plugin_form in Display Suite 6

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

plugin_form().

File

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

Class

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

Code

public function plugin_form(&$form, $display_settings) {
  $form['cssoverrider'] = array(
    '#type' => 'fieldset',
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
    '#description' => t('Either add extra classes or override CSS inline per region.'),
  );
  $build_mode = $form['#build_mode'];
  $regions = ds_regions();
  foreach ($regions as $region => $title) {
    if ($region != 'disabled') {
      $form['cssoverrider']['region-class-' . $region] = array(
        '#title' => $title . ' class',
        '#type' => 'textfield',
        '#description' => t('Enter extra classes, seperated by comma.'),
        '#default_value' => ds_default_value($display_settings, $build_mode, 'cssoverrider', 'class', $region, ''),
      );
      $form['cssoverrider']['region-inline-' . $region] = array(
        '#title' => $title . ' inline css',
        '#type' => 'textfield',
        '#description' => t('Enter inline css. Note, you only need to enter the css rules, the plugin will add style="" for you.'),
        '#default_value' => ds_default_value($display_settings, $build_mode, 'cssoverrider', 'inline', $region, ''),
      );
    }
  }
}