Project

General

Profile

Bug #40280 ยป indexed_search_pointer.patch

Andreas Kiessling, 2012-08-27 18:38

View differences:

typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php
// formally known as $this->piVars['pointer']
protected $resultpagePointer = 0;
// display this amount of search results per page
protected $resultsPerPage = 0;
// formally known as $this->piVars['result']
protected $numberOfResults = 10;
......
$this->sortOrder = $searchData['sortOrder'];
$this->descendingSortOrderFlag = $searchData['desc'];
$this->resultpagePointer = $searchData['pointer'];
$this->resultsPerPage = intval($searchData['results']);
if (isset($searchData['numberOfResults']) && is_numeric($searchData['numberOfResults'])) {
$this->numberOfResults = intval($searchData['numberOfResults']);
......
$count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
// The pointer is set to the result page that is currently being viewed
$pointer = t3lib_div::intInRange($this->resultpagePointer, 0, floor($count / $this->resultsPerPage));
$pointer = 0;
if ($this->resultsPerPage) {
$pointer = t3lib_utility_Math::forceIntegerInRange($this->resultpagePointer, 0, floor($count / $this->resultsPerPage));
}
// Initialize result accumulation variables:
$c = 0; // Result pointer: Counts up the position in the current search-result
    (1-1/1)