function template_preprocess_ctools_wizard_trail

Same name in other branches
  1. 4.0.x ctools.module \template_preprocess_ctools_wizard_trail()

Template Preprocess for Wizard Trail.

Parameters

$variables:

File

./ctools.module, line 52

Code

function template_preprocess_ctools_wizard_trail(&$variables) {
    
    /** @var \Drupal\ctools\Wizard\FormWizardInterface|\Drupal\ctools\Wizard\EntityFormWizardInterface $wizard */
    $wizard = $variables['wizard'];
    $cached_values = $variables['cached_values'];
    $trail = $variables['trail'];
    $variables['step'] = $wizard->getStep($cached_values);
    foreach ($wizard->getOperations($cached_values) as $step => $operation) {
        $trail[$step] = !empty($operation['title']) ? $operation['title'] : '';
    }
    $variables['trail'] = $trail;
}