diff --git a/components/com_finder/helpers/html/query.php b/components/com_finder/helpers/html/query.php index 63cfdfd1d5dff..2c48b30b0df9b 100644 --- a/components/com_finder/helpers/html/query.php +++ b/components/com_finder/helpers/html/query.php @@ -60,14 +60,16 @@ public static function explained(FinderIndexerQuery $query) if ($query->date1) { $date = JFactory::getDate($query->date1)->format(JText::_('DATE_FORMAT_LC')); - $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_START_DATE', $query->when1, $date) . ''; + $datecondition = JText::_('COM_FINDER_QUERY_DATE_CONDITION_' . strtoupper($query->when1)); + $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_START_DATE', $datecondition, $date) . ''; } // Process the end date. if ($query->date2) { $date = JFactory::getDate($query->date2)->format(JText::_('DATE_FORMAT_LC')); - $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_END_DATE', $query->when2, $date) . ''; + $datecondition = JText::_('COM_FINDER_QUERY_DATE_CONDITION_' . strtoupper($query->when2)); + $parts[] = '' . JText::sprintf('COM_FINDER_QUERY_END_DATE', $datecondition, $date) . ''; } // Process the taxonomy filters. diff --git a/components/com_finder/views/search/tmpl/default_form.php b/components/com_finder/views/search/tmpl/default_form.php index 097c49cbef306..0e251f98b1a53 100644 --- a/components/com_finder/views/search/tmpl/default_form.php +++ b/components/com_finder/views/search/tmpl/default_form.php @@ -14,50 +14,24 @@ JHtml::_('jquery.framework'); $script = " - jQuery(function() { - "; +jQuery(function() {"; if ($this->params->get('show_advanced', 1)) { /* - * This segment of code adds the slide effect to the advanced search box. - */ - $script .= " - var searchSlider = jQuery('#advanced-search'); - if (searchSlider.length) - {"; - if (!$this->params->get('expand_advanced', 0)) - { - $script .= "searchSlider.hide();"; - } - - $script .= " - jQuery('#advanced-search-toggle').on('click', function(e) { - e.stopPropagation(); - e.preventDefault(); - searchSlider.slideToggle(); - }); - }"; - /* * This segment of code disables select boxes that have no value when the * form is submitted so that the URL doesn't get blown up with null values. */ $script .= " - if (jQuery('#finder-search').length) { - jQuery('#finder-search').on('submit', function(e){ - e.stopPropagation(); - if (searchSlider.length) - { - // Disable select boxes with no value selected. - searchSlider.find('select').each(function(index, el) { - var el = jQuery(el); - if(!el.val()){ - el.attr('disabled', 'disabled'); - } - }); - } - }); + jQuery('#finder-search').on('submit', function(e){ + e.stopPropagation(); + // Disable select boxes with no value selected. + jQuery('#advancedSearch').find('select').each(function(index, el) { + var el = jQuery(el); + if(!el.val()){ + el.attr('disabled', 'disabled'); } - "; + }); + });"; } /* * This segment of code sets up the autocompleter. @@ -67,21 +41,19 @@ JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true); $script .= " - var suggest = jQuery('#q').autocomplete({ - serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false) . "', - paramName: 'q', - minChars: 1, - maxHeight: 400, - width: 300, - zIndex: 9999, - deferRequestBy: 500 - }); - "; + var suggest = jQuery('#q').autocomplete({ + serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false) . "', + paramName: 'q', + minChars: 1, + maxHeight: 400, + width: 300, + zIndex: 9999, + deferRequestBy: 500 + });"; } $script .= " - }); - "; +});"; JFactory::getDocument()->addScriptDeclaration($script); } @@ -114,7 +86,7 @@ params->get('show_advanced', 1)) : ?> -
+

params->get('show_advanced_tips', 1)) : ?>
diff --git a/language/en-GB/en-GB.com_finder.ini b/language/en-GB/en-GB.com_finder.ini index 40d17d32f4a19..6e13adf1a1aeb 100644 --- a/language/en-GB/en-GB.com_finder.ini +++ b/language/en-GB/en-GB.com_finder.ini @@ -18,6 +18,9 @@ COM_FINDER_FILTER_DATE2_DESC="Enter a date in YYYY-MM-DD format" COM_FINDER_FILTER_SELECT_ALL_LABEL="Search All" COM_FINDER_FILTER_WHEN_AFTER="After" COM_FINDER_FILTER_WHEN_BEFORE="Before" +COM_FINDER_QUERY_DATE_CONDITION_AFTER="after" +COM_FINDER_QUERY_DATE_CONDITION_BEFORE="before" +COM_FINDER_QUERY_DATE_CONDITION_EXACT="exactly on" COM_FINDER_QUERY_END_DATE="ending date %s %s" COM_FINDER_QUERY_OPERATOR_AND="and" COM_FINDER_QUERY_OPERATOR_OR="or"