Skip to content

Commit

Permalink
discoverygarden#82: prefix container list with unitid
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Dec 1, 2021
1 parent b374622 commit 3d67ebc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/jstreebuilder.inc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class JSTreeBuilder {
* Never actually got used?
*/
protected function getComponentTree(DOMElement $element) {
$unitid = $this->xpath->evaluate('normalize-space(string(ead:did/ead:unitid/descendant-or-self::*/text()))', $element);
$title = $this->xpath->evaluate('normalize-space(string(ead:did/ead:unittitle/descendant-or-self::*/text()))', $element);
$date = $this->xpath->evaluate('normalize-space(string(ead:did/ead:unitdate/descendant-or-self::*/text()))', $element);
$text = empty($date) ?
Expand All @@ -92,6 +93,9 @@ class JSTreeBuilder {
'@title' => $title,
'@date' => $date,
));
if ($unitid) {
$text = $unitid.' '.$text;
}
$info = array(
'id' => $element->getAttribute('id'),
'text' => $text,
Expand Down

0 comments on commit 3d67ebc

Please sign in to comment.