Revision c1974583
Added by Andreas Kohlbecker over 12 years ago
5.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
1029 | 1029 |
|
1030 | 1030 |
if(is_array($polytomousKeyNode->children)){ |
1031 | 1031 |
|
1032 |
$childCount = 0;
|
|
1032 |
$childIndex = 0;
|
|
1033 | 1033 |
|
1034 | 1034 |
// render edges of the current node |
1035 | 1035 |
foreach($polytomousKeyNode->children as &$child){ |
... | ... | |
1039 | 1039 |
continue; |
1040 | 1040 |
} |
1041 | 1041 |
|
1042 |
$out .= '<tr class="childCount_' . $childCount . '">'; |
|
1043 |
|
|
1044 |
$out .= '<td class="nodeNumber">'. uuid_anchor($polytomousKeyNode->uuid, $polytomousKeyNode->nodeNumber . str_pad("", $childCount++ , $statementCountCharacter)) . "</td>"; |
|
1045 |
|
|
1046 | 1042 |
/* |
1047 | 1043 |
* Special case: |
1048 | 1044 |
* Child nodes with empty statements but taxa as leaf are to |
... | ... | |
1053 | 1049 |
$islinkToSubKey = isset($child->subkey->uuid); |
1054 | 1050 |
$islinkToOtherNode = isset($child->otherNode); |
1055 | 1051 |
$islinkToNode = $child->nodeNumber && !$islinkToManyTaxa && !$islinkToOtherNode; // either null or 0 |
1052 |
$hasQuestion = isset($polytomousKeyNode->question->label_l10n); |
|
1053 |
|
|
1054 |
//$indentEdge = $hasQuestion && $childIndex > 0; |
|
1055 |
|
|
1056 |
// Questions |
|
1057 |
if($hasQuestion && $childIndex == 0){ |
|
1058 |
// place question, as extra table row |
|
1059 |
$out .= '<tr class="question new_section">'; |
|
1060 |
$out .= '<td class="nodeNumber">'. uuid_anchor($polytomousKeyNode->uuid, $polytomousKeyNode->nodeNumber) . "</td>"; |
|
1061 |
$out .= '<td class="question">' . $polytomousKeyNode->question->label_l10n . '</td>'; |
|
1062 |
$out .= '</tr>'; |
|
1063 |
} |
|
1056 | 1064 |
|
1057 |
$out .= '<td ' . RenderHints::getHtmlElementID($child) . ' class="edge">'; |
|
1058 |
if(isset($polytomousKeyNode->question->label_l10n)){ |
|
1059 |
$out .= $polytomousKeyNode->question->label_l10n . ": "; |
|
1065 |
$out .= '<tr class="childCount_' . $childIndex . (!$hasQuestion && $childIndex == 0 ? ' new_section':''). '">'; |
|
1066 |
|
|
1067 |
if($hasQuestion){ |
|
1068 |
$out .= '<td class="nodeNumber"></td>'; |
|
1069 |
} else { |
|
1070 |
$out .= '<td class="nodeNumber">'. uuid_anchor($polytomousKeyNode->uuid, $polytomousKeyNode->nodeNumber . str_pad("", $childIndex , $statementCountCharacter)) . "</td>"; |
|
1060 | 1071 |
} |
1061 |
$out .= $child->statement->label_l10n; |
|
1072 |
|
|
1073 |
$out .= '<td ' . RenderHints::getHtmlElementID($child) . ' class="edge'.($hasQuestion? ' edge-indent': '').'">'; |
|
1074 |
|
|
1075 |
|
|
1076 |
$out .= $child->statement->label_l10n; |
|
1062 | 1077 |
|
1063 | 1078 |
// --- links to nodes taxa and subkeys |
1064 | 1079 |
$out .= '<div class="nodeLink">'; |
... | ... | |
1111 | 1126 |
$out .= '</td>'; // end edge |
1112 | 1127 |
$out .= '</tr>'; |
1113 | 1128 |
|
1129 |
$childIndex++; |
|
1114 | 1130 |
} |
1115 | 1131 |
|
1116 | 1132 |
// recurse into child nodes |
... | ... | |
1119 | 1135 |
} |
1120 | 1136 |
|
1121 | 1137 |
} |
1138 |
|
|
1122 | 1139 |
return $out; |
1123 | 1140 |
} |
1124 | 1141 |
|
Also available in: Unified diff
fixing #2483 (Questions should be header line in PolytomousKeyNode)