2021-05-08 11:44:47 +02:00
|
|
|
<?php
|
|
|
|
$fulltextSearch = $this->params()->fromQuery('fulltext_search');
|
|
|
|
$hasResults = false;
|
|
|
|
?>
|
|
|
|
|
2021-05-31 15:17:12 +02:00
|
|
|
|
|
|
|
<!-- arc-hive insert begins -->
|
2021-05-17 20:01:12 +02:00
|
|
|
<?php
|
2021-05-31 15:17:12 +02:00
|
|
|
//$site->pages();
|
2021-05-17 22:05:10 +02:00
|
|
|
// set header image
|
2021-05-17 20:01:12 +02:00
|
|
|
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site);
|
2021-05-31 15:17:12 +02:00
|
|
|
if (!$img_src) {
|
|
|
|
$img_src = '/themes/archive/asset/img/default-header-image.jpg';
|
|
|
|
}
|
|
|
|
|
2021-05-17 20:01:12 +02:00
|
|
|
?>
|
|
|
|
<style>
|
|
|
|
#archive_header_img {
|
|
|
|
background:url("<?= $img_src ?>") no-repeat;
|
|
|
|
width:100%;
|
|
|
|
height:100px;
|
|
|
|
}
|
|
|
|
</style>
|
2021-05-31 15:17:12 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
<?php
|
|
|
|
if ($this->site->title() != "Collections") {
|
|
|
|
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
|
|
|
} else {
|
|
|
|
$_html = $this->site->title();
|
2021-05-17 20:01:12 +02:00
|
|
|
}
|
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-05-08 11:44:47 +02:00
|
|
|
<h2><?php echo sprintf($this->translate('Search results for “%s”'), $fulltextSearch); ?></h2>
|
|
|
|
|
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
|
|
|
|
if ($responseSitePages && $responseSitePages->getTotalResults()):
|
|
|
|
$hasResults = true;
|
|
|
|
?>
|
2021-05-08 18:27:48 +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,
|
|
|
|
]);
|
|
|
|
?>
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
if ($responseItems && $responseItems->getTotalResults()):
|
|
|
|
$hasResults = true;
|
|
|
|
?>
|
2021-05-08 18:27:48 +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,
|
|
|
|
]);
|
|
|
|
?>
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php if (!$hasResults): ?>
|
|
|
|
<p><?php echo $this->translate('No result found'); ?>
|
|
|
|
<?php endif; ?>
|