On this page
function 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;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!theme.maintenance.inc/function/template_preprocess_authorize_report/8.1.x