You are here

function template_preprocess_scheduled_transitions_form_add in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x scheduled_transitions.module \template_preprocess_scheduled_transitions_form_add()

Implements hook_preprocess_HOOK().

HOOK: scheduled_transitions_form_add.

File

./scheduled_transitions.module, line 116

Code

function template_preprocess_scheduled_transitions_form_add(array &$variables) : void {
  $variables['#attached']['library'][] = 'scheduled_transitions/form_add';

  // Add classes to table cells so they can be styled.
  foreach ($variables['form']['revision']['#options'] as $key => &$row) {
    if (isset($row['state'])) {
      $row['state']['class'][] = 'state';
    }
    if (isset($row['revision_time'])) {
      $row['revision_time']['class'][] = 'revision-time';
    }
    if (isset($row['revision_author'])) {
      $row['revision_author']['class'][] = 'revision-author';
    }
  }
}