You are here

function openlayers_test_page in Openlayers 6

Same name and namespace in other branches
  1. 6.2 tests/openlayers_test.module \openlayers_test_page()

Callback for OpenLayers Test Page

1 string reference to 'openlayers_test_page'
openlayers_test_menu in tests/openlayers_test.module
Implementation of hook_menu().

File

tests/openlayers_test.module, line 444
Main OpenLayers Test Module file

Code

function openlayers_test_page() {
  $output = '';

  // Add some extra testing JS
  drupal_add_js(drupal_get_path('module', 'openlayers_test') . '/js/openlayers_test.js');

  // Render all maps
  $presets = openlayers_get_presets();
  foreach ($presets as $name => $title) {
    $rendered = openlayers_render_map($name);
    if ($rendered['themed']) {
      $output .= '
        <h3> ' . $title . '</h3>
        ' . $rendered['themed'] . '
      ';
    }
  }

  // Create collapsed fieldset
  $render_fieldset = openlayers_render_map();
  $element = array(
    '#value' => $render_fieldset['themed'],
    '#title' => t('Fieldset Example'),
    '#collapsed' => TRUE,
    '#collapsible' => TRUE,
  );
  $fieldset = theme_fieldset($element);

  // Create output
  $output .= '
    <!-- Not including fieldset cause its broken -->
  ';
  return $output;
}