Project

General

Profile

« Previous | Next » 

Revision f695daf4

Added by Andreas Kohlbecker about 8 years ago

developer option to show reder paths

View differences:

modules/cdm_dataportal/cdm_dataportal.css
112 112
  font-weight: bold;
113 113
}
114 114

  
115
.render-path {
116
    color: white;
117
    border: 1px solid #060cff ;
118
    background-color: #ff2300   ;
119
}
120

  
115 121
/*
116 122
 * ======= Search-Form =======
117 123
 */
modules/cdm_dataportal/cdm_dataportal.module
668 668
              to be rendered will be the synonymy of the accepted taxon and not the above selected tab.'),
669 669
  );
670 670

  
671
  $form['developer_options'] = array(
672
      '#type' => 'fieldset',
673
      '#tree' => true,
674
      '#title' => t('Developer options'),
675
  );
676 671

  
677
  $form['developer_options']['show_render_path'] = array(
678
    '#type' => 'checkbox',
679
    '#title' => t('Display the render path for each taxon name.'),
680
    '#default_value' => variable_get($checkbox_value, 0),
681
    '#description' => t('This option is very helpful if you are editing the !link for taxon names.',
682
      array(
683
          '!link' => l(
684
            'render template', 'admin/config/cdm_dataportal/settings/layout', array('fragment' => 'edit-cdm-name-render-templates'))
685
          )
686
      ),
687
  );
672
  if(false){
673
    $form['developer_options'] = array(
674
        '#type' => 'fieldset',
675
        '#tree' => true,
676
        '#title' => t('Developer options'),
677
    );
678

  
679
    $form['developer_options']['show_render_path'] = array(
680
      '#type' => 'checkbox',
681
      '#title' => t('Display the render path for each taxon name.'),
682
      '#default_value' => variable_get($checkbox_value, 0),
683
      '#description' => t('This option is very helpful if you are editing the !link for taxon names.',
684
        array(
685
            '!link' => l(
686
              'render template', 'admin/config/cdm_dataportal/settings/layout', array('fragment' => 'edit-cdm-name-render-templates'))
687
            )
688
        ),
689
    );
690
  }
688 691

  
689 692
  $form['submit'] = array(
690 693
    '#type' => 'submit',
modules/cdm_dataportal/includes/name.inc
461 461
    }
462 462
  }
463 463

  
464

  
465 464
  // Fill with protologues etc...
466 465
  $descriptionHtml = '';
467 466
  if (array_setr('description', TRUE, $renderTemplate)) {
......
493 492
  }
494 493

  
495 494
  // Render.
496
  $out = '<span class="' . html_class_attribute_ref($taxon_name_or_taxon_base). '" data-cdm-ref="/name/' . $taxonName->uuid . '">';
495
  $out = '';
496
  if(isset($_REQUEST['RENDER_PATH'])){
497
    // developer option to show the render path with each taxon name
498
    $out .= '<span class="render-path">' . RenderHints::getRenderPath() . '</span>';
499
  }
500
  $out .= '<span class="' . html_class_attribute_ref($taxon_name_or_taxon_base)
501
    . '" data-cdm-ref="/name/' . $taxonName->uuid . '" data-cdm-render-path="' . RenderHints::getRenderPath() .'">';
497 502

  
498 503
  foreach ($renderTemplate as $partName => $part) {
499 504
    $separator = '';
......
546 551
 * @throws \Exception
547 552
 */
548 553
function cdm_name_relationships_of($taxon) {
549
// =========== START OF HOMONYMS ========== //
554

  
555
  // =========== START OF HOMONYMS ========== //
550 556
  RenderHints::pushToRenderStack('homonym');
551 557
  // the render stack element homonyms is being used in the default render templates !!!, see CDM_NAME_RENDER_TEMPLATES_DEFAULT
552 558

  
553
  // Later homonym or treated as later homonym AND bloking names.
559
  // Later homonym or treated as later homonym AND blocking names.
554 560
  // TODO apply filter ? $name_rels_to_show = variable_get('name_relationships_to_show', NULL);
555 561
  $from_name_relations = cdm_ws_get(CDM_WS_PORTAL_TAXON_FROM_NAMERELATIONS,
556 562
    $taxon->uuid);
......
579 585

  
580 586
          //from relation ships -> only shown at fromName-synonym
581 587
          if ($taxon->name->uuid == $element->fromName->uuid) {
582
            $taxon_html = render_taxon_or_name($element->toName, url(path_to_name($element->toName->uuid)));
588
            $taxon_html = render_taxon_or_name($element->toName,
589
              url(path_to_name($element->toName->uuid)));  // FIXME highlite in synonymy as in the other cases
583 590
          }
584 591
          break;
585 592
        case UUID_BLOCKING_NAME_FOR :
......
597 604
      }
598 605
      if (isset($taxon_html) && $taxon_html) {
599 606
        if (count($homonyms_array)) {
607
          // lat: "non nec" == german: "weder noch"
600 608
          $homonyms_array [] = 'nec ' . $taxon_html;
601
        }
602
        else {
609
        } else {
603 610
          $homonyms_array [] = 'non ' . $taxon_html;
604 611
        }
605 612
      }
modules/cdm_dataportal/settings.php
1530 1530
          <p>' . $which_version_message . '</p>
1531 1531
          <p>
1532 1532
          The render templates array contains one or more name render templates to be used within the page areas identified by the
1533
          render path. The render path is used as key of the array sub subelements whereas the name render template array is set as value.
1534
          The following render Path keys are curretly recognized:
1533
          render path. The render path of taxon names can be made visible by adding the URI query parameter 
1534
          <strong><code>RENDER_PATH=1</code></strong> to the page request.<br />
1535
          The render path is used as key of the array sub subelements whereas the name render template array is set as value.
1536
          The following render Path keys are currently recognized:
1535 1537
          <ul>
1536 1538
            <li>list_of_taxa</li>
1537 1539
            <li>acceptedFor</li>

Also available in: Unified diff