You are here

function theme_openlayers_ui_presets_form_layers in Openlayers 6.2

1 theme call to theme_openlayers_ui_presets_form_layers()
openlayers_ui_presets_form in modules/openlayers_ui/includes/openlayers_ui.presets.inc
Menu Callback for Add Preset

File

modules/openlayers_ui/includes/openlayers_ui.theme.inc, line 72
This file holds the theme functions for openlayers ui module

Code

function theme_openlayers_ui_presets_form_layers($form) {
  $output = '';
  $output .= drupal_render($form['ahah-start']);
  $output .= drupal_render($form['projections']);

  // Base layers
  $rows = array();
  foreach (element_children($form['layers']['baselabels']) as $key) {
    $row = array();
    unset($form['layers']['default_layer'][$key]['#title']);
    unset($form['layers']['baselayers'][$key]['#title']);
    $row[] = drupal_render($form['layers']['baselabels'][$key]);
    $row[] = drupal_render($form['layers']['baselayers'][$key]);
    $row[] = drupal_render($form['layers']['default_layer'][$key]);
    $rows[] = $row;
  }
  $output .= theme('table', array(
    t('Base layers'),
    t('Enabled'),
    t('Default'),
  ), $rows);

  // Overlay layers
  $rows = array();
  foreach (element_children($form['layers']['overlaylabels']) as $key) {
    $row = array();
    unset($form['layers']['overlays'][$key]['#title']);
    unset($form['layer_activated'][$key]['#title']);
    unset($form['layer_switcher'][$key]['#title']);
    $row[] = drupal_render($form['layers']['overlaylabels'][$key]);
    $row[] = drupal_render($form['layer_weight'][$key]);
    $row[] = drupal_render($form['layers']['overlays'][$key]);
    $row[] = drupal_render($form['layer_activated'][$key]);
    $row[] = drupal_render($form['layer_switcher'][$key]);
    $row[] = drupal_render($form['layer_styles'][$key]);
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  $output .= theme('table', array(
    t('Overlay layers'),
    t('Weight'),
    t('Enabled'),
    t('Activated'),
    t('In Switcher'),
    t('Style'),
  ), $rows, array(
    'id' => 'overlay-layer-table',
  ));
  drupal_add_tabledrag('overlay-layer-table', 'order', 'sibling', 'layer-weight');
  $output .= drupal_render($form);
  return $output;
}