Skip to content
Snippets Groups Projects

Issue #2616456: Make progress bar accessible

Open Liam Morland requested to merge issue/webform-2616456:2616456-make-progress-bar into 6.2.x
2 files
+ 16
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -615,15 +615,28 @@ function _template_preprocess_webform_progress(array &$variables) {
@@ -615,15 +615,28 @@ function _template_preprocess_webform_progress(array &$variables) {
$current_index = $page_indexes[$current_page];
$current_index = $page_indexes[$current_page];
$variables['current_index'] = $current_index;
$variables['current_index'] = $current_index;
 
$title_prefix_completed = t('Completed:') . ' ';
 
$title_prefix_current = t('Current:') . ' ';
 
// Reset the pages variable.
// Reset the pages variable.
$variables['progress'] = [];
$variables['progress'] = [];
foreach ($pages as $key => $page) {
foreach ($pages as $key => $page) {
 
// Determine the title prefix, displayed to screen readers.
 
$title_prefix = match (count($variables['progress']) <=> $current_index) {
 
-1 => $title_prefix_completed,
 
0 => $title_prefix_current,
 
1 => NULL,
 
};
 
// Add variables for this page.
$variables['progress'][] = [
$variables['progress'][] = [
'name' => $key,
'name' => $key,
'title' => $page['#title'] ?? '',
'title' => $page['#title'] ?? '',
 
'title_prefix' => $title_prefix,
'type' => $page['#type'] ?? 'page',
'type' => $page['#type'] ?? 'page',
];
];
}
}
 
 
$variables['progress_list_label'] = t('Form progress');
}
}
/* ************************************************************************** */
/* ************************************************************************** */
Loading