Tons of changes made to the CORE. All scripts has more a less been modified. Primaril...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_fullsearch.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skaarhoj (kasper@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Class used in module tools/dbint (advanced search) and which may hold code specific for that module
29 * However the class has a general principle in it which may be used in the web/export module.
30 *
31 * $Id$
32 *
33 * @author Kasper Skaarhoj <kasper@typo3.com>
34 */
35 /**
36 * [CLASS/FUNCTION INDEX of SCRIPT]
37 *
38 *
39 *
40 * 83: class t3lib_fullsearch
41 * 98: function form()
42 * 112: function makeStoreControl()
43 * 151: function initStoreArray()
44 * 171: function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray)
45 * 188: function addToStoreQueryConfigs($storeQueryConfigs,$index)
46 * 204: function saveQueryInAction($uid)
47 * 254: function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray)
48 * 270: function procesStoreControl()
49 * 343: function queryMaker()
50 * 407: function getQueryResultCode($mQ,$res,$table)
51 * 514: function csvValues($row,$delim=",",$quote='"')
52 * 524: function tableWrap($str)
53 * 533: function search()
54 * 591: function resultRowDisplay($row,$conf,$table)
55 * 614: function resultRowTitles($row,$conf,$table)
56 *
57 * TOTAL FUNCTIONS: 15
58 * (This index is automatically created/updated by the extension "extdeveval")
59 *
60 */
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 /**
76 * Class used in module tools/dbint (advanced search) and which may hold code specific for that module
77 * However the class has a general principle in it which may be used in the web/export module.
78 *
79 * @author Kasper Skaarhoj <kasper@typo3.com>
80 * @package TYPO3
81 * @subpackage t3lib
82 */
83 class t3lib_fullsearch {
84 var $storeList = "search_query_smallparts,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery";
85 var $downloadScript = "index.php";
86 var $formW=48;
87 var $noDownloadB=0;
88
89
90
91
92
93 /**
94 * [Describe function...]
95 *
96 * @return [type] ...
97 */
98 function form() {
99 $out='
100 Search Word:<BR>
101 <input type="text" name="SET[sword]" value="'.$GLOBALS["SOBE"]->MOD_SETTINGS["sword"].'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'><input type="submit" name="submit" value="Search All Records">
102 ';
103
104 return $out;
105 }
106
107 /**
108 * [Describe function...]
109 *
110 * @return [type] ...
111 */
112 function makeStoreControl() {
113 // Load/Save
114 $storeArray = $this->initStoreArray();
115 $cur="";
116
117 // Store Array:
118 $opt=array();
119 reset($storeArray);
120 while(list($k,$v)=each($storeArray)) {
121 $opt[]='<option value="'.$k.'"'.(!strcmp($cur,$v)?" selected":"").'>'.htmlspecialchars($v).'</option>';
122 }
123
124 // Actions:
125 if (t3lib_extMgm::isLoaded("sys_action")) {
126 $query = "SELECT * FROM sys_action WHERE type=2 ORDER BY title";
127 $res = mysql(TYPO3_db,$query);
128 if (mysql_num_rows($res)) {
129 $opt[]='<option value="0">__Save to Action:__</option>';
130 while($row=mysql_fetch_assoc($res)) {
131 $opt[]='<option value="-'.$row["uid"].'"'.(!strcmp($cur,"-".$row["uid"])?" selected":"").'>'.htmlspecialchars($row["title"]." [".$row["uid"]."]").'</option>';
132 }
133 }
134 }
135
136 $TDparams=' nowrap="nowrap" class="bgColor4"';
137 $tmpCode='
138 <table border=0 cellpadding=3 cellspacing=1>
139 <tr'.$TDparams.'><td><select name="storeControl[STORE]" onChange="document.forms[0][\'storeControl[title]\'].value= this.options[this.selectedIndex].value!=0 ? this.options[this.selectedIndex].text : \'\';">'.implode(chr(10),$opt).'</select><input type="submit" name="storeControl[LOAD]" value="Load"></td></tr>
140 <tr'.$TDparams.'><td nowrap><input name="storeControl[title]" value="" type="text" max=80'.$GLOBALS["SOBE"]->doc->formWidth().'><input type="submit" name="storeControl[SAVE]" value="Save" onClick="if (document.forms[0][\'storeControl[STORE]\'].options[document.forms[0][\'storeControl[STORE]\'].selectedIndex].value<0) return confirm(\'Are you sure you want to overwrite the existing query in this action?\');"><input type="submit" name="storeControl[REMOVE]" value="Remove"></td></tr>
141 </table>
142 ';
143 return $tmpCode;
144 }
145
146 /**
147 * [Describe function...]
148 *
149 * @return [type] ...
150 */
151 function initStoreArray() {
152 $storeArray=array(
153 "0" => "[New]"
154 );
155
156 $savedStoreArray = unserialize($GLOBALS["SOBE"]->MOD_SETTINGS["storeArray"]);
157
158 if (is_array($savedStoreArray)) {
159 $storeArray = array_merge($storeArray,$savedStoreArray);
160 }
161 return $storeArray;
162 }
163
164 /**
165 * [Describe function...]
166 *
167 * @param [type] $storeQueryConfigs: ...
168 * @param [type] $storeArray: ...
169 * @return [type] ...
170 */
171 function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray) {
172 if (is_array($storeQueryConfigs)) {
173 reset($storeQueryConfigs);
174 while(list($k,$v)=each($storeQueryConfigs)) {
175 if (!isset($storeArray[$k])) unset($storeQueryConfigs[$k]);
176 }
177 }
178 return $storeQueryConfigs;
179 }
180
181 /**
182 * [Describe function...]
183 *
184 * @param [type] $storeQueryConfigs: ...
185 * @param [type] $index: ...
186 * @return [type] ...
187 */
188 function addToStoreQueryConfigs($storeQueryConfigs,$index) {
189 $keyArr = explode(",",$this->storeList);
190 reset($keyArr);
191 $storeQueryConfigs[$index]=array();
192 while(list(,$k)=each($keyArr)) {
193 $storeQueryConfigs[$index][$k]=$GLOBALS["SOBE"]->MOD_SETTINGS[$k];
194 }
195 return $storeQueryConfigs;
196 }
197
198 /**
199 * [Describe function...]
200 *
201 * @param [type] $uid: ...
202 * @return [type] ...
203 */
204 function saveQueryInAction($uid) {
205 if (t3lib_extMgm::isLoaded("sys_action")) {
206 $keyArr = explode(",",$this->storeList);
207 reset($keyArr);
208 $saveArr=array();
209 while(list(,$k)=each($keyArr)) {
210 $saveArr[$k]=$GLOBALS["SOBE"]->MOD_SETTINGS[$k];
211 }
212
213 $dA=array();
214 $qOK=0;
215 // Show query
216 if ($saveArr["queryTable"]) {
217 $qGen = t3lib_div::makeInstance("t3lib_queryGenerator");
218 $qGen->init("queryConfig",$saveArr["queryTable"]);
219 $qGen->makeSelectorTable($saveArr);
220
221 $qGen->enablePrefix=1;
222 $qString = $qGen->getQuery($qGen->queryConfig);
223 $qCount = "SELECT count(*) FROM ".$qGen->table." WHERE ".$qString.t3lib_BEfunc::deleteClause($qGen->table);
224 $qSelect = $qGen->getSelectQuery($qString);
225
226 $res = @mysql(TYPO3_db,$qCount);
227 if (!mysql_error()) {
228 $dA["t2_data"] = serialize(array(
229 "qC"=>$saveArr,
230 "qCount" => $qCount,
231 "qSelect" => $qSelect,
232 "qString" => $qString
233 ));
234 // debug(unserialize($dA["t2_data"]));
235 $qOK=1;
236 }
237 }
238 //$this->tableWrap($qExplain)
239
240 $query = t3lib_BEfunc::DBcompileUpdate("sys_action","uid=".intval($uid),$dA);
241 $res = mysql(TYPO3_db,$query);
242 return $qOK;
243 }
244 }
245
246 /**
247 * [Describe function...]
248 *
249 * @param [type] $storeQueryConfigs: ...
250 * @param [type] $storeIndex: ...
251 * @param [type] $writeArray: ...
252 * @return [type] ...
253 */
254 function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray) {
255 if ($storeQueryConfigs[$storeIndex]) {
256 $keyArr = explode(",",$this->storeList);
257 reset($keyArr);
258 while(list(,$k)=each($keyArr)) {
259 $writeArray[$k]=$storeQueryConfigs[$storeIndex][$k];
260 }
261 }
262 return $writeArray;
263 }
264
265 /**
266 * [Describe function...]
267 *
268 * @return [type] ...
269 */
270 function procesStoreControl() {
271 $storeArray = $this->initStoreArray();
272 $storeQueryConfigs = unserialize($GLOBALS["SOBE"]->MOD_SETTINGS["storeQueryConfigs"]);
273
274 $storeControl = t3lib_div::GPvar("storeControl");
275 $storeIndex = intval($storeControl["STORE"]);
276 $saveStoreArray=0;
277 $writeArray=array();
278 if (is_array($storeControl)) {
279 $storeControl = t3lib_div::slashArray($storeControl,"strip");
280 if ($storeControl["LOAD"]) {
281 if ($storeIndex>0) {
282 $writeArray=$this->loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray);
283 $saveStoreArray=1;
284 $msg="'".$storeArray[$storeIndex]."' query loaded!";
285 } elseif ($storeIndex<0 && t3lib_extMgm::isLoaded("sys_action")) {
286 $actionRecord=t3lib_BEfunc::getRecord("sys_action",abs($storeIndex));
287 if (is_array($actionRecord)) {
288 $dA = unserialize($actionRecord["t2_data"]);
289 $dbSC=array();
290 if (is_array($dA["qC"])) {
291 $dbSC[0] = $dA["qC"];
292 }
293 $writeArray=$this->loadStoreQueryConfigs($dbSC,"0",$writeArray);
294 $saveStoreArray=1;
295 $acTitle=htmlspecialchars($actionRecord["title"]);
296 $msg="Query from action '".$acTitle."' loaded!";
297 }
298 }
299 } elseif ($storeControl["SAVE"]) {
300 if ($storeIndex<0) {
301 $qOK = $this->saveQueryInAction(abs($storeIndex));
302 if ($qOK) {
303 $msg="Query OK and saved.";
304 } else {
305 $msg="No query saved!";
306 }
307 } else {
308 if (trim($storeControl["title"])) {
309 if ($storeIndex>0) {
310 $storeArray[$storeIndex]=$storeControl["title"];
311 } else {
312 $storeArray[]=$storeControl["title"];
313 end($storeArray);
314 $storeIndex=key($storeArray);
315 }
316 $storeQueryConfigs=$this->addToStoreQueryConfigs($storeQueryConfigs,$storeIndex);
317 $saveStoreArray=1;
318 $msg="'".$storeArray[$storeIndex]."' query saved!";
319 }
320 }
321 } elseif ($storeControl["REMOVE"]) {
322 if ($storeIndex>0) {
323 $msg="'".$storeArray[$storeControl["STORE"]]."' query entry removed!";
324 unset($storeArray[$storeControl["STORE"]]); // Removing
325 $saveStoreArray=1;
326 }
327 }
328 }
329 if ($saveStoreArray) {
330 unset($storeArray[0]); // making sure, index 0 is not set!
331 $writeArray["storeArray"]=serialize($storeArray);
332 $writeArray["storeQueryConfigs"]=serialize($this->cleanStoreQueryConfigs($storeQueryConfigs,$storeArray));
333 $GLOBALS["SOBE"]->MOD_SETTINGS = t3lib_BEfunc::getModuleData($GLOBALS["SOBE"]->MOD_MENU, $writeArray, $GLOBALS["SOBE"]->MCONF["name"], "ses");
334 }
335 return $msg;
336 }
337
338 /**
339 * [Describe function...]
340 *
341 * @return [type] ...
342 */
343 function queryMaker() {
344 global $TCA;
345
346 $msg=$this->procesStoreControl();
347
348 $output.= $GLOBALS["SOBE"]->doc->section('Load/Save Query',$this->makeStoreControl(),0,1);
349 if ($msg) {
350 $output.= $GLOBALS["SOBE"]->doc->section('','<font color=red><strong>'.$msg.'</strong></font>');
351 }
352 $output.= $GLOBALS["SOBE"]->doc->spacer(20);
353
354
355 // Query Maker:
356 $qGen = t3lib_div::makeInstance("t3lib_queryGenerator");
357 $qGen->init("queryConfig",$GLOBALS["SOBE"]->MOD_SETTINGS["queryTable"]);
358 $tmpCode=$qGen->makeSelectorTable($GLOBALS["SOBE"]->MOD_SETTINGS);
359 $output.= $GLOBALS["SOBE"]->doc->section('Make query',$tmpCode,0,1);
360
361 $mQ = $GLOBALS["SOBE"]->MOD_SETTINGS["search_query_makeQuery"];
362
363 // Make form elements:
364 if ($qGen->table && is_array($TCA[$qGen->table])) {
365 if ($mQ) {
366 // Show query
367 $qGen->enablePrefix=1;
368 $qString = $qGen->getQuery($qGen->queryConfig);
369 // debug($qGen->queryConfig);
370
371 switch($mQ) {
372 case "count":
373 $qExplain = "SELECT count(*) FROM ".$qGen->table." WHERE ".$qString.t3lib_BEfunc::deleteClause($qGen->table);
374 break;
375 default:
376 // $qExplain = "SELECT uid,pid,".$TCA[$qGen->table]["ctrl"]["label"]." FROM ".$qGen->table." WHERE ".$qString.t3lib_BEfunc::deleteClause($qGen->table)." LIMIT 100";
377 $qExplain = $qGen->getSelectQuery($qString);
378 if ($mQ=="explain") {
379 $qExplain="EXPLAIN ".$qExplain;
380 }
381 break;
382 }
383
384 $output.= $GLOBALS["SOBE"]->doc->section('SQL query',$this->tableWrap($qExplain),0,1);
385
386 $res = @mysql(TYPO3_db,$qExplain);
387 if (mysql_error()) {
388 $out.="<BR><strong>Error:</strong><BR><font color=red><strong>".mysql_error()."</strong></font>";
389 $output.= $GLOBALS["SOBE"]->doc->section('SQL error',$out,0,1);
390 } else {
391 $cPR = $this->getQueryResultCode($mQ,$res,$qGen->table);
392 $output.=$GLOBALS["SOBE"]->doc->section($cPR["header"],$cPR["content"],0,1);
393 }
394 }
395 }
396 return $output;
397 }
398
399 /**
400 * [Describe function...]
401 *
402 * @param [type] $mQ: ...
403 * @param [type] $res: ...
404 * @param [type] $table: ...
405 * @return [type] ...
406 */
407 function getQueryResultCode($mQ,$res,$table) {
408 global $TCA;
409 $output="";
410 $cPR=array();
411 switch($mQ) {
412 case "count":
413 $row = mysql_fetch_row($res);
414 $cPR["header"]='Count';
415 $cPR["content"]="<BR><strong>".$row[0]. "</strong> records selected.";
416 break;
417 case "all":
418 $rowArr=array();
419 while($row=mysql_fetch_assoc($res)) {
420 $rowArr[]=$this->resultRowDisplay($row,$TCA[$table],$table);
421 $lrow=$row;
422 }
423 if (count($rowArr)) {
424 $out.="<table border=0 cellpadding=2 cellspacing=1>".$this->resultRowTitles($lrow,$TCA[$table],$table).implode(chr(10),$rowArr)."</table>";
425 }
426 if (!$out) $out="<em>No rows selected!</em>";
427 $cPR["header"]='Result';
428 $cPR["content"]=$out;
429 break;
430 case "csv":
431 $rowArr=array();
432 $first=1;
433 while($row=mysql_fetch_assoc($res)) {
434 if ($first) {
435 $rowArr[]=$this->csvValues(array_keys($row),",","");
436 $first=0;
437 }
438 $rowArr[]=$this->csvValues($row);
439 }
440 if (count($rowArr)) {
441 $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS["SOBE"]->doc->formWidthText($this->formW,"","off").'>'.t3lib_div::formatForTextarea(implode(chr(10),$rowArr)).'</textarea>';
442 if (!$this->noDownloadB) {
443 $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">'; // document.forms[0].target=\'_blank\';
444 }
445 // Downloads file:
446 if (t3lib_div::GPvar("download_file")) {
447 $filename="TYPO3_".$table."_export_".date("dmy-Hi").".csv";
448 $mimeType = "application/octet-stream";
449 Header("Content-Type: ".$mimeType);
450 Header("Content-Disposition: attachment; filename=".$filename);
451 echo implode(chr(13).chr(10),$rowArr);
452 exit;
453 }
454 }
455 if (!$out) $out="<em>No rows selected!</em>";
456 $cPR["header"]='Result';
457 $cPR["content"]=$out;
458 break;
459 case "xml":
460 $className=t3lib_div::makeInstanceClassName("t3lib_xml");
461 $xmlObj = new $className("typo3_export");
462 $xmlObj->includeNonEmptyValues=1;
463 $xmlObj->renderHeader();
464 $first=1;
465 while($row=mysql_fetch_assoc($res)) {
466 if ($first) {
467 $xmlObj->setRecFields($table,implode(",",array_keys($row)));
468 // debug($xmlObj->XML_recFields);
469 $first=0;
470 }
471 $xmlObj->addRecord($table,$row);
472 }
473 $xmlObj->renderFooter();
474 if (mysql_num_rows($res)) {
475 $xmlData=$xmlObj->getResult();
476 $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS["SOBE"]->doc->formWidthText($this->formW,"","off").'>'.t3lib_div::formatForTextarea($xmlData).'</textarea>';
477 if (!$this->noDownloadB) {
478 $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">'; // document.forms[0].target=\'_blank\';
479 }
480 // Downloads file:
481 if (t3lib_div::GPvar("download_file")) {
482 $filename="TYPO3_".$table."_export_".date("dmy-Hi").".xml";
483 $mimeType = "application/octet-stream";
484 Header("Content-Type: ".$mimeType);
485 Header("Content-Disposition: attachment; filename=".$filename);
486 echo $xmlData;
487 exit;
488 }
489 }
490 if (!$out) $out="<em>No rows selected!</em>";
491 $cPR["header"]='Result';
492 $cPR["content"]=$out;
493 break;
494 case "explain":
495 default:
496 while($row=mysql_fetch_assoc($res)) {
497 $out.="<BR>".t3lib_div::view_array($row);
498 }
499 $cPR["header"]='Explain SQL query';
500 $cPR["content"]=$out;
501 break;
502 }
503 return $cPR;
504 }
505
506 /**
507 * [Describe function...]
508 *
509 * @param [type] $row: ...
510 * @param [type] $delim: ...
511 * @param [type] $quote: ...
512 * @return [type] ...
513 */
514 function csvValues($row,$delim=",",$quote='"') {
515 return t3lib_div::csvValues($row,$delim,$quote);
516 }
517
518 /**
519 * [Describe function...]
520 *
521 * @param [type] $str: ...
522 * @return [type] ...
523 */
524 function tableWrap($str) {
525 return '<table border=0 cellpadding=10 cellspacing=0 class="bgColor4"><tr><td nowrap><pre>'.$str.'</pre></td></tr></table>';
526 }
527
528 /**
529 * [Describe function...]
530 *
531 * @return [type] ...
532 */
533 function search() {
534 global $TCA;
535 $SET = t3lib_div::GPvar("SET");
536 $swords = $SET["sword"];
537 // $GLOBALS["HTTP_POST_VARS"]["SET"]["sword"]
538 $limit=200;
539 $showAlways=0;
540 if ($swords) {
541 reset($TCA);
542 while(list($table)=each($TCA)) {
543 // Get fields list
544 t3lib_div::loadTCA($table);
545 $conf=$TCA[$table];
546
547 reset($conf["columns"]);
548 $list=array();
549 while(list($field,)=each($conf["columns"])) {
550 $list[]=$field;
551 }
552 // Get query
553 $qp = t3lib_BEfunc::searchQuery(array($swords),$list);
554
555 // Count:
556 $query = "SELECT count(*) FROM ".$table." WHERE ".$qp.t3lib_BEfunc::deleteClause($table);
557 $res = mysql(TYPO3_db,$query);
558 echo mysql_error();
559 list($count)=mysql_fetch_row($res);
560 if($count || $showAlways) {
561 // Output header:
562 $out.="<strong>TABLE:</strong> ".$GLOBALS["LANG"]->sL($conf["ctrl"]["title"])."<BR>";
563 $out.="<strong>Results:</strong> ".$count."<BR>";
564
565 // Show to limit
566 if ($count) {
567 $query = "SELECT uid,pid,".$conf["ctrl"]["label"]." FROM ".$table." WHERE ".$qp.t3lib_BEfunc::deleteClause($table)." LIMIT ".$limit;
568 $res = mysql(TYPO3_db,$query);
569 $rowArr=array();
570 while($row=mysql_fetch_assoc($res)) {
571 $rowArr[]=$this->resultRowDisplay($row,$conf,$table);
572 $lrow=$row;
573 }
574 $out.="<table border=0 cellpadding=2 cellspacing=1>".$this->resultRowTitles($lrow,$conf,$table).implode(chr(10),$rowArr)."</table>";
575 }
576 $out.="<HR>";
577 }
578 }
579 }
580 return $out;
581 }
582
583 /**
584 * [Describe function...]
585 *
586 * @param [type] $row: ...
587 * @param [type] $conf: ...
588 * @param [type] $table: ...
589 * @return [type] ...
590 */
591 function resultRowDisplay($row,$conf,$table) {
592 $out='<tr class="bgColor4">';
593 reset($row);
594 while(list($fN,$fV)=each($row)) {
595 $TDparams = " nowrap";
596 $fVnew = t3lib_BEfunc::getProcessedValueExtra($table,$fN,$fV);
597 $out.='<td'.$TDparams.'>'.htmlspecialchars($fVnew).'</td>';
598 }
599 $params = '&edit['.$table.']['.$row["uid"].']=edit';
600 $out.='<td nowrap><A HREF="#" onClick="top.launchView(\''.$table.'\','.$row["uid"].',\''.$GLOBALS["BACK_PATH"].'\');return false;"><img src="'.$GLOBALS["BACK_PATH"].'gfx/zoom2.gif" width="12" height="12" alt="" /></a><A HREF="#" onClick="'.t3lib_BEfunc::editOnClick($params,$GLOBALS["BACK_PATH"],t3lib_div::getIndpEnv("REQUEST_URI").t3lib_div::implodeArrayForUrl("SET",$GLOBALS["HTTP_POST_VARS"]["SET"])).'"><img src="'.$GLOBALS["BACK_PATH"].'gfx/edit2.gif" width="11" height="12" border="0" alt=""></a></td>
601 </tr>
602 ';
603 return $out;
604 }
605
606 /**
607 * [Describe function...]
608 *
609 * @param [type] $row: ...
610 * @param [type] $conf: ...
611 * @param [type] $table: ...
612 * @return [type] ...
613 */
614 function resultRowTitles($row,$conf,$table) {
615 $out='<tr class="bgColor5">';
616 reset($row);
617 while(list($fN,$fV)=each($row)) {
618 if (strlen($fV)<50) {$TDparams = " nowrap";} else {$TDparams = "";}
619 $out.='<td'.$TDparams.'><strong>'.$GLOBALS["LANG"]->sL($conf["columns"][$fN]["label"]?$conf["columns"][$fN]["label"]:$fN,1).'</strong></td>';
620 }
621 $out.='<td nowrap></td>
622 </tr>
623 ';
624 return $out;
625 }
626 }
627
628 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["t3lib/class.t3lib_fullsearch.php"]) {
629 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["t3lib/class.t3lib_fullsearch.php"]);
630 }
631 ?>