You are here

function media_module_test_form in D7 Media 7.4

Same name and namespace in other branches
  1. 7.2 tests/media_module_test.module \media_module_test_form()
  2. 7.3 tests/media_module_test.module \media_module_test_form()

Form constructor for testing a 'media' element.

See also

media_module_test_form_submit()

1 string reference to 'media_module_test_form'
media_module_test_menu in tests/media_module_test.module
Implements hook_menu().

File

tests/media_module_test.module, line 72
Provides Media module pages for testing purposes.

Code

function media_module_test_form($form, &$form_state, $tree = TRUE, $extended = FALSE) {
  $form['#tree'] = (bool) $tree;
  $form['nested']['media'] = array(
    '#type' => 'media',
    '#title' => t('Media'),
    '#extended' => (bool) $extended,
    '#size' => 13,
  );
  $form['textfield'] = array(
    '#type' => 'textfield',
    '#title' => t('Type a value and ensure it stays'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}