/** * Render the concept sets column */ protected function _renderColumn_ConceptSets(ConceptSearchResultsGroup $csrg, Concept $c, $group_i, $i) { $num_open_lists = 0; /* * Show direct parents (not all ancestors), siblings, and children of the current concept. */ // Start column echo "\n<td class=\"col_3\">\n\t"; echo "<div class=\"hierarchy\">\n"; // If it has parents, loop through them if ($c->hasParents()) { foreach ($c->getParentIds() as $_parent_id) { // start list echo "<ul class=\"hierarchy_top\">\n"; // render the parent $parent_c = $this->cc->getConcept($_parent_id, $c->css_dict); if (!$parent_c) { continue; } $_name = $parent_c->getPreferredName(); $_display_name = $this->_shrinkText($_name); echo '<li class="concept_parent"><span class="concept_name"'; if ($_name != $_display_name) { echo ' title="' . htmlentities($_name) . '"'; } echo '>' . htmlentities($_display_name); echo '</span> (<a href="' . $this->getSearchUrl('id:' . $parent_c->concept_id, array('source' => $parent_c->css_dict->dict_db)) . '">' . $_parent_id . "</a>)</li>\n"; // Render current and its children echo "<li><ul class=\"hierarchy_not_top\">\n"; $this->_renderConceptSetCurrent($c, true); // Show siblings of the current $_i = 0; $num_results = $parent_c->getNumberChildren(); foreach ($parent_c->getChildrenIds() as $_sibling_id) { // skip if same as the current concept if ($_sibling_id == $c->concept_id) { continue; } // Display $sibling_concept = $this->cc->getConcept($_sibling_id, $parent_c->css_dict); $_name = $sibling_concept->getPreferredName(); $_display_name = $this->_shrinkText($_name); echo '<li class="concept_sibling"><span class="concept_name"'; if ($_name != $_display_name) { echo ' title="' . htmlentities($_name) . '"'; } echo '>' . htmlentities($_display_name); echo '</span> (<a href="' . $this->getSearchUrl('id:' . $_sibling_id, array('source' => $sibling_concept->css_dict->dict_db)) . '">' . $_sibling_id . '</a>)<br />'; echo '</li>'; // Hide lengthy results $_i++; if ($_i == $this->num_display_concept_set_results) { $ul_toggle_id = 'ul_cs_toggle_' . $c->css_dict->dict_id . '_' . $_parent_id . '_' . $c->concept_id; $ul_more_id = 'ul_cs_more_' . $c->css_dict->dict_id . '_' . $_parent_id . '_' . $c->concept_id; $num_more_results = $num_results - $this->num_display_concept_set_results - 1; echo "</ul>\n" . '<ul id="' . $ul_toggle_id . '" style="padding-left:24px;margin-top:6px;padding-top:0;list-style-type:none;">'; echo '<li class="concept_sibling"><a href="javascript:toggleElementVisibility(\'' . $ul_toggle_id . '\');toggleElementVisibility(\'' . $ul_more_id . '\');">' . 'See ' . $num_more_results . ' more siblings...</a></li></ul>' . "\n"; echo '<ul class="hierarchy_not_top" id="' . $ul_more_id . '" style="display:none;">'; } } // End list echo "</ul></li></ul>\n"; } } elseif ($c->hasChildren()) { echo "<ul class=\"hierarchy_top\">\n"; $this->_renderConceptSetCurrent($c, true); echo "</ul>\n"; } // end column echo "</div></td>"; }