/t3lib/class.t3lib_fullsearch.php

https://bitbucket.org/linxpinx/mercurial · PHP · 1137 lines · 825 code · 73 blank · 239 comment · 207 complexity · 2a7f7e965a6eff9673c6344e8ae3ba9c MD5 · raw file

  1. <?php
  2. /***************************************************************
  3. * Copyright notice
  4. *
  5. * (c) 1999-2010 Kasper Skaarhoj (kasperYYYY@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: class.t3lib_fullsearch.php 7905 2010-06-13 14:42:33Z ohader $
  32. *
  33. * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
  34. * @coauthor Jo Hasenau <info@cybercraft.de>
  35. */
  36. /**
  37. * [CLASS/FUNCTION INDEX of SCRIPT]
  38. *
  39. *
  40. *
  41. * 88: class t3lib_fullsearch
  42. * 103: function form()
  43. * 117: function makeStoreControl()
  44. * 156: function initStoreArray()
  45. * 176: function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray)
  46. * 193: function addToStoreQueryConfigs($storeQueryConfigs,$index)
  47. * 209: function saveQueryInAction($uid)
  48. * 256: function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray)
  49. * 272: function procesStoreControl()
  50. * 344: function queryMaker()
  51. * 414: function getQueryResultCode($mQ,$res,$table)
  52. * 534: function csvValues($row, $delim=',', $quote='"', $conf=array(), $table='')
  53. * 550: function tableWrap($str)
  54. * 559: function search()
  55. * 614: function resultRowDisplay($row,$conf,$table)
  56. * 662: function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString)
  57. * 781: function getTreeList($id, $depth, $begin = 0, $perms_clause)
  58. * 818: function makeValueList($fN, $fV, $conf, $table, $splitString)
  59. * 1028: function resultRowTitles($row,$conf,$table)
  60. * 1058: function csvRowTitles($row, $conf, $table)
  61. *
  62. * TOTAL FUNCTIONS: 19
  63. * (This index is automatically created/updated by the extension "extdeveval")
  64. *
  65. */
  66. /**
  67. * Class used in module tools/dbint (advanced search) and which may hold code specific for that module
  68. * However the class has a general principle in it which may be used in the web/export module.
  69. *
  70. * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
  71. * @package TYPO3
  72. * @subpackage t3lib
  73. */
  74. class t3lib_fullsearch {
  75. var $storeList = 'search_query_smallparts,search_result_labels,labels_noprefix,show_deleted,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery';
  76. var $downloadScript = 'index.php';
  77. var $formW=48;
  78. var $noDownloadB=0;
  79. protected $formName = '';
  80. /**
  81. * constructor
  82. */
  83. public function __construct() {
  84. $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_t3lib_fullsearch.xml');
  85. }
  86. /**
  87. * [Describe function...]
  88. *
  89. * @return [type] ...
  90. */
  91. function form() {
  92. $out='
  93. Search Word:<BR>
  94. <input type="text" name="SET[sword]" value="'.htmlspecialchars($GLOBALS['SOBE']->MOD_SETTINGS['sword']).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).'><input type="submit" name="submit" value="Search All Records">
  95. ';
  96. return $out;
  97. }
  98. /**
  99. * [Describe function...]
  100. *
  101. * @return [type] ...
  102. */
  103. function makeStoreControl() {
  104. // Load/Save
  105. $storeArray = $this->initStoreArray();
  106. $cur='';
  107. // Store Array:
  108. $opt=array();
  109. foreach ($storeArray as $k => $v) {
  110. $opt[]='<option value="'.$k.'"'.(!strcmp($cur,$v)?' selected':'').'>'.htmlspecialchars($v).'</option>';
  111. }
  112. // Actions:
  113. if (t3lib_extMgm::isLoaded('sys_action') && $GLOBALS['BE_USER']->isAdmin()) {
  114. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', 'type=2', '', 'title');
  115. if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
  116. $opt[]='<option value="0">__Save to Action:__</option>';
  117. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  118. $opt[]='<option value="-'.$row['uid'].'"'.(!strcmp($cur,'-'.$row['uid'])?' selected':'').'>'.htmlspecialchars($row['title'].' ['.$row['uid'].']').'</option>';
  119. }
  120. }
  121. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  122. }
  123. $TDparams=' nowrap="nowrap" class="bgColor4"';
  124. $tmpCode='
  125. <table border="0" cellpadding="3" cellspacing="1">
  126. <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(LF,$opt).'</select><input type="submit" name="storeControl[LOAD]" value="Load"></td></tr>
  127. <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>
  128. </table>
  129. ';
  130. return $tmpCode;
  131. }
  132. /**
  133. * [Describe function...]
  134. *
  135. * @return [type] ...
  136. */
  137. function initStoreArray() {
  138. $storeArray=array(
  139. '0' => '[New]'
  140. );
  141. $savedStoreArray = unserialize($GLOBALS['SOBE']->MOD_SETTINGS['storeArray']);
  142. if (is_array($savedStoreArray)) {
  143. $storeArray = array_merge($storeArray,$savedStoreArray);
  144. }
  145. return $storeArray;
  146. }
  147. /**
  148. * [Describe function...]
  149. *
  150. * @param [type] $storeQueryConfigs: ...
  151. * @param [type] $storeArray: ...
  152. * @return [type] ...
  153. */
  154. function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray) {
  155. if (is_array($storeQueryConfigs)) {
  156. foreach ($storeQueryConfigs as $k => $v) {
  157. if (!isset($storeArray[$k])) unset($storeQueryConfigs[$k]);
  158. }
  159. }
  160. return $storeQueryConfigs;
  161. }
  162. /**
  163. * [Describe function...]
  164. *
  165. * @param [type] $storeQueryConfigs: ...
  166. * @param [type] $index: ...
  167. * @return [type] ...
  168. */
  169. function addToStoreQueryConfigs($storeQueryConfigs,$index) {
  170. $keyArr = explode(',',$this->storeList);
  171. $storeQueryConfigs[$index]=array();
  172. foreach ($keyArr as $k) {
  173. $storeQueryConfigs[$index][$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
  174. }
  175. return $storeQueryConfigs;
  176. }
  177. /**
  178. * [Describe function...]
  179. *
  180. * @param [type] $uid: ...
  181. * @return [type] ...
  182. */
  183. function saveQueryInAction($uid) {
  184. if (t3lib_extMgm::isLoaded('sys_action')) {
  185. $keyArr = explode(',',$this->storeList);
  186. $saveArr=array();
  187. foreach ($keyArr as $k) {
  188. $saveArr[$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
  189. }
  190. $qOK = 0;
  191. // Show query
  192. if ($saveArr['queryTable']) {
  193. /* @var t3lib_queryGenerator */
  194. $qGen = t3lib_div::makeInstance('t3lib_queryGenerator');
  195. $qGen->init('queryConfig',$saveArr['queryTable']);
  196. $qGen->makeSelectorTable($saveArr);
  197. $qGen->enablePrefix=1;
  198. $qString = $qGen->getQuery($qGen->queryConfig);
  199. $qCount = $GLOBALS['TYPO3_DB']->SELECTquery('count(*)', $qGen->table, $qString.t3lib_BEfunc::deleteClause($qGen->table));
  200. $qSelect = $qGen->getSelectQuery($qString);
  201. $res = @$GLOBALS['TYPO3_DB']->sql_query($qCount);
  202. if (!$GLOBALS['TYPO3_DB']->sql_error()) {
  203. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  204. $dA = array();
  205. $dA['t2_data'] = serialize(array(
  206. 'qC'=>$saveArr,
  207. 'qCount' => $qCount,
  208. 'qSelect' => $qSelect,
  209. 'qString' => $qString
  210. ));
  211. $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_action', 'uid='.intval($uid), $dA);
  212. $qOK=1;
  213. }
  214. }
  215. return $qOK;
  216. }
  217. }
  218. /**
  219. * [Describe function...]
  220. *
  221. * @param [type] $storeQueryConfigs: ...
  222. * @param [type] $storeIndex: ...
  223. * @param [type] $writeArray: ...
  224. * @return [type] ...
  225. */
  226. function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray) {
  227. if ($storeQueryConfigs[$storeIndex]) {
  228. $keyArr = explode(',',$this->storeList);
  229. foreach ($keyArr as $k) {
  230. $writeArray[$k]=$storeQueryConfigs[$storeIndex][$k];
  231. }
  232. }
  233. return $writeArray;
  234. }
  235. /**
  236. * [Describe function...]
  237. *
  238. * @return [type] ...
  239. */
  240. function procesStoreControl() {
  241. $storeArray = $this->initStoreArray();
  242. $storeQueryConfigs = unserialize($GLOBALS['SOBE']->MOD_SETTINGS['storeQueryConfigs']);
  243. $storeControl = t3lib_div::_GP('storeControl');
  244. $storeIndex = intval($storeControl['STORE']);
  245. $saveStoreArray=0;
  246. $writeArray=array();
  247. if (is_array($storeControl)) {
  248. $msg = '';
  249. if ($storeControl['LOAD']) {
  250. if ($storeIndex>0) {
  251. $writeArray=$this->loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray);
  252. $saveStoreArray = 1;
  253. $flashMessage = t3lib_div::makeInstance(
  254. 't3lib_FlashMessage',
  255. sprintf($GLOBALS['LANG']->getLL('query_loaded'), htmlspecialchars($storeArray[$storeIndex]))
  256. );
  257. } elseif ($storeIndex<0 && t3lib_extMgm::isLoaded('sys_action')) {
  258. $actionRecord=t3lib_BEfunc::getRecord('sys_action',abs($storeIndex));
  259. if (is_array($actionRecord)) {
  260. $dA = unserialize($actionRecord['t2_data']);
  261. $dbSC=array();
  262. if (is_array($dA['qC'])) {
  263. $dbSC[0] = $dA['qC'];
  264. }
  265. $writeArray=$this->loadStoreQueryConfigs($dbSC,'0',$writeArray);
  266. $saveStoreArray=1;
  267. $flashMessage = t3lib_div::makeInstance(
  268. 't3lib_FlashMessage',
  269. sprintf($GLOBALS['LANG']->getLL('query_from_action_loaded'), htmlspecialchars($actionRecord['title']))
  270. );
  271. }
  272. }
  273. } elseif ($storeControl['SAVE']) {
  274. if ($storeIndex<0) {
  275. $qOK = $this->saveQueryInAction(abs($storeIndex));
  276. if ($qOK) {
  277. $flashMessage = t3lib_div::makeInstance(
  278. 't3lib_FlashMessage',
  279. $GLOBALS['LANG']->getLL('query_saved')
  280. );
  281. } else {
  282. $flashMessage = t3lib_div::makeInstance(
  283. 't3lib_FlashMessage',
  284. $GLOBALS['LANG']->getLL('query_notsaved'),
  285. '',
  286. t3lib_FlashMessage::ERROR
  287. );
  288. }
  289. } else {
  290. if (trim($storeControl['title'])) {
  291. if ($storeIndex>0) {
  292. $storeArray[$storeIndex]=$storeControl['title'];
  293. } else {
  294. $storeArray[]=$storeControl['title'];
  295. end($storeArray);
  296. $storeIndex=key($storeArray);
  297. }
  298. $storeQueryConfigs=$this->addToStoreQueryConfigs($storeQueryConfigs,$storeIndex);
  299. $saveStoreArray=1;
  300. $flashMessage = t3lib_div::makeInstance(
  301. 't3lib_FlashMessage',
  302. $GLOBALS['LANG']->getLL('query_saved')
  303. );
  304. }
  305. }
  306. } elseif ($storeControl['REMOVE']) {
  307. if ($storeIndex>0) {
  308. $flashMessage = t3lib_div::makeInstance(
  309. 't3lib_FlashMessage',
  310. sprintf($GLOBALS['LANG']->getLL('query_removed'), htmlspecialchars($storeArray[$storeControl['STORE']]))
  311. );
  312. unset($storeArray[$storeControl['STORE']]); // Removing
  313. $saveStoreArray=1;
  314. }
  315. }
  316. if ($flashMessage) {
  317. $msg = $flashMessage->render();
  318. }
  319. }
  320. if ($saveStoreArray) {
  321. unset($storeArray[0]); // making sure, index 0 is not set!
  322. $writeArray['storeArray']=serialize($storeArray);
  323. $writeArray['storeQueryConfigs']=serialize($this->cleanStoreQueryConfigs($storeQueryConfigs,$storeArray));
  324. $GLOBALS['SOBE']->MOD_SETTINGS = t3lib_BEfunc::getModuleData($GLOBALS['SOBE']->MOD_MENU, $writeArray, $GLOBALS['SOBE']->MCONF['name'], 'ses');
  325. }
  326. return $msg;
  327. }
  328. /**
  329. * [Describe function...]
  330. *
  331. * @return [type] ...
  332. */
  333. function queryMaker() {
  334. global $TCA;
  335. if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'])) {
  336. $this->hookArray = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'];
  337. }
  338. $msg=$this->procesStoreControl();
  339. if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableStoreControl']) {
  340. $output.= $GLOBALS['SOBE']->doc->section('Load/Save Query',$this->makeStoreControl(),0,1);
  341. if ($msg) {
  342. $output .= '<br />' . $msg;
  343. }
  344. $output.= $GLOBALS['SOBE']->doc->spacer(20);
  345. }
  346. // Query Maker:
  347. $qGen = t3lib_div::makeInstance('t3lib_queryGenerator');
  348. $qGen->init('queryConfig',$GLOBALS['SOBE']->MOD_SETTINGS['queryTable']);
  349. if ($this->formName) {
  350. $qGen->setFormName($this->formName);
  351. }
  352. $tmpCode=$qGen->makeSelectorTable($GLOBALS['SOBE']->MOD_SETTINGS);
  353. $output.= $GLOBALS['SOBE']->doc->section('Make query',$tmpCode,0,1);
  354. $mQ = $GLOBALS['SOBE']->MOD_SETTINGS['search_query_makeQuery'];
  355. // Make form elements:
  356. if ($qGen->table && is_array($TCA[$qGen->table])) {
  357. if ($mQ) {
  358. // Show query
  359. $qGen->enablePrefix=1;
  360. $qString = $qGen->getQuery($qGen->queryConfig);
  361. // debug($qGen->queryConfig);
  362. switch($mQ) {
  363. case 'count':
  364. $qExplain = $GLOBALS['TYPO3_DB']->SELECTquery('count(*)', $qGen->table, $qString.t3lib_BEfunc::deleteClause($qGen->table));
  365. break;
  366. default:
  367. $qExplain = $qGen->getSelectQuery($qString);
  368. if ($mQ=='explain') {
  369. $qExplain='EXPLAIN '.$qExplain;
  370. }
  371. break;
  372. }
  373. if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableShowSQLQuery']) {
  374. $output.= $GLOBALS['SOBE']->doc->section('SQL query',$this->tableWrap(htmlspecialchars($qExplain)),0,1);
  375. }
  376. $res = @$GLOBALS['TYPO3_DB']->sql_query($qExplain);
  377. if ($GLOBALS['TYPO3_DB']->sql_error()) {
  378. $out.='<BR><strong>Error:</strong><BR><font color="red"><strong>'.$GLOBALS['TYPO3_DB']->sql_error().'</strong></font>';
  379. $output.= $GLOBALS['SOBE']->doc->section('SQL error',$out,0,1);
  380. } else {
  381. $cPR = $this->getQueryResultCode($mQ,$res,$qGen->table);
  382. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  383. $output.=$GLOBALS['SOBE']->doc->section($cPR['header'],$cPR['content'],0,1);
  384. }
  385. }
  386. }
  387. return $output;
  388. }
  389. /**
  390. * [Describe function...]
  391. *
  392. * @param [type] $mQ: ...
  393. * @param [type] $res: ...
  394. * @param [type] $table: ...
  395. * @return [type] ...
  396. */
  397. function getQueryResultCode($mQ,$res,$table) {
  398. global $TCA;
  399. $output='';
  400. $cPR=array();
  401. switch($mQ) {
  402. case 'count':
  403. $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
  404. $cPR['header']='Count';
  405. $cPR['content']='<BR><strong>'.$row[0]. '</strong> records selected.';
  406. break;
  407. case 'all':
  408. $rowArr=array();
  409. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  410. $rowArr[]=$this->resultRowDisplay($row,$TCA[$table],$table);
  411. $lrow=$row;
  412. }
  413. if (is_array($this->hookArray['beforeResultTable'])) {
  414. foreach ($this->hookArray['beforeResultTable'] as $_funcRef) {
  415. $out.=t3lib_div::callUserFunction($_funcRef, $GLOBALS['SOBE']->MOD_SETTINGS, $this);
  416. }
  417. }
  418. if (count($rowArr)) {
  419. $out.='<table border="0" cellpadding="2" cellspacing="1" width="100%">'.$this->resultRowTitles($lrow, $TCA[$table], $table).implode(LF, $rowArr).'</table>';
  420. }
  421. if (!$out) $out='<em>No rows selected!</em>';
  422. $cPR['header']='Result';
  423. $cPR['content']=$out;
  424. break;
  425. case 'csv':
  426. $rowArr=array();
  427. $first=1;
  428. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  429. if ($first) {
  430. $rowArr[]=$this->csvValues(array_keys($row),',','');
  431. $first=0;
  432. }
  433. $rowArr[]=$this->csvValues($row, ',', '"', $TCA[$table], $table);
  434. }
  435. if (count($rowArr)) {
  436. $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea(implode(LF,$rowArr)).'</textarea>';
  437. if (!$this->noDownloadB) {
  438. $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\''.$this->downloadScript.'\';">'; // document.forms[0].target=\'_blank\';
  439. }
  440. // Downloads file:
  441. if (t3lib_div::_GP('download_file')) {
  442. $filename='TYPO3_'.$table.'_export_'.date('dmy-Hi').'.csv';
  443. $mimeType = 'application/octet-stream';
  444. header('Content-Type: '.$mimeType);
  445. header('Content-Disposition: attachment; filename='.$filename);
  446. echo implode(CRLF,$rowArr);
  447. exit;
  448. }
  449. }
  450. if (!$out) $out='<em>No rows selected!</em>';
  451. $cPR['header']='Result';
  452. $cPR['content']=$out;
  453. break;
  454. case 'xml':
  455. $xmlObj = t3lib_div::makeInstance('t3lib_xml', 'typo3_export');
  456. $xmlObj->includeNonEmptyValues=1;
  457. $xmlObj->renderHeader();
  458. $first=1;
  459. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  460. if ($first) {
  461. $xmlObj->setRecFields($table,implode(',',array_keys($row)));
  462. // debug($xmlObj->XML_recFields);
  463. $first=0;
  464. }
  465. $valueArray = $row;
  466. if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
  467. foreach ($valueArray as $key => $val) {
  468. $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, $conf, ',');
  469. }
  470. }
  471. $xmlObj->addRecord($table, $valueArray);
  472. }
  473. $xmlObj->renderFooter();
  474. if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
  475. $xmlData=$xmlObj->getResult();
  476. $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea($xmlData).'</textarea>';
  477. if (!$this->noDownloadB) {
  478. $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\''.$this->downloadScript.'\';">'; // document.forms[0].target=\'_blank\';
  479. }
  480. // Downloads file:
  481. if (t3lib_div::_GP('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 = $GLOBALS['TYPO3_DB']->sql_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. * [Describe function...]
  507. *
  508. * @param [type] $row: ...
  509. * @param [type] $delim: ...
  510. * @param [type] $quote: ...
  511. * @param [type] $conf: ...
  512. * @param [type] $table: ...
  513. * @return [type] ...
  514. */
  515. function csvValues($row, $delim=',', $quote='"', $conf=array(), $table='') {
  516. $valueArray = $row;
  517. if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels'] && $table) {
  518. foreach ($valueArray as $key => $val) {
  519. $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, $conf, ';');
  520. }
  521. }
  522. return t3lib_div::csvValues($valueArray, $delim, $quote);
  523. }
  524. /**
  525. * [Describe function...]
  526. *
  527. * @param [type] $str: ...
  528. * @return [type] ...
  529. */
  530. function tableWrap($str) {
  531. return '<table border="0" cellpadding="10" cellspacing="0" class="bgColor4"><tr><td nowrap><pre>'.$str.'</pre></td></tr></table>';
  532. }
  533. /**
  534. * [Describe function...]
  535. *
  536. * @return [type] ...
  537. */
  538. function search() {
  539. global $TCA;
  540. $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
  541. $swords = $SET['sword'];
  542. $limit=200;
  543. $showAlways=0;
  544. if ($swords) {
  545. foreach ($TCA as $table => $value) {
  546. // Get fields list
  547. t3lib_div::loadTCA($table);
  548. $conf=$TCA[$table];
  549. // avoid querying tables with no columns
  550. if (empty($conf['columns'])) {
  551. continue;
  552. }
  553. $list = array_keys($conf['columns']);
  554. // Get query
  555. $qp = $GLOBALS['TYPO3_DB']->searchQuery(array($swords), $list, $table);
  556. // Count:
  557. $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $table, $qp . t3lib_BEfunc::deleteClause($table));
  558. if($count || $showAlways) {
  559. // Output header:
  560. $out.='<strong>TABLE:</strong> '.$GLOBALS['LANG']->sL($conf['ctrl']['title']).'<BR>';
  561. $out.='<strong>Results:</strong> '.$count.'<BR>';
  562. // Show to limit
  563. if ($count) {
  564. $rowArr = array();
  565. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,'.$conf['ctrl']['label'], $table, $qp.t3lib_BEfunc::deleteClause($table), '', '', $limit);
  566. while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  567. $rowArr[]=$this->resultRowDisplay($row,$conf,$table);
  568. $lrow=$row;
  569. }
  570. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  571. $out.='<table border="0" cellpadding="2" cellspacing="1">'.$this->resultRowTitles($lrow,$conf,$table).implode(LF,$rowArr).'</table>';
  572. }
  573. $out.='<HR>';
  574. }
  575. }
  576. }
  577. return $out;
  578. }
  579. /**
  580. * [Describe function...]
  581. *
  582. * @param [type] $row: ...
  583. * @param [type] $conf: ...
  584. * @param [type] $table: ...
  585. * @return [type] ...
  586. */
  587. function resultRowDisplay($row,$conf,$table) {
  588. static $even = false;
  589. $tce = t3lib_div::makeInstance('t3lib_TCEmain');
  590. $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
  591. $out='<tr class="bgColor' . ($even ? '6' : '4') . '">';
  592. $even = !$even;
  593. foreach ($row as $fN => $fV) {
  594. if (t3lib_div::inList($SET['queryFields'], $fN) || (!$SET['queryFields'] && $fN!='pid' && $fN!='deleted')) {
  595. if ($SET['search_result_labels']) {
  596. $fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />');
  597. } else {
  598. $fVnew = htmlspecialchars($fV);
  599. }
  600. $out.='<td>' . $fVnew . '</td>';
  601. }
  602. }
  603. $params = '&edit['.$table.']['.$row['uid'].']=edit';
  604. $out.='<td nowrap>';
  605. if (!$row['deleted']) {
  606. $out .= '<a href="#" onClick="top.launchView(\''.$table.'\','.$row['uid'].',\''.$GLOBALS['BACK_PATH'].'\');return false;">' . t3lib_iconWorks::getSpriteIcon('status-dialog-information') . '</a>';
  607. $out .= '<a href="#" onClick="'.t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], t3lib_div::getIndpEnv('REQUEST_URI').t3lib_div::implodeArrayForUrl('SET', (array)t3lib_div::_POST('SET'))).'">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
  608. } else {
  609. $out.= '<a href="'.t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'].'tce_db.php', array('cmd['.$table.']['.$row['uid'].'][undelete]' => '1', 'redirect' => t3lib_div::linkThisScript(array()))).'">';
  610. $out.= t3lib_iconWorks::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
  611. $out.= '<a href="'.t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'].'tce_db.php', array('cmd['.$table.']['.$row['uid'].'][undelete]' => '1', 'redirect' => t3lib_div::linkThisUrl('alt_doc.php', array('edit['.$table.']['.$row['uid'].']' => 'edit', 'returnUrl' => t3lib_div::linkThisScript(array()))))).'">';
  612. $out.= t3lib_iconWorks::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
  613. }
  614. $_params = array($table=>$row);
  615. if (is_array($this->hookArray['additionalButtons'])) {
  616. foreach ($this->hookArray['additionalButtons'] as $_funcRef) {
  617. $out.=t3lib_div::callUserFunction($_funcRef, $_params, $this);
  618. }
  619. }
  620. $out.='</td>
  621. </tr>
  622. ';
  623. return $out;
  624. }
  625. /**
  626. * [Describe function...]
  627. *
  628. * @param [type] $table: ...
  629. * @param [type] $fN: ...
  630. * @param [type] $fV: ...
  631. * @param [type] $conf: ...
  632. * @param [type] $splitString: ...
  633. * @return [type] ...
  634. */
  635. function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString) {
  636. global $TCA;
  637. // Analysing the fields in the table.
  638. if (is_array($TCA[$table])) {
  639. t3lib_div::loadTCA($table);
  640. $fC = $TCA[$table]['columns'][$fN];
  641. $fields = $fC['config'];
  642. $fields['exclude'] = $fC['exclude'];
  643. if (is_array($fC) && $fC['label']) {
  644. $fields['label'] = preg_replace('/:$/', '', trim($GLOBALS['LANG']->sL($fC['label'])));
  645. switch ($fields['type']) {
  646. case 'input':
  647. if (preg_match('/int|year/i', $fields['eval'])) {
  648. $fields['type'] = 'number';
  649. } elseif (preg_match('/time/i', $fields['eval'])) {
  650. $fields['type'] = 'time';
  651. } elseif (preg_match('/date/i', $fields['eval'])) {
  652. $fields['type'] = 'date';
  653. } else {
  654. $fields['type'] = 'text';
  655. }
  656. break;
  657. case 'check':
  658. if (!$fields['items']) {
  659. $fields['type'] = 'boolean';
  660. } else {
  661. $fields['type'] = 'binary';
  662. }
  663. break;
  664. case 'radio':
  665. $fields['type'] = 'multiple';
  666. break;
  667. case 'select':
  668. $fields['type'] = 'multiple';
  669. if ($fields['foreign_table']) {
  670. $fields['type'] = 'relation';
  671. }
  672. if ($fields['special']) {
  673. $fields['type'] = 'text';
  674. }
  675. break;
  676. case 'group':
  677. $fields['type'] = 'files';
  678. if ($fields['internal_type']=='db') {
  679. $fields['type'] = 'relation';
  680. }
  681. break;
  682. case 'user':
  683. case 'flex':
  684. case 'passthrough':
  685. case 'none':
  686. case 'text':
  687. default:
  688. $fields['type'] = 'text';
  689. break;
  690. }
  691. } else {
  692. $fields['label'] = '[FIELD: '.$fN.']';
  693. switch ($fN) {
  694. case 'pid':
  695. $fields['type'] = 'relation';
  696. $fields['allowed'] = 'pages';
  697. break;
  698. case 'cruser_id':
  699. $fields['type'] = 'relation';
  700. $fields['allowed'] = 'be_users';
  701. break;
  702. case 'tstamp':
  703. case 'crdate':
  704. $fields['type'] = 'time';
  705. break;
  706. default:
  707. $fields['type'] = 'number';
  708. break;
  709. }
  710. }
  711. }
  712. switch ($fields['type']) {
  713. case 'date':
  714. if ($fV != -1) {
  715. $out = strftime('%e-%m-%Y', $fV);
  716. }
  717. break;
  718. case 'time':
  719. if ($fV != -1) {
  720. if ($splitString=='<br />') {
  721. $out = strftime('%H:%M'.$splitString.'%e-%m-%Y', $fV);
  722. } else {
  723. $out = strftime('%H:%M %e-%m-%Y', $fV);
  724. }
  725. }
  726. break;
  727. case 'multiple':
  728. case 'binary':
  729. case 'relation':
  730. $out = $this->makeValueList($fN, $fV, $fields, $table, $splitString);
  731. break;
  732. case 'boolean':
  733. $out = $fV ? 'True' : 'False';
  734. break;
  735. case 'files':
  736. default:
  737. $out = htmlspecialchars($fV);
  738. break;
  739. }
  740. return $out;
  741. }
  742. /*
  743. * [Describe function...]
  744. *
  745. * @param [type] $qString: ...
  746. * @param [type] $depth: ...
  747. * @param [type] $begin: ...
  748. * @param [type] $perms_clause: ...
  749. * @return [type] ...
  750. */
  751. function getTreeList($id, $depth, $begin = 0, $perms_clause) {
  752. $depth = intval($depth);
  753. $begin = intval($begin);
  754. $id = intval($id);
  755. if ($begin == 0) {
  756. $theList = $id;
  757. } else {
  758. $theList = '';
  759. }
  760. if ($id && $depth > 0) {
  761. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
  762. 'uid',
  763. 'pages',
  764. 'pid='.$id.' '.t3lib_BEfunc::deleteClause('pages').' AND '.$perms_clause
  765. );
  766. while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  767. if ($begin <= 0) {
  768. $theList .= ','.$row['uid'];
  769. }
  770. if ($depth > 1) {
  771. $theList .= $this->getTreeList($row['uid'], $depth-1, $begin-1, $perms_clause);
  772. }
  773. }
  774. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  775. }
  776. return $theList;
  777. }
  778. /**
  779. * [Describe function...]
  780. *
  781. * @param [type] $fN: ...
  782. * @param [type] $fV: ...
  783. * @param [type] $conf: ...
  784. * @param [type] $table: ...
  785. * @param [type] $splitString: ...
  786. * @return [type] ...
  787. */
  788. function makeValueList($fN, $fV, $conf, $table, $splitString) {
  789. $fieldSetup = $conf;
  790. if ($fieldSetup['type'] == 'files') {
  791. $d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']);
  792. while (false !== ($entry = $d->read())) {
  793. if ($entry == '.' || $entry == '..') {
  794. continue;
  795. }
  796. $fileArray[] = $entry;
  797. }
  798. $d->close();
  799. natcasesort($fileArray);
  800. while (list(, $fileName) = each($fileArray)) {
  801. if (t3lib_div::inList($fV, $fileName) || $fV == $fileName) {
  802. if (!$out) {
  803. $out = htmlspecialchars($fileName);
  804. } else {
  805. $out .= $splitString.htmlspecialchars($fileName);
  806. }
  807. }
  808. }
  809. }
  810. if ($fieldSetup['type'] == 'multiple') {
  811. foreach ($fieldSetup['items'] as $key => $val) {
  812. if (substr($val[0], 0, 4) == 'LLL:') {
  813. $value = $GLOBALS['LANG']->sL($val[0]);
  814. } else {
  815. $value = $val[0];
  816. }
  817. if (t3lib_div::inList($fV, $val[1]) || $fV == $val[1]) {
  818. if (!$out) {
  819. $out = htmlspecialchars($value);
  820. } else {
  821. $out .= $splitString.htmlspecialchars($value);
  822. }
  823. }
  824. }
  825. }
  826. if ($fieldSetup['type'] == 'binary') {
  827. foreach($fieldSetup['items'] as $Key => $val) {
  828. if (substr($val[0], 0, 4) == 'LLL:') {
  829. $value = $GLOBALS['LANG']->sL($val[0]);
  830. } else {
  831. $value = $val[0];
  832. }
  833. if (!$out) {
  834. $out = htmlspecialchars($value);
  835. } else {
  836. $out .= $splitString.htmlspecialchars($value);
  837. }
  838. }
  839. }
  840. if ($fieldSetup['type']=='relation') {
  841. if ($fieldSetup['items']) {
  842. foreach($fieldSetup['items'] as $key => $val) {
  843. if (substr($val[0], 0, 4) == 'LLL:') {
  844. $value = $GLOBALS['LANG']->sL($val[0]);
  845. } else {
  846. $value = $val[0];
  847. }
  848. if (t3lib_div::inList($fV, $value) || $fV == $value) {
  849. if (!$out) {
  850. $out = htmlspecialchars($value);
  851. } else {
  852. $out .= $splitString.htmlspecialchars($value);
  853. }
  854. }
  855. }
  856. }
  857. global $TCA;
  858. if (stristr($fieldSetup['allowed'], ',')) {
  859. $from_table_Arr = explode(',', $fieldSetup['allowed']);
  860. $useTablePrefix = 1;
  861. if (!$fieldSetup['prepend_tname']) {
  862. $checkres = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fN, $table, 'uid '.t3lib_BEfunc::deleteClause($table), $groupBy = '', $orderBy = '', $limit = '');
  863. if ($checkres) {
  864. while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($checkres)) {
  865. if (stristr($row[$fN], ',')) {
  866. $checkContent = explode(',', $row[$fN]);
  867. foreach($checkContent as $singleValue) {
  868. if (!stristr($singleValue, '_')) {
  869. $dontPrefixFirstTable = 1;
  870. }
  871. }
  872. } else {
  873. $singleValue = $row[$fN];
  874. if (strlen($singleValue) && !stristr($singleValue, '_')) {
  875. $dontPrefixFirstTable = 1;
  876. }
  877. }
  878. }
  879. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  880. }
  881. }
  882. } else {
  883. $from_table_Arr[0] = $fieldSetup['allowed'];
  884. }
  885. if ($fieldSetup['prepend_tname']) {
  886. $useTablePrefix = 1;
  887. }
  888. if ($fieldSetup['foreign_table']) {
  889. $from_table_Arr[0] = $fieldSetup['foreign_table'];
  890. }
  891. $counter = 0;
  892. foreach($from_table_Arr as $from_table) {
  893. if (($useTablePrefix && !$dontPrefixFirstTable && $counter != 1) || $counter == 1) {
  894. $tablePrefix = $from_table.'_';
  895. }
  896. $counter = 1;
  897. if (is_array($TCA[$from_table])) {
  898. t3lib_div::loadTCA($from_table);
  899. $labelField = $TCA[$from_table]['ctrl']['label'];
  900. $altLabelField = $TCA[$from_table]['ctrl']['label_alt'];
  901. if ($TCA[$from_table]['columns'][$labelField]['config']['items']) {
  902. reset($TCA[$from_table]['columns'][$labelField]['config']['items']);
  903. while (list(, $labelArray) = each($TCA[$from_table]['columns'][$labelField]['config']['items'])) {
  904. if (substr($labelArray[0], 0, 4) == 'LLL:') {
  905. $labelFieldSelect[$labelArray[1]] = $GLOBALS['LANG']->sL($labelArray[0]);
  906. } else {
  907. $labelFieldSelect[$labelArray[1]] = $labelArray[0];
  908. }
  909. }
  910. $useSelectLabels = 1;
  911. }
  912. if ($TCA[$from_table]['columns'][$altLabelField]['config']['items']) {
  913. reset($TCA[$from_table]['columns'][$altLabelField]['config']['items']);
  914. foreach($TCA[$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
  915. if (substr($altLabelArray[0], 0, 4) == 'LLL:') {
  916. $altLabelFieldSelect[$altLabelArray[1]] = $GLOBALS['LANG']->sL($altLabelArray[0]);
  917. } else {
  918. $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0];
  919. }
  920. }
  921. $useAltSelectLabels = 1;
  922. }
  923. $altLabelFieldSelect = $altLabelField ? ','.$altLabelField : '';
  924. $select_fields = 'uid,'.$labelField.$altLabelFieldSelect;
  925. if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
  926. $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
  927. $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
  928. foreach($webMounts as $key => $val) {
  929. if ($webMountPageTree) {
  930. $webMountPageTreePrefix = ',';
  931. }
  932. $webMountPageTree .= $webMountPageTreePrefix.$this->getTreeList($val, 999, $begin = 0, $perms_clause);
  933. }
  934. if ($from_table == 'pages') {
  935. $where_clause = 'uid IN ('.$webMountPageTree.') '.t3lib_BEfunc::deleteClause($from_table).' AND '.$perms_clause;
  936. } else {
  937. $where_clause = 'pid IN ('.$webMountPageTree.') '.t3lib_BEfunc::deleteClause($from_table);
  938. }
  939. } else {
  940. $where_clause = 'uid'.t3lib_BEfunc::deleteClause($from_table);
  941. }
  942. $orderBy = 'uid';
  943. if (!$this->tableArray[$from_table]) {
  944. $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy, $limit = '');
  945. $this->tableArray[$from_table] = array();
  946. }
  947. if ($res) {
  948. while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
  949. $this->tableArray[$from_table][] = $row;
  950. }
  951. $GLOBALS['TYPO3_DB']->sql_free_result($res);
  952. }
  953. reset($this->tableArray[$from_table]);
  954. foreach ($this->tableArray[$from_table] as $key => $val) {
  955. $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] = $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] == 1 ? 'on' :
  956. $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'];
  957. $prefixString = $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] == 'on' ? '' : ' ['.$tablePrefix.$val['uid'].'] ';
  958. if (t3lib_div::inList($fV, $tablePrefix.$val['uid']) || $fV == $tablePrefix.$val['uid']) {
  959. if ($useSelectLabels) {
  960. if (!$out) {
  961. $out = htmlspecialchars($prefixString.$labelFieldSelect[$val[$labelField]]);
  962. } else {
  963. $out .= $splitString.htmlspecialchars($prefixString.$labelFieldSelect[$val[$labelField]]);
  964. }
  965. } elseif ($val[$labelField]) {
  966. if (!$out) {
  967. $out = htmlspecialchars($prefixString.$val[$labelField]);
  968. } else {
  969. $out .= $splitString.htmlspecialchars($prefixString.$val[$labelField]);
  970. }
  971. } elseif ($useAltSelectLabels) {
  972. if (!$out) {
  973. $out = htmlspecialchars($prefixString.$altLabelFieldSelect[$val[$altLabelField]]);
  974. } else {
  975. $out .= $splitString.htmlspecialchars($prefixString.$altLabelFieldSelect[$val[$altLabelField]]);
  976. }
  977. } else {
  978. if (!$out) {
  979. $out = htmlspecialchars($prefixString.$val[$altLabelField]);
  980. } else {
  981. $out .= $splitString.htmlspecialchars($prefixString.$val[$altLabelField]);
  982. }
  983. }
  984. }
  985. }
  986. }
  987. }
  988. }
  989. return $out;
  990. }
  991. /**
  992. * Render table header
  993. *
  994. * @param array row: Table columns
  995. * @param array conf: Table TCA
  996. * @param string table: Table name
  997. * @return string HTML of table header
  998. */
  999. function resultRowTitles($row, $conf, $table) {
  1000. $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
  1001. $tableHeader = array();
  1002. // Start header row
  1003. $tableHeader[] = '<thead><tr class="bgColor5">';
  1004. // Iterate over given columns
  1005. foreach ($row as $fieldName => $fieldValue) {
  1006. if (t3lib_div::inList($SET['queryFields'], $fieldName) || (!$SET['queryFields'] && $fieldName != 'pid' && $fieldName != 'deleted')) {
  1007. $THparams = (strlen($fieldValue) < 50) ? ' style="white-space:nowrap;"' : '';
  1008. if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
  1009. $title = $GLOBALS['LANG']->sL($conf['columns'][$fieldName]['label'] ? $conf['columns'][$fieldName]['label'] : $fieldName, 1);
  1010. } else {
  1011. $title = $GLOBALS['LANG']->sL($fieldName, 1);
  1012. }
  1013. $tableHeader[] = '<th' . $THparams . '>' . $title . '</th>';
  1014. }
  1015. }
  1016. // Add empty icon column
  1017. $tableHeader[] = '<th style="white-space:nowrap;"></th>';
  1018. // Close header row
  1019. $tableHeader[] = '</tr></thead>';
  1020. return implode($tableHeader, LF);
  1021. }
  1022. /**
  1023. * [Describe function...]
  1024. *
  1025. * @param [type] $row: ...
  1026. * @param [type] $conf: ...
  1027. * @param [type] $table: ...
  1028. * @return [type] ...
  1029. */
  1030. function csvRowTitles($row, $conf, $table) {
  1031. $SET = $GLOBALS['SOBE']->MOD_SETTINGS;
  1032. foreach ($row as $fN => $fV) {
  1033. if (t3lib_div::inList($SET['queryFields'], $fN) || (!$SET['queryFields'] && $fN!='pid')) {
  1034. if (!$out) {
  1035. if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
  1036. $out = $GLOBALS['LANG']->sL($conf['columns'][$fN]['label']?$conf['columns'][$fN]['label']:$fN, 1);
  1037. } else {
  1038. $out = $GLOBALS['LANG']->sL($fN, 1);
  1039. }
  1040. } else {
  1041. if ($GLOBALS['SOBE']->MOD_SETTINGS['search_result_labels']) {
  1042. $out.= ','.$GLOBALS['LANG']->sL($conf['columns'][$fN]['label']?$conf['columns'][$fN]['label']:$fN, 1);
  1043. } else {
  1044. $out.= ','.$GLOBALS['LANG']->sL($fN, 1);
  1045. }
  1046. }
  1047. }
  1048. }
  1049. return $out;
  1050. }
  1051. /**
  1052. * Sets the current name of the input form.
  1053. *
  1054. * @param string $formName: The name of the form.
  1055. * @return void
  1056. */
  1057. public function setFormName($formName) {
  1058. $this->formName = trim($formName);
  1059. }
  1060. }
  1061. if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']) {
  1062. include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']);
  1063. }
  1064. ?>