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 ...@@ -65,6 +65,7 @@ class GetIt extends AbstractHelper
protected $format; protected $format;
protected $facetAvail; protected $facetAvail;
protected $multipart; protected $multipart;
protected $isCollection;
protected $institution; protected $institution;
protected $megacollection; protected $megacollection;
protected $collection; protected $collection;
...@@ -91,7 +92,8 @@ class GetIt extends AbstractHelper ...@@ -91,7 +92,8 @@ class GetIt extends AbstractHelper
$this->sid = $this->driver->tryMethod('getSourceID'); $this->sid = $this->driver->tryMethod('getSourceID');
$this->format = $this->driver->tryMethod('getFormats'); $this->format = $this->driver->tryMethod('getFormats');
$this->facetAvail = $this->driver->tryMethod('getFacetAvail'); $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->institution = $this->driver->tryMethod('getInstitutions');
$this->megacollection = $this->driver->tryMethod('getMegaCollection'); $this->megacollection = $this->driver->tryMethod('getMegaCollection');
$this->collection = $this->driver->tryMethod('getCollection'); $this->collection = $this->driver->tryMethod('getCollection');
...@@ -255,8 +257,8 @@ class GetIt extends AbstractHelper ...@@ -255,8 +257,8 @@ class GetIt extends AbstractHelper
return $this->translate('getit_text_13'); return $this->translate('getit_text_13');
} }
} }
if (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) { if ($this->isCollection) {
return $this->translate('getit_text_11'); return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
} }
if (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection) if (preg_grep($this->_getNonSourceIds('source_idsV8_7'), $this->megacollection)
) { ) {
...@@ -296,8 +298,8 @@ class GetIt extends AbstractHelper ...@@ -296,8 +298,8 @@ class GetIt extends AbstractHelper
return $this->translate('getit_text_15'); return $this->translate('getit_text_15');
} }
} }
} elseif (preg_grep($this->_getNonSourceIds('source_idsV8_4'), [$this->multipart])) { } elseif ($this->isCollection) {
return $this->translate('getit_text_11'); return $this->translate('getit_text_11',['%%hierarchy_tree%%' => $this->translate('hierarchy_tree')]);
} elseif (in_array('Local', $this->facetAvail) } elseif (in_array('Local', $this->facetAvail)
&& preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format) && preg_grep($this->_getNonSourceIds('source_idsV8_2'), $this->format)
) { ) {
...@@ -352,7 +354,7 @@ class GetIt extends AbstractHelper ...@@ -352,7 +354,7 @@ class GetIt extends AbstractHelper
if (in_array($this->sid, $this->_getSourceIds('source_idsV9')) if (in_array($this->sid, $this->_getSourceIds('source_idsV9'))
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) && preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format)
&& !in_array($this->_getNonSourceIds('source_idsV8_9'), $this->institution) && !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) && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) { ) {
return true; return true;
...@@ -368,7 +370,7 @@ class GetIt extends AbstractHelper ...@@ -368,7 +370,7 @@ class GetIt extends AbstractHelper
if (!in_array('Free', $this->facetAvail) if (!in_array('Free', $this->facetAvail)
&& in_array($this->sid, $this->_getSourceIds('source_idsV9')) && in_array($this->sid, $this->_getSourceIds('source_idsV9'))
&& preg_grep($this->_getNonSourceIds('source_idsV8_1'), $this->format) && 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) && !preg_grep($this->_getNonSourceIds('source_idsV8_8'), $this->collection)
) { ) {
return true; 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