You are here

function theme_openlayers_ui_maps_form_layers in Openlayers 7.2

1 theme call to theme_openlayers_ui_maps_form_layers()
openlayers_maps_ui::edit_form in modules/openlayers_ui/plugins/export_ui/openlayers_maps_ui.class.php
Provide the actual editing form.

File

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

Code

function theme_openlayers_ui_maps_form_layers($args) {
  $form = $args['elements'];
  $output = drupal_render($form['projections']) . drupal_render($form['help_data_overlays']);

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

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