You are here

function msnf_preprocess_msnf_block_step_info in Multistep Nodeform 7

Define variables used in msnf-block-step-info.tpl.php.

Parameters

<array> $vars: Variables available for use in msnf-block-step-info.tpl.php.

See also

msnf-block-step-info.tpl.php.

File

./msnf.module, line 623
Main functions for module "Multistep Nodeform".

Code

function msnf_preprocess_msnf_block_step_info(&$vars) {
  $items = array();
  foreach ($vars['steps'] as $step_name => $step) {
    $item = array(
      'data' => msnf_translate(array(
        $step->step_name,
        $step->bundle,
        'label',
      ), $step->label),
      'title' => msnf_translate(array(
        $step->step_name,
        $step->bundle,
        'description',
      ), $step->format_settings['instance_settings']['description']),
      'class' => array(
        'msnf-form-step',
      ),
    );
    if ($step->identifier == $vars['current_step']->identifier) {

      // Add "active" class for current step.
      $item['class'][] = 'active';
    }
    $items[] = $item;
  }
  $vars['steps_rendered'] = theme('item_list', array(
    'items' => $items,
    'attributes' => array(
      'class' => array(
        'msnf-forms-steps',
      ),
    ),
  ));
}