2021-05-08 11:44:47 +02:00
|
|
|
<?php
|
|
|
|
$fulltextSearch = $this->params()->fromQuery('fulltext_search');
|
|
|
|
$hasResults = false;
|
|
|
|
?>
|
2021-05-31 16:58:51 +02:00
|
|
|
<?php
|
|
|
|
//$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
|
|
|
//$collections = $archiveSiteHelper->getCollections();
|
|
|
|
?>
|
2021-05-31 15:17:12 +02:00
|
|
|
|
|
|
|
<!-- arc-hive insert begins -->
|
2021-05-17 20:01:12 +02:00
|
|
|
<?php
|
2021-06-01 12:01:07 +02:00
|
|
|
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($this->site);
|
2021-05-31 15:17:12 +02:00
|
|
|
if (!$img_src) {
|
2021-07-28 17:36:27 +02:00
|
|
|
$img_src = $this->assetUrl('img/ARC-HIVE-logo.svg');
|
2021-05-31 15:17:12 +02:00
|
|
|
}
|
2021-06-01 12:01:07 +02:00
|
|
|
if ($this->site->title() == "Collections") {
|
|
|
|
$image_height = "300px";
|
|
|
|
} else {
|
|
|
|
$image_height = "200px";
|
|
|
|
}
|
2021-05-17 20:01:12 +02:00
|
|
|
?>
|
2021-05-31 15:26:34 +02:00
|
|
|
<style>
|
|
|
|
#archive_header_img {
|
2021-06-01 12:01:07 +02:00
|
|
|
background: url("<?= $img_src ?>") no-repeat;
|
|
|
|
width: 100%;
|
|
|
|
height: <?= $image_height ?>;
|
2021-05-31 15:26:34 +02:00
|
|
|
}
|
|
|
|
</style>
|
2021-05-31 15:17:12 +02:00
|
|
|
<script>
|
|
|
|
<?php
|
2021-05-31 16:58:51 +02:00
|
|
|
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
2021-05-31 15:17:12 +02:00
|
|
|
?>
|
|
|
|
$("#archive_page_title").html('<?php echo $_html ?>');
|
|
|
|
</script>
|
|
|
|
<!-- arc-hive insert ends -->
|
2021-05-17 20:01:12 +02:00
|
|
|
|
2021-10-08 00:13:54 +02:00
|
|
|
<h3 class="search-results-for-title"><?php echo sprintf($this->translate('Search results for “%s”'), $fulltextSearch); ?></h3>
|
2021-05-08 11:44:47 +02:00
|
|
|
|
2021-05-31 15:17:12 +02:00
|
|
|
|
2021-05-08 18:27:48 +02:00
|
|
|
<div class="results">
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php
|
2021-05-31 16:58:51 +02:00
|
|
|
if ($this->site->title() == "Collections") {
|
|
|
|
/* convert all the results into sites and display the list of sites */
|
|
|
|
$result = array();
|
|
|
|
if ($responseSitePages && $responseSitePages->getTotalResults()) {
|
|
|
|
$hasResults = true;
|
|
|
|
foreach ($responseSitePages->getContent() as $sitePage) {
|
|
|
|
$site = $sitePage->site();
|
|
|
|
array_push($result, $site);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($responseItems && $responseItems->getTotalResults()) {
|
2021-05-08 11:44:47 +02:00
|
|
|
$hasResults = true;
|
2021-05-31 16:58:51 +02:00
|
|
|
foreach ($responseSitePages->getContent() as $sitePage) {
|
|
|
|
$site = $sitePage->site();
|
|
|
|
if (!in_array ($site , $result)) {
|
|
|
|
array_push($result, $site);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo $this->partial('common/block-layout/list-of-sites', [
|
|
|
|
'sites' => $result,
|
|
|
|
'summaries' => 1,
|
|
|
|
]);
|
|
|
|
} else {
|
|
|
|
/* display the results as normal */
|
2021-05-08 11:44:47 +02:00
|
|
|
?>
|
2021-05-31 16:58:51 +02:00
|
|
|
|
2021-05-08 18:27:48 +02:00
|
|
|
<?php
|
2021-05-31 16:58:51 +02:00
|
|
|
if ($responseSitePages && $responseSitePages->getTotalResults()):
|
|
|
|
$hasResults = true;
|
2021-05-08 18:27:48 +02:00
|
|
|
?>
|
2021-05-31 16:58:51 +02:00
|
|
|
<?php
|
|
|
|
$sitePages = array();
|
|
|
|
foreach ($responseSitePages->getContent() as $sitePage) {
|
|
|
|
array_push($sitePages, $sitePage);
|
|
|
|
}
|
|
|
|
echo $this->partial('common/cross-site-search/site-page-results', [
|
|
|
|
'sitePages' => $sitePages,
|
|
|
|
]);
|
|
|
|
?>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2021-05-08 18:27:48 +02:00
|
|
|
<?php
|
2021-05-31 16:58:51 +02:00
|
|
|
if ($responseItems && $responseItems->getTotalResults()):
|
|
|
|
$hasResults = true;
|
2021-05-08 18:27:48 +02:00
|
|
|
?>
|
2021-05-31 16:58:51 +02:00
|
|
|
<?php
|
|
|
|
$items = array();
|
|
|
|
foreach ($responseItems->getContent() as $item) {
|
|
|
|
array_push($items, $item);
|
|
|
|
}
|
|
|
|
echo $this->partial('common/cross-site-search/item-results', [
|
|
|
|
'items' => $items,
|
|
|
|
]);
|
|
|
|
?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php } ?>
|
2021-05-08 11:44:47 +02:00
|
|
|
</div>
|
|
|
|
|
2021-05-31 16:58:51 +02:00
|
|
|
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php if (!$hasResults): ?>
|
|
|
|
<p><?php echo $this->translate('No result found'); ?>
|
|
|
|
<?php endif; ?>
|