You are here

function modalframe_example_simple_form in Modal Frame API 7

Same name and namespace in other branches
  1. 6 modules/modalframe_example/modalframe_example.module \modalframe_example_simple_form()

Generate the form for the child window.

2 string references to 'modalframe_example_simple_form'
modalframe_example_menu in modules/modalframe_example/modalframe_example.module
Implementation of hook_menu().
modalframe_example_simple_page in modules/modalframe_example/modalframe_example.module
Menu callback; Generate the child page for the example.

File

modules/modalframe_example/modalframe_example.module, line 120
Example for the Modal Frame module.

Code

function modalframe_example_simple_form($form, &$form_state) {
  $form = array();

  // Send the Modal Frame javascript for child windows to the page.
  modalframe_child_js();
  $page_arguments = func_get_args();
  array_shift($page_arguments);
  $form['markup'] = array(
    '#type' => 'markup',
    '#value' => '<pre>' . t('Page arguments') . ': ' . check_plain(var_export($page_arguments, TRUE)) . '</pre>',
  );
  $form['is_after_12'] = array(
    '#type' => 'radios',
    '#title' => t('What time is it?'),
    '#options' => array(
      t('Before 12:00 AM'),
      t('After 12:00 AM'),
    ),
    '#default_value' => 0,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}