webform-form.tpl.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Customize the display of a complete webform.
  5. *
  6. * This file may be renamed "webform-form-[nid].tpl.php" to target a specific
  7. * webform on your site. Or you can leave it "webform-form.tpl.php" to affect
  8. * all webforms on your site.
  9. *
  10. * Available variables:
  11. * - $form: The complete form array.
  12. * - $nid: The node ID of the Webform.
  13. *
  14. * The $form array contains two main pieces:
  15. * - $form['submitted']: The main content of the user-created form.
  16. * - $form['details']: Internal information stored by Webform.
  17. */
  18. ?>
  19. <?php
  20. // If editing or viewing submissions, display the navigation at the top.
  21. if (isset($form['submission_info']) || isset($form['navigation'])) {
  22. print drupal_render($form['navigation']);
  23. print drupal_render($form['submission_info']);
  24. }
  25. // Print out the main part of the form.
  26. // Feel free to break this up and move the pieces within the array.
  27. print drupal_render($form['submitted']);
  28. // Always print out the entire $form. This renders the remaining pieces of the
  29. // form that haven't yet been rendered above.
  30. print drupal_render_children($form);
  31. // Print out the navigation again at the bottom.
  32. if (isset($form['submission_info']) || isset($form['navigation'])) {
  33. unset($form['navigation']['#printed']);
  34. print drupal_render($form['navigation']);
  35. }