Project

General

Profile

« Previous | Next » 

Revision 3844ef1e

Added by Katja Luther almost 2 years ago

fix #9917: remove etopo1 and add update script

View differences:

modules/cdm_dataportal/cdm_dataportal.install
58 58
  _rename_variable('cdm_dataportal_show_media', 'cdm_images_include_children');
59 59
}
60 60

  
61

  
62

  
61 63
/**
62 64
 * update for RELEASE 3.2.1:
63 65
 *  - adding missing permissions for role CDM Admin
......
526 528

  
527 529
  return join(', ', $tasks_performed);
528 530
}
531
/**
532
 * update for RELEASE 5.30:
533
 *  - map layers edit-etopo1 mapproxy_etopo1 removed, fallback to default, see https://dev.e-taxonomy.eu/redmine/issues/9917
534
 *
535
 */
536

  
537
function cdm_dataportal_update_7701()
538
{
539
  $tasks_performed = array();
540
  $cdm_map_distribution = variable_get(CDM_MAP_DISTRIBUTION);
541
  if(isset_not_empty($cdm_map_distribution)) {
542
    if (isset($cdm_map_distribution['openlayers'])) {
543
      if (isset($cdm_map_distribution['openlayers']['base_layers'])) {
544
        if (strpos($cdm_map_distribution['openlayers']['base_layers']['PREFERRED'], 'etopo1') !== FALSE) {
545
          $cdm_map_distribution['openlayers']['base_layers']['PREFERRED'] = 'open_topomap';
546
        }
547
        unset($cdm_map_distribution['openlayers']['base_layers']['edit-etopo1']);
548
        unset($cdm_map_distribution['openlayers']['base_layers']['mapproxy_etopo1']);
549
      }
550
      _modify_variable(CDM_MAP_DISTRIBUTION, $cdm_map_distribution);
551
      $tasks_performed[] = ' edit-etopo1 & mapproxy_etopo1 removed removed from ' . DISTRIBUTION_HIERARCHY_STYLE . " variable";
552
    }
553
  }
554
  return join(', ', $tasks_performed);
555
}
529 556

  
530 557
/* ======================================================================== */
531 558

  
532 559
/**
533 560
 * Renames a persistent variable.
534 561
 *
535
 * @return
562
 * @return string
536 563
 *   A message string of the performed operation.
537 564
 */
538 565
function _rename_variable($old_name, $new_name) {

Also available in: Unified diff