/** * Constructs label markers. * * @return array Array of label markers. */ protected function getLabelMarkers() { $spellChecker = GeneralUtility::makeInstance('Tx_Solr_SpellChecker'); $searchWord = $this->parentPlugin->getCleanUserQuery(); $nothingFound = strtr($this->parentPlugin->pi_getLL('no_results_nothing_found'), array('@searchWord' => $searchWord)); $showingResultsSuggestion = strtr($this->parentPlugin->pi_getLL('no_results_showing_results_suggestion'), array('@suggestedWord' => $spellChecker->getCollatedSuggestion())); # TODO add link to execute query $searchForOriginal = strtr($this->parentPlugin->pi_getLL('no_results_search_for_original'), array('@searchWord' => $searchWord)); $searchedFor = strtr($this->parentPlugin->pi_getLL('results_searched_for'), array('@searchWord' => $searchWord)); $markers = array('query' => $searchWord, 'nothing_found' => $nothingFound, 'showing_results_suggestion' => $showingResultsSuggestion, 'search_for_original' => $searchForOriginal, 'searched_for' => $searchedFor); return $markers; }
/** * @return string */ protected function getPageBrowserRange() { $label = ''; $resultsFrom = $this->search->getResponseBody()->start + 1; $resultsTo = $resultsFrom + count($this->search->getResultDocuments()) - 1; $resultsTotal = $this->search->getNumberOfResults(); $label = strtr($this->parentPlugin->pi_getLL('results_range'), array('@resultsFrom' => $resultsFrom, '@resultsTo' => $resultsTo, '@resultsTotal' => $resultsTotal)); return $label; }
/** * Adds the JavaScript necessary for some of the facetting features; * folding/unfolding a list of facet options that exceed the configured * limit of visible options * * @return void */ protected function addFacetingJavascript() { $javascriptManager = $this->parentPlugin->getJavascriptManager(); $expansionLabels = ' var tx_solr_facetLabels = { \'showMore\' : \'' . $this->parentPlugin->pi_getLL('faceting_showMore') . '\', \'showFewer\' : \'' . $this->parentPlugin->pi_getLL('faceting_showFewer') . '\' }; '; $javascriptManager->addJavascript('tx_solr-factingExpansionLabels', $expansionLabels); $javascriptManager->loadFile('faceting.limitExpansion'); }