Skip to content
Snippets Groups Projects
Commit 59a6e2a2 authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #16525 [fid] fixes hierarchy display

* adapts GetIt box logic for hierarchy parents
* use cascading translation for multi-valume notices
parent f55be980
No related merge requests found
......@@ -65,6 +65,7 @@ class GetIt extends AbstractHelper
protected $format;
protected $facetAvail;
protected $multipart;
protected $isCollection;
protected $institution;
protected $megacollection;
protected $collection;
......@@ -91,7 +92,8 @@ class GetIt extends AbstractHelper
$this->sid = $this->driver->tryMethod('getSourceID');
$this->format = $this->driver->tryMethod('getFormats');
$this->facetAvail = $this->driver->tryMethod('getFacetAvail');
$this->multipart = $this->driver->tryMethod('getMultiPart');
//$this->multipart = $this->driver->tryMethod('isMultiPartSet');
$this->isCollection = $this->driver->tryMethod('hasChildren');
$this->institution = $this->driver->tryMethod('getInstitutions');
$this->megacollection = $this->driver->tryMethod('getMegaCollection');
$this->collection = $this->driver->tryMethod('getCollection');
......@@ -255,8 +257,8 @@ class GetIt extends AbstractHelper
return $this->translate('getit_text_13');
}
}
if (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) {
return $this->translate('getit_text_11');
if ($this->isCollection) {
return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
}
if (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection)
) {
......@@ -296,8 +298,8 @@ class GetIt extends AbstractHelper
return $this->translate('getit_text_15');
}
}
} elseif (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) {
return $this->translate('getit_text_11');
} elseif ($this->isCollection) {
return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
} elseif (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
) {
......@@ -352,7 +354,7 @@ class GetIt extends AbstractHelper
if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution)
&& !preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])
&& !$this->isCollection
&& !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
return true;
......@@ -368,7 +370,7 @@ class GetIt extends AbstractHelper
if (!in_array('Free', $this->facetAvail)
&& in_array($this->sid, $this->_getSourceIds('source_idsV9'))
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& !preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])
&& !$this->isCollection
&& !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) {
return true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment