You are here

public function Margin::submitStyleFormElements in Bootstrap Styles 1.0.x

Overrides StylePluginBase::submitStyleFormElements

File

src/Plugin/BootstrapStyles/Style/Margin.php, line 182

Class

Margin
Class Margin.

Namespace

Drupal\bootstrap_styles\Plugin\BootstrapStyles\Style

Code

public function submitStyleFormElements(array $group_elements) {
  $directions = [
    'left',
    'top',
    'right',
    'bottom',
  ];
  $schema = [
    'margin' => [
      'class' => $this
        ->getStyleOptionClassByIndex('margin', $group_elements['margin']),
    ],
  ];
  for ($i = 0; $i < 4; $i++) {
    $schema['margin_' . $directions[$i]]['class'] = $this
      ->getStyleOptionClassByIndex('margin_' . $directions[$i], $group_elements['margin_' . $directions[$i]]);
  }
  return $schema;
}