daux.io/templates/partials/search_script.php
2019-09-20 23:20:05 +02:00

31 lines
967 B
PHP

<?php if ($params['html']['search']) { ?>
<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) {
$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; ?>_libraries/search.min.js"></script>
<script>
window.search({'base_url': '<?php echo $base_url?>'})
</script>
<?php } ?>