You are here

function modalframe_example_page in Modal Frame API 7

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

Menu callback; Generate the parent window, from where all examples are available.

1 string reference to 'modalframe_example_page'
modalframe_example_menu in modules/modalframe_example/modalframe_example.module
Implementation of hook_menu().

File

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

Code

function modalframe_example_page() {

  // Send the Modal Frame javascript for parent windows to the page.
  modalframe_parent_js();

  // Add the client-side behaviors for the examples.
  drupal_add_js(drupal_get_path('module', 'modalframe_example') . '/modalframe_example.js');
  $output = '<p>' . t('This is the Modal Frame examples page.') . '</p>';
  $output .= '<div class="modalframe-example-messages"></div>';

  // Render a list of several examples.
  $items = array(
    modalframe_example_get_item(t('Hello world!'), 'modalframe-example/hello-world', '300,200'),
    modalframe_example_get_item(t('Simple form where menu callback is drupal_get_form()'), 'modalframe-example/simple-form/first/second/third', '350,400'),
    modalframe_example_get_item(t('Simple form where menu callback is a custom function'), 'modalframe-example/simple-page/first/second/third', '350,400'),
    modalframe_example_get_item(t('Custom menu callback to edit a node'), 'modalframe-example/node-edit'),
  );
  $output .= theme('item_list', array(
    'items' => $items,
  ));
  return $output;
}