/** * Resolves the current iteration index (relative) of a loop to the absolute * number counting from zero of the total number of results. * * @param array $arguments * @return string */ public function execute(array $arguments = array()) { $numberOfResults = $this->search->getNumberOfResults(); $currentIterationIndex = $arguments[0]; $resultsPerPage = $this->search->getResultsPerPage(); $currentPage = 0; $getParameters = t3lib_div::_GET('tx_solr'); if (isset($getParameters['page'])) { $currentPage = intval($getParameters['page']); } return $currentPage * $resultsPerPage + $currentIterationIndex; }
public function execute() { $marker = array(); if ($this->configuration['search.']['sorting'] != 0 && $this->search->getNumberOfResults()) { $marker['loop_sort|sort'] = $this->getSortingLinks(); } if (count($marker) === 0) { // in case we didn't fill any markers - like when there are no // search results - we set markers to NULL to signal that we // want to have the subpart removed completely $marker = NULL; } return $marker; }
public function execute() { $marker = array(); if ($this->configuration['search.']['faceting'] && $this->search->getNumberOfResults()) { $marker['subpart_available_facets'] = $this->renderAvailableFacets(); $marker['subpart_used_facets'] = $this->renderUsedFacets(); $this->addFacetsJavascript(); } if (count($marker) === 0) { // in case we didn't fill any markers - like when there are no // search results - we set markers to NULL to signal that we // want to have the subpart removed completely $marker = NULL; } return $marker; }
protected function getPageBrowserRange() { $label = ''; $resultsFrom = $this->search->getResponse()->start + 1; $resultsTo = $resultsFrom + count($this->search->getResponse()->docs) - 1; $resultsTotal = $this->search->getNumberOfResults(); $label = strtr($this->parentPlugin->pi_getLL('results_range'), array('@resultsFrom' => $resultsFrom, '@resultsTo' => $resultsTo, '@resultsTotal' => $resultsTotal)); return $label; }