function form_test_two_instances

7.x form_test.module form_test_two_instances()

Menu callback that returns two instances of the node form.

1 string reference to 'form_test_two_instances'
form_test_menu in drupal-7.x/modules/simpletest/tests/form_test.module
Implements hook_menu().

File

drupal-7.x/modules/simpletest/tests/form_test.module, line 1760
Helper module for the form API tests.

Code

function form_test_two_instances() {
  global $user;
  $node1 = (object) array(
    'uid' => $user->uid,
    'name' => (isset($user->name) ? $user->name : ''),
    'type' => 'page',
    'language' => LANGUAGE_NONE,
  );
  $node2 = clone($node1);
  $return['node_form_1'] = drupal_get_form('page_node_form', $node1);
  $return['node_form_2'] = drupal_get_form('page_node_form', $node2);
  return $return;
}