You are here

function _openlayers_cck_convert_form_data in Openlayers 6

1 call to _openlayers_cck_convert_form_data()
openlayers_cck_validate in modules/openlayers_cck/openlayers_cck.module
FAPI validate function for custom element

File

modules/openlayers_cck/openlayers_cck.module, line 463
This file holds the main Drupal hook functions and private functions for the openlayers_cck module.

Code

function _openlayers_cck_convert_form_data($element, $field) {
  $field_key = $element['#columns'][0];

  //$items = explode('||', $element['#value'][$field_key . '_hidden']);
  $items = explode('||', $element['#value']['openlayers_wkt_hidden']);
  $result = array();
  if (empty($items)) {
    $items[] = NULL;
  }
  $result = content_transpose_array_rows_cols(array(
    $field_key => $items,
  ));
  return $result;
}