Skip to content
This repository was archived by the owner on Jan 25, 2021. It is now read-only.
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static function explained(IndexerQuery $query)
}

// Build the interpreted query.
return count($parts) ? Text::sprintf('COM_FINDER_QUERY_TOKEN_INTERPRETED', implode(Text::_('COM_FINDER_QUERY_TOKEN_GLUE'), $parts)) : null;
return count($parts) ? implode(Text::_('COM_FINDER_QUERY_TOKEN_GLUE'), $parts) : null;
}

/**
Expand Down
16 changes: 12 additions & 4 deletions components/com_finder/tmpl/search/default_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@
<form action="<?php echo Route::_($this->query->toUri()); ?>" method="get" class="js-finder-searchform">
<?php echo $this->getFields(); ?>
<fieldset class="com-finder__search word mb-3">
<legend class="com-finder__search-legend sr-only">
<?php echo Text::_('COM_FINDER_SEARCH_FORM_LEGEND'); ?>
</legend>
<div class="form-inline">
<label for="q" class="mr-2">
<?php echo Text::_('COM_FINDER_SEARCH_TERMS'); ?>
</label>
<div class="input-group">
<input type="text" name="q" id="q" class="js-finder-search-query form-control" value="<?php echo $this->escape($this->query->input); ?>">
<input type="text" name="q" id="q" class="js-finder-search-query form-control"
value="<?php echo $this->escape($this->query->input); ?>">
<span class="input-group-append">
<button type="submit" class="btn btn-primary">
<span class="fas fa-search icon-white" aria-hidden="true"></span>
Expand All @@ -49,7 +53,11 @@
</fieldset>

<?php if ($this->params->get('show_advanced', 1)) : ?>
<div id="advancedSearch" class="com-finder__advanced js-finder-advanced collapse<?php if ($this->params->get('expand_advanced', 0)) echo ' show'; ?>">
<fieldset id="advancedSearch"
class="com-finder__advanced js-finder-advanced collapse<?php if ($this->params->get('expand_advanced', 0)) echo ' show'; ?>">
<legend class="com-finder__search-advanced sr-only">
<?php echo Text::_('COM_FINDER_SEARCH_ADVANCED_LEGEND'); ?>
</legend>
<?php if ($this->params->get('show_advanced_tips', 1)) : ?>
<div class="com-finder__tips card card-outline-secondary mb-3">
<div class="card-body">
Expand All @@ -58,7 +66,7 @@
<?php echo Text::_('COM_FINDER_ADVANCED_TIPS_NOT'); ?>
<?php echo Text::_('COM_FINDER_ADVANCED_TIPS_OR'); ?>
<?php if ($this->params->get('tuplecount', 1) > 1) : ?>
<?php echo Text::_('COM_FINDER_ADVANCED_TIPS_PHRASE'); ?>
<?php echo Text::_('COM_FINDER_ADVANCED_TIPS_PHRASE'); ?>
<?php endif; ?>
<?php echo Text::_('COM_FINDER_ADVANCED_TIPS_OUTRO'); ?>
</div>
Expand All @@ -67,6 +75,6 @@
<div id="finder-filter-window" class="com-finder__filter">
<?php echo HTMLHelper::_('filter.select', $this->query, $this->params); ?>
</div>
</div>
</fieldset>
<?php endif; ?>
</form>
85 changes: 41 additions & 44 deletions components/com_finder/tmpl/search/default_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,49 @@
$description = HTMLHelper::_('string.truncate', StringHelper::substr($full_description, $start), $desc_length, true);
}
?>
<dt class="result-title">
<h4 class="result-title <?php echo $mime; ?>">
<li class="result-item">
<header class="result-title">
<h4 class="result-title <?php echo $mime; ?>">
<?php if ($this->result->route) : ?>
<a href="<?php echo Route::_($this->result->route); ?>">
<?php echo $this->result->title; ?>
</a>
<?php echo HTMLHelper::link(Route::_($this->result->route), $this->result->title); ?>
<?php else : ?>
<?php echo $this->result->title; ?>
<?php endif; ?>
</h4>
</dt>
</h4>
</header>

<?php $taxonomies = $this->result->getTaxonomy(); ?>
<?php if (count($taxonomies) && $this->params->get('show_taxonomy', 1)) : ?>
<dd class="result-taxonomy">
<?php foreach ($taxonomies as $type => $taxonomy) : ?>
<?php $branch = Taxonomy::getBranch($type); ?>
<?php if ($branch->state == 1 && in_array($branch->access, $user->getAuthorisedViewLevels())) : ?>
<?php
$taxonomy_text = array();

foreach ($taxonomy as $node) :
if ($node->state == 1 && in_array($node->access, $user->getAuthorisedViewLevels())) :
$taxonomy_text[] = $node->title;
endif;
endforeach;

if (count($taxonomy_text)) : ?>
<span class="badge badge-secondary"><?php echo $type . ': ' . implode(',', $taxonomy_text); ?></span>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</dd>
<?php endif; ?>
<?php if ($show_description && $description !== '') : ?>
<dd class="result-text">
<?php echo $description; ?>
</dd>
<?php endif; ?>
<?php if ($this->result->start_date && $this->params->get('show_date', 1)) : ?>
<dd class="result-date small">
<?php echo HTMLHelper::_('date', $this->result->start_date, Text::_('DATE_FORMAT_LC3')); ?>
</dd>
<?php endif; ?>
<?php if ($this->params->get('show_url', 1)) : ?>
<dd class="result-url small">
<?php echo $this->baseUrl, Route::_($this->result->cleanURL); ?>
</dd>
<?php endif; ?>
<?php $taxonomies = $this->result->getTaxonomy(); ?>
<?php if (count($taxonomies) && $this->params->get('show_taxonomy', 1)) : ?>
<p class="result-taxonomy">
<?php foreach ($taxonomies as $type => $taxonomy) : ?>
<?php $branch = Taxonomy::getBranch($type); ?>
<?php if ($branch->state == 1 && in_array($branch->access, $user->getAuthorisedViewLevels())) : ?>
<?php $taxonomy_text = array(); ?>
<?php foreach ($taxonomy as $node) : ?>
<?php if ($node->state == 1 && in_array($node->access, $user->getAuthorisedViewLevels())) : ?>
<?php $taxonomy_text[] = $node->title; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if (count($taxonomy_text)) : ?>
<span class="badge badge-secondary"><?php echo $type . ': ' . implode(',', $taxonomy_text); ?></span>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</p>
<?php endif; ?>
<?php if ($show_description && $description !== '') : ?>
<p class="result-text">
<?php echo $description; ?>
</p>
<?php endif; ?>
<?php if ($this->result->start_date && $this->params->get('show_date', 1)) : ?>
<time class="result-date small">
<?php echo HTMLHelper::_('date', $this->result->start_date, Text::_('DATE_FORMAT_LC3')); ?>
</time>
<?php endif; ?>
<?php if ($this->params->get('show_url', 1)) : ?>
<div class="result-url small">
<?php echo $this->baseUrl, Route::_($this->result->cleanURL); ?>
</div>
<?php endif; ?>
</li>
6 changes: 3 additions & 3 deletions components/com_finder/tmpl/search/default_results.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<?php echo Text::sprintf('COM_FINDER_SEARCH_SIMILAR', $link); ?>
<?php elseif ($this->explained && $this->params->get('show_explained_query', 1)) : ?>
<?php // Display the explained search query. ?>
<?php echo $this->explained; ?>
<?php echo Text::sprintf('COM_FINDER_QUERY_TOKEN_INTERPRETED', $this->explained, Text::plural('COM_FINDER_QUERY_RESULTS', $this->total)); ?>
<?php endif; ?>
</div>
<?php endif; ?>
Expand All @@ -50,15 +50,15 @@
<?php endif; ?>
<?php // Display a list of results ?>
<br id="highlighter-start" />
<dl class="search-results list-striped">
<ol id="search-result-list" class="search-results list-striped">
<?php $this->baseUrl = Uri::getInstance()->toString(array('scheme', 'host', 'port')); ?>
<?php foreach ($this->results as $i => $result) : ?>
<?php $this->result = &$result; ?>
<?php $this->result->counter = $i + 1; ?>
<?php $layout = $this->getLayoutFile($this->result->layout); ?>
<?php echo $this->loadTemplate($layout); ?>
<?php endforeach; ?>
</dl>
</ol>
<br id="highlighter-end" />
<?php // Display the pagination ?>
<div class="com-finder__navigation search-pagination">
Expand Down
7 changes: 6 additions & 1 deletion language/en-GB/com_finder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ COM_FINDER_QUERY_FILTER_BRANCH_VENUE="venue"
COM_FINDER_QUERY_OPERATOR_AND="and"
COM_FINDER_QUERY_OPERATOR_NOT="not"
COM_FINDER_QUERY_OPERATOR_OR="or"
COM_FINDER_QUERY_RESULTS="the following <a href=\"#search-result-list\">%s results were found</a>."
COM_FINDER_QUERY_RESULTS_0="no results were found. <a href=\"#q\">Search again</a>."
COM_FINDER_QUERY_RESULTS_1="the following %s result was found."
COM_FINDER_QUERY_START_DATE="beginning date <span class=\"when\">%s</span> <span class=\"date\">%s</span>"
COM_FINDER_QUERY_TAXONOMY_NODE="with <span class=\"node\">%s</span> as <span class=\"branch\">%s</span> "
COM_FINDER_QUERY_TOKEN_EXCLUDED="<span class=\"term\">%s</span> should be excluded"
COM_FINDER_QUERY_TOKEN_GLUE=", and "
COM_FINDER_QUERY_TOKEN_INTERPRETED="Assuming %s, the following results were found."
COM_FINDER_QUERY_TOKEN_INTERPRETED="Assuming %s, %s"
COM_FINDER_QUERY_TOKEN_OPTIONAL="<span class=\"term\">%s</span> is optional"
COM_FINDER_QUERY_TOKEN_REQUIRED="<span class=\"term\">%s</span> is required"
COM_FINDER_SEARCH_ADVANCED_LEGEND="Advanced Search"
COM_FINDER_SEARCH_FORM_LEGEND="Search Form"
COM_FINDER_SEARCH_NO_RESULTS_BODY="No search results could be found for query: %s."
COM_FINDER_SEARCH_NO_RESULTS_BODY_MULTILANG="No search results in English (en-GB) could be found for query: %s."
COM_FINDER_SEARCH_NO_RESULTS_HEADING="No Results Found"
Expand Down