You are here

protected function Classes::rowClassesElement in GridStack 8.2

1 call to Classes::rowClassesElement()
Form::wrapperForm in src/Plugin/gridstack/stylizer/Form.php

File

src/Plugin/gridstack/stylizer/Classes.php, line 119

Class

Classes
Provides the classes styles.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

protected function rowClassesElement($optionset, FormStateInterface $form_state, array $settings, array $extras = []) {
  $context = $settings['_scope'];
  $container = !empty($settings['_container']);
  $element = [];

  // Only applicable to one dimensional for now.
  if (!$optionset
    ->isFramework() && !$container) {
    return [];
  }
  $wrapper_classes = [];
  $wrapper_class_value = trim($settings['row_classes']);
  if ($wrapper_class_value) {
    $wrapper_classes = array_filter(array_map('trim', explode(" ", $wrapper_class_value)));
  }
  if ($classes = $this->manager
    ->engineManager()
    ->getClassOptions('row')) {
    foreach ($classes as $key => $options) {
      $refined_options = $this
        ->getPresetRowOptions($options);
      $element[$key] = $this
        ->classElement($key, $options, $refined_options, $context, $wrapper_classes);
    }
  }
  return $element;
}