You are here

function hook_msnf_info_steps_alter in Multistep Nodeform 7

Alter the step definition that will be attached to a form.

Parameters

array $steps_cached: List of steps. @see msnf_read_steps() for structure details.

array $context: Array of contextual variables you can use to determine the steps. The array contains:

  • entity_type: The entity type the steps are for.
  • bundle: The bundle the steps are for.
  • form: The form array of the form the steps will be attached to.
  • form_state: The current form_state of the form.
1 invocation of hook_msnf_info_steps_alter()
msnf_info_steps in ./msnf.module
Get all form steps.

File

./msnf.api.php, line 27
Hooks provided by the Multistep Nodeform module.

Code

function hook_msnf_info_steps_alter(&$steps_cached, $context) {
  if ($context['entity_type'] == 'node' && $context['bundle'] == 'article' && !empty($context['form']['node']->nid)) {

    // Disable steps on node/[nid]/edit for nodes of type "article".
    $steps_cached['node']['article'] = array();

    // Hide "skip" button for step "basics" in content type "article".
    $steps_cached['node']['article']['step_basics']->format_settings['instance_settings']['buttons']['skip'] = FALSE;
  }
}