diff --git a/core/modules/update/templates/update-project-status.html.twig b/core/modules/update/templates/update-project-status.html.twig index 78738aa..eebbd08 100644 --- a/core/modules/update/templates/update-project-status.html.twig +++ b/core/modules/update/templates/update-project-status.html.twig @@ -29,9 +29,18 @@ * @ingroup themeable */ #} +{% + set status_classes = [ + project.status == constant('UPDATE_NOT_SECURE') ? 'security-error', + project.status == constant('UPDATE_REVOKED') ? 'revoked', + project.status == constant('UPDATE_NOT_SUPPORTED') ? 'not-supported', + project.status == constant('UPDATE_NOT_CURRENT') ? 'not-current', + project.status == constant('UPDATE_CURRENT') ? 'current', + ] +%}
{%- if status.label -%} - {{ status.label }} + {{ status.label }} {%- else -%} {{ status.reason }} {%- endif %} @@ -58,11 +67,18 @@
{% endif %} +{% + set extra_attributes = [ + project.status == constant('UPDATE_NOT_SECURE') ? 'project-not-secure', + project.status == constant('UPDATE_REVOKED') ? 'project-revoked', + project.status == constant('UPDATE_NOT_SUPPORTED') ? 'project-not-supported', + ] +%}
{% if extras %}
{% for extra in extras %} - + {{ extra.label }}: {{ extra.data }}
{% endfor %} diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc index da6d63b..86f7244 100644 --- a/core/modules/update/update.compare.inc +++ b/core/modules/update/update.compare.inc @@ -238,7 +238,6 @@ function update_calculate_project_update_status(&$project_data, $available) { $project_data['extra'] = array(); } $project_data['extra'][] = array( - 'class' => array('project-not-secure'), 'label' => t('Project not secure'), 'data' => t('This project has been labeled insecure by the Drupal security team, and is no longer available for download. Immediately disabling everything included by this project is strongly recommended!'), ); @@ -250,7 +249,6 @@ function update_calculate_project_update_status(&$project_data, $available) { $project_data['extra'] = array(); } $project_data['extra'][] = array( - 'class' => array('project-revoked'), 'label' => t('Project revoked'), 'data' => t('This project has been revoked, and is no longer available for download. Disabling everything included by this project is strongly recommended!'), ); @@ -261,7 +259,6 @@ function update_calculate_project_update_status(&$project_data, $available) { $project_data['extra'] = array(); } $project_data['extra'][] = array( - 'class' => array('project-not-supported'), 'label' => t('Project not supported'), 'data' => t('This project is no longer supported, and is no longer available for download. Disabling everything included by this project is strongly recommended!'), ); diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index ad396c8..edb4f82 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -246,7 +246,7 @@ function template_preprocess_update_project_status(&$variables) { if (!empty($project['extra'])) { foreach ($project['extra'] as $value) { $extra_item = array(); - $extra_item['attributes'] = new Attribute(array('class' => $value['class'])); + $extra_item['attributes'] = new Attribute(); $extra_item['label'] = $value['label']; $extra_item['data'] = drupal_placeholder($value['data']); $variables['extras'][] = $extra_item; @@ -290,32 +290,26 @@ function template_preprocess_update_project_status(&$variables) { } // Set the project status details. - $status_attributes = array(); $status_label = NULL; switch ($project['status']) { case UPDATE_NOT_SECURE: - $status_attributes['class'][] = 'security-error'; $status_label = t('Security update required!'); break; case UPDATE_REVOKED: - $status_attributes['class'][] = 'revoked'; $status_label = t('Revoked!'); break; case UPDATE_NOT_SUPPORTED: - $status_attributes['class'][] = 'not-supported'; $status_label = t('Not supported!'); break; case UPDATE_NOT_CURRENT: - $status_attributes['class'][] = 'not-current'; $status_label = t('Update available'); break; case UPDATE_CURRENT: - $status_attributes['class'][] = 'current'; $status_label = t('Up to date'); break; } $variables['status']['label'] = $status_label; - $variables['status']['attributes'] = new Attribute($status_attributes); + $variables['status']['attributes'] = new Attribute; $variables['status']['reason'] = (isset($project['reason'])) ? $project['reason'] : NULL; switch ($project['status']) {