Revision cafc7c3b
Added by Andreas Kohlbecker about 13 years ago
modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
818 | 818 |
return $pager->records; |
819 | 819 |
} |
820 | 820 |
|
821 |
function theme_cdm_IdentificationKey($identificationKey, $doLinkToKeyPage = true){ |
|
821 |
function theme_cdm_IdentificationKey($identificationKey, $doLinkToKeyPage = true, $showIdentificationKeyTitle = true){
|
|
822 | 822 |
|
823 | 823 |
$parentRenderPath = RenderHints::getRenderPath(); |
824 | 824 |
RenderHints::pushToRenderStack("IdentificationKey"); |
825 | 825 |
|
826 |
if($doLinkToKeyPage) { |
|
827 |
$out = l($identificationKey->titleCache, path_to_key($identificationKey->class, $identificationKey->uuid)); |
|
828 |
} else { |
|
829 |
$out = $identificationKey->titleCache; |
|
826 |
if($showIdentificationKeyTitle){ |
|
827 |
if($doLinkToKeyPage) { |
|
828 |
$out = l($identificationKey->titleCache, path_to_key($identificationKey->class, $identificationKey->uuid)); |
|
829 |
} else { |
|
830 |
$out = $identificationKey->titleCache; |
|
831 |
} |
|
830 | 832 |
} |
831 | 833 |
if(is_array($identificationKey->sources)){ |
832 | 834 |
// display sources |
835 |
$i = 0; |
|
836 |
$out .= '<div>'; |
|
833 | 837 |
foreach($identificationKey->sources as $source){ |
834 |
$out .= theme("cdm_IdentifieableSource", $source); |
|
838 |
$out .= ($i++ > 0 ? ', ' : '' ) . theme("cdm_IdentifieableSource", $source);
|
|
835 | 839 |
} |
836 |
// display annotations |
|
837 |
$out .= theme("cdm_annotations_as_footnotekeys", $identificationKey, $parentRenderPath); |
|
840 |
$out .= '</div>'; |
|
838 | 841 |
} |
842 |
// display annotations |
|
843 |
$out .= theme('cdm_annotations', cdm_ws_getAnnotationsFor($identificationKey), 'div'); |
|
839 | 844 |
RenderHints::popFromRenderStack(); |
840 | 845 |
return $out; |
841 | 846 |
} |
... | ... | |
871 | 876 |
|
872 | 877 |
$islinkToTaxonOrSubkey = isset($child->taxon->uuid) || isset($child->subkey->uuid); |
873 | 878 |
|
874 |
$out .= '<td class="edge" colspan="'. ( $islinkToTaxonOrSubkey ? '2' : '1' ) .'">'; |
|
879 |
$out .= '<td ' . RenderHints::getHtmlElementID($polytomousKeyNode) . ' class="edge" colspan="'. ( $islinkToTaxonOrSubkey ? '2' : '1' ) .'">';
|
|
875 | 880 |
if(isset($polytomousKeyNode->question->label_l10n)){ |
876 | 881 |
$out .= $polytomousKeyNode->question->label_l10n . ": "; |
877 | 882 |
} |
... | ... | |
884 | 889 |
} else { |
885 | 890 |
if(isset($child->taxon->uuid)){ |
886 | 891 |
// link to a taxon |
887 |
$out .= '<div class="nodeLinkToTaxon">' . theme("cdm_taxonName", $child->taxon->name, path_to_taxon($child->taxon->uuid)) . '</div>'; |
|
892 |
$out .= '<div class="nodeLinkToTaxon">'; |
|
893 |
if(is_object($child->modifyingText)){ |
|
894 |
$i = 0; |
|
895 |
foreach(get_object_vars($child->modifyingText) as $language=>$languageString){ |
|
896 |
$out .= ($i++ > 0 ? ', ' : '') . '<span class="modifyingText">'. $languageString->text . '</span> '; |
|
897 |
} |
|
898 |
} |
|
899 |
$out .= theme("cdm_taxonName", $child->taxon->name, path_to_taxon($child->taxon->uuid)) . '</div>'; |
|
888 | 900 |
} else if(isset($child->subkey->uuid)){ |
889 | 901 |
// link to a subkey |
890 | 902 |
$out .= '<div class="nodeLinkToSubkey">' |
Also available in: Unified diff
displaying polytomous keys (addons to #2152)