You are here

function openlayers_ui_import_page in Openlayers 6.2

Import a preset from cut & paste

File

modules/openlayers_ui/openlayers_ui.module, line 557

Code

function openlayers_ui_import_page(&$form_state) {
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Preset name'),
    '#description' => t('Enter the name to use for this preset if it is different from the source preset. Leave blank to use the name of the preset.'),
  );
  $form['view'] = array(
    '#type' => 'textarea',
    '#title' => t('Paste preset code here'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
    '#submit' => array(
      'openlayers_ui_import_submit',
    ),
    '#validate' => array(
      'openlayers_ui_import_validate',
    ),
  );
  return $form;
}