Project

General

Profile

Bug #14569 » 0000832-indexed_search.diff

Administrator Admin, 2005-02-23 09:53

View differences:

F:\XAMPP\xampp\htdocs\3.8.0\typo3\sysext\indexed_search\pi\class.tx_indexedsearch.php Tue Feb 22 20:59:28 2005
// Do search:
// If there were any search words entered...
if (is_array($this->sWArr)) {
$content = $this->doSearch($this->sWArr);
$content = $this->doSearch($this->sWArr, $conf);
}
// Finally compile all the content, form, messages and results:
......
* @param array Search words in array, see ->getSearchWords() for details
* @return string HTML for result display.
*/
function doSearch($sWArr) {
function doSearch($sWArr, $conf) {
// Get result rows:
$pt1 = t3lib_div::milliseconds();
......
* @param array Array with result rows, count, first row.
* @return string HTML content to display result.
*/
function getDisplayResults($sWArr, $resData) {
function getDisplayResults($sWArr, $resData, $conf) {
// Perform display of result rows array:
if ($resData) {
$GLOBALS['TT']->push('Display Final result');
......
* @param array Result rows
* @return string HTML
*/
function compileResult($resultRows) {
function compileResult($resultRows, $conf) {
$content = '';
// Transfer result rows to new variable, performing some mapping of sub-results etc.
......
// Render result rows:
foreach($resultRows as $row) {
$content.= $this->printResultRow($row);
$content.= $this->printResultRow($row, $conf);
}
}
break;
......
* @param integer 1=Display only header (for sub-rows!), 2=nothing at all
* @return string HTML code
*/
function printResultRow($row, $headerOnly=0) {
function printResultRow($row, $conf, $headerOnly=0) {
// Get template content:
$tmplContent = $this->prepareResultRowTemplateData($row, $headerOnly);
$tmplContent = $this->prepareResultRowTemplateData($row, $conf, $headerOnly);
if ($hookObj = &$this->hookRequest('printResultRow')) {
return $hookObj->printResultRow($row, $headerOnly, $tmplContent);
......
* @param boolean If set, display only header of result (for sub-results)
* @return array Array with data to insert in result row template
*/
function prepareResultRowTemplateData($row, $headerOnly) {
function prepareResultRowTemplateData($row, $conf, $headerOnly);
// Initialize:
$specRowConf = $this->getSpecialConfigForRow($row);
......
$tmplContent['title'] = $title;
$tmplContent['result_number'] = $row['result_number'];
$tmplContent['icon'] = $this->makeItemTypeIcon($row['item_type'],'',$specRowConf);
$tmplContent['rating'] = $this->makeRating($row);
$tmplContent['rating'] = $this->makeRating($row, $conf);
$tmplContent['description'] = $this->makeDescription($row,$this->piVars['extResume'] && !$headerOnly?0:1);
$tmplContent = $this->makeInfo($row,$tmplContent);
$tmplContent['access'] = $this->makeAccessIndication($row['page_id']);
......
* @param array Result row array
* @return string String showing ranking value
*/
function makeRating($row) {
function makeRating($row, $conf) {
switch((string)$this->piVars['order']) {
case 'rank_count': // Number of occurencies on page
......
return ceil(log($total)/log($max)*100).'%';
break;
case 'crdate': // Based on creation date
return $this->cObj->calcAge(time()-$row['item_crdate'],0); // ,$conf['age']
return $this->cObj->calcAge(time()-$row['item_crdate'], $conf['age']);
break;
case 'mtime': // Based on modification time
return $this->cObj->calcAge(time()-$row['item_mtime'],0); // ,$conf['age']
return $this->cObj->calcAge(time()-$row['item_mtime'], $conf['age']);
break;
default: // fx. title
return ' ';
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/pi/class.tx_indexedsearch.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/pi/class.tx_indexedsearch.php']);
}
?>
?>
(1-1/2)