multiform.example.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @file
  4. *
  5. *
  6. *
  7. * @author Kálmán Hosszu - hosszu.kalman@gmail.com - http://premiumcmsthemes.com http://www.kalman-hosszu.com
  8. */
  9. function multiform_test_menu() {
  10. return array(
  11. 'multiform_test' => array(
  12. 'access callback' => TRUE,
  13. 'type' => MENU_CALLBACK,
  14. 'page callback' => 'multiform_get_form',
  15. 'page arguments' => array(array('multiform_eaxample_test1'), array('multiform_test2')),
  16. ),
  17. );
  18. }
  19. function multiform_test1($form, $form_state) {
  20. $form['test1'] = array('#type' => 'textfield', '#title' => 'test1');
  21. $form['submit'] = array('#type' => 'submit', '#value' => 'save', '#submit' => array('multiform_test_submit_button'));
  22. $form['delete'] = array('#type' => 'submit', '#value' => 'delete', '#submit' => array('multiform_test_delete'));
  23. return $form;
  24. }
  25. function multiform_test2($form) {
  26. $form['submit'] = array('#type' => 'submit', '#value' => 'save', '#submit' => array('multiform_test_submit_button'));
  27. $form['delete'] = array('#type' => 'submit', '#value' => 'delete', '#submit' => array('multiform_test_delete'));
  28. $form['test2'] = array('#type' => 'textfield', '#title' => 'test2');
  29. return $form;
  30. }
  31. function multiform_test_submit_button($form, $form_state) {
  32. drupal_set_message($form['#form_id'] . 'multiform_test_submit_button');
  33. }
  34. function multiform_test_delete($form, $form_state) {
  35. drupal_set_message($form['#form_id'] . 'multiform_test_delete');
  36. }