Project

General

Profile

Revision 6776a5bc

ID6776a5bca14e5764cc33b6fae3855ebb65865b7b
Parent a009927b
Child 57978a6e

Added by Andreas Kohlbecker about 7 years ago

adjusting feature block settings

View differences:

7.x/modules/cdm_dataportal/settings.php
462 462

  
463 463
    // see #3257 (implement means to define the features to show up in the taxonprofile and in the specimen descriptions)
464 464

  
465
    // only needed as final option, when the settings are not having a default
465 466
    $default = array(
466 467
      'DEFAULT' => array(
467 468
        'as_list' => 'ul',
......
472 473
        'sort_elements' => NULL,
473 474
        'glue' => '',
474 475
        'element_tag'=> NULL
476
      )
477
    );
478

  
479
    // will be used as preset in the settings
480
    $other_themes_default = array(
481
      'DEFAULT' => array(
482
        'as_list' => 'ul',
483
        'link_to_reference' => FALSE,
484
        'link_to_name_used_in_source' => TRUE,
485
        'sources_as_content' => TRUE,
486
        'sources_as_content_to_bibliography' => FALSE,
487
        'sort_elements' => NULL,
488
        'glue' => '',
489
        'element_tag'=> NULL
475 490
      ),
476 491
      UUID_CITATION => array(
477 492
        'as_list' => 'div',
......
571 586
      ),
572 587
    );
573 588

  
589
    $cyprus_default = $cichorieae_default;
590
    $cyprus_default[UUID_DISTRIBUTION ]  =  array(
591
      'as_list' => 'div', // currently ignored
592
      'link_to_reference' => FALSE,
593
      'link_to_name_used_in_source' => FALSE,
594
      'sources_as_content' => FALSE,
595
      'sources_as_content_to_bibliography' => FALSE,
596
      'sort_elements' => NULL, // will cause ...
597
      'glue' => '',
598
      'element_tag'=> 'div'
599
    );
600

  
574 601
    $default_theme = variable_get('theme_default', NULL);
575 602

  
576 603
    switch ($default_theme){
577 604
      case 'garland_cichorieae':
605
        $settings_for_theme = $cichorieae_default;
606
        break;
578 607
      case 'cyprus':
579 608
        // cyprus: no longer used in production,
580 609
        // but is required for selenium tests see class eu.etaxonomy.dataportal.pages.PortalPage
581
        $settings_for_theme = $cichorieae_default;
610
        $settings_for_theme = $cyprus_default;
582 611
        break;
583 612
      case 'flore_afrique_centrale':
584 613
      case 'flora_malesiana':
......
590 619
        $settings_for_theme = $palmweb_default;
591 620
        break;
592 621
      default:
593
        $settings_for_theme =  $default;
622
        $settings_for_theme =  $other_themes_default;
594 623
    }
595 624

  
596 625
    if(isset($settings_for_theme[$feature_uuid])){
597 626
      return $settings_for_theme[$feature_uuid];
598 627
    } else if(isset($settings_for_theme['DEFAULT'])){
599
      return $settings_for_theme['DEFAULT'];
600
    } else if(isset($settings_for_theme[$feature_uuid])){
601
      return $default[$feature_uuid];
628
      return $settings_for_theme['DEFAULT']; // the fallback cascade will usually stop here since all settings should have a default
602 629
    } else {
603 630
      return $default['DEFAULT'];
604 631
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)