template_preprocess_authorize_report

template_preprocess_authorize_report(&$variables)

Prepares variables for authorize.php operation report templates.

This report displays the results of an operation run via authorize.php.

Default template: authorize-report.html.twig.

Parameters

array $variables: An associative array containing:

  • messages: An array of result messages.

File

core/includes/theme.maintenance.inc, line 115
Theming for maintenance pages.

Code

function template_preprocess_authorize_report(&$variables) {
  $messages = [];
  if (!empty($variables['messages'])) {
    foreach ($variables['messages'] as $heading => $logs) {
      $items = [];
      foreach ($logs as $number => $log_message) {
        if ($number === '#abort') {
          continue;
        }
        $class = 'authorize-results__' . ($log_message['success'] ? 'success' : 'failure');
        $items[] = [
          '#wrapper_attributes' => ['class' => [$class]],
          '#markup' => $log_message['message'],
        ];
      }
      $messages[] = [
        '#theme' => 'item_list',
        '#items' => $items,
        '#title' => $heading,
      ];
    }
  }
  $variables['messages'] = $messages;
}
doc_Drupal
2016-10-29 09:46:38
Comments
Leave a Comment

Please login to continue.