8
0
daux.io/templates/partials/search_script.php

36 Zeilen
1.0 KiB
PHP

2020-04-22 21:55:53 +02:00
<?php
if (!isset($config)) {
$config = $params;
}
?>
<?php if ($config->getHTML()->hasSearch()) { ?>
2019-09-09 19:56:14 +02:00
<script>
<?php
$search_strings = [
"Search_one_result",
"Search_results",
"Search_no_results",
"Search_common_words_ignored",
"Search_too_short",
"Search_one_character_or_more",
"Search_should_be_x_or_more",
"Link_previous",
"Link_next",
];
$search_translations = [];
foreach ($search_strings as $key) {
2019-09-09 19:56:14 +02:00
$search_translations[$key] = $this->translate($key);
}
?>
window.searchLanguage = <?= json_encode($page['language']) ?>;
window.searchTranslation = <?= json_encode($search_translations) ?>;
</script>
<!-- Search -->
<script type="text/javascript" src="<?php echo $base_url; ?>daux_libraries/search.min.js"></script>
2019-09-09 19:56:14 +02:00
<script>
window.search({'base_url': '<?php echo $base_url?>'})
2019-09-09 19:56:14 +02:00
</script>
<?php } ?>