diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 6514db8..85dc45c 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -9,7 +9,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 2813583..2f98018 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1640,53 +1640,14 @@ function theme_datetime($variables) { } /** - * Returns HTML for status and/or error messages, grouped by type. + * Prepares variables for status message templates. * - * An invisible heading identifies the messages for assistive technology. - * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html - * for info. - * - * @param $variables - * An associative array containing: - * - display: (optional) Set to 'status' or 'error' to display only messages - * of that type. - */ -function theme_status_messages($variables) { - $display = $variables['display']; - $output = ''; - - $status_heading = array( - 'status' => t('Status message'), - 'error' => t('Error message'), - 'warning' => t('Warning message'), - ); - foreach (drupal_get_messages($display) as $type => $messages) { - $output .= "
\n"; - if (!empty($status_heading[$type])) { - $output .= '

' . $status_heading[$type] . "

\n"; - } - if (count($messages) > 1) { - $output .= " \n"; - } - else { - $output .= $messages[0]; - } - $output .= "
\n"; - } - return $output; -} - -/** - * Prepares variables for theme_status_messages(). + * Default template: status-messages.html.twig. * * @param array $variables * An associative array containing: - * - display: (optional) Set to 'status' or 'error' to display only messages - * of that type. + * - display: (optional) Set to e.g. 'status' or 'error' to display only + * messages of that type. */ function template_preprocess_status_messages(&$variables) { $variables['messages_display'] = drupal_get_messages($variables['display']); diff --git a/core/modules/system/templates/status-messages.html.twig b/core/modules/system/templates/status-messages.html.twig index dbcf5fb..347b895 100644 --- a/core/modules/system/templates/status-messages.html.twig +++ b/core/modules/system/templates/status-messages.html.twig @@ -8,9 +8,8 @@ * for info. * * Available variables: - * - messages_display: List of messages of all statuses which attempts to be - * displayed. - * - status_heading: List of all status types. + * - messages_display: List of messages to be displayed, grouped by type. + * - status_headings: List of all status types. * * @see template_preprocess() * @see template_preprocess_status_messages() @@ -18,11 +17,10 @@ * @ingroup themeable */ #} - {% for type, messages in messages_display %}
- {% if type in status_heading %} -

{{ status_heading[type] }}

+ {% if type in status_headings %} +

{{ status_headings[type] }}

{% endif %} {% if messages|length > 1 %} {% else %} - {{ messages[0] }} + {{ messages.0 }} {% endif %}
{% endfor %}