You are here

function rules_admin_form_pack_storage in Rules 6

Use this function when there should be a further step. It puts all variables needed into the form storage

1 call to rules_admin_form_pack_storage()
rules_admin_form_add in rules_admin/rules_admin.rule_forms.inc
Returns the form for the add operation This handles adding conditions and actions

File

rules_admin/rules_admin.rule_forms.inc, line 394

Code

function rules_admin_form_pack_storage($form, &$form_state) {
  foreach (array(
    'proxy',
    'step',
    'element',
    'parent_id',
  ) as $key) {
    if (isset($form_state[$key])) {
      $form_state['storage'][$key] =& $form_state[$key];
    }
  }

  // Add a mechanism that includes arbitrary files needed by the form.
  // This can be used by configuration forms that need to rely on other files.
  $form['#after_build'][] = 'rules_after_build_include_files';

  // Register an after build callback that unpacks the storage.
  // However let the rules_admin.rule_forms.inc file be included previously, so that
  // #ahah callbacks from other modules keep working.
  $form['#includes'][] = "./" . drupal_get_path('module', 'rules_admin') . "/rules_admin.rule_forms.inc";
  $form['#after_build'][] = 'rules_admin_form_unpack_storage';
  return $form;
}