[BUGFIX] Missing initialization of variables
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_querygenerator.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2001-2011 Christian Jul Jensen (christian@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 for generating front end for building queries
29 *
30 * $Id$
31 *
32 * @author Christian Jul Jensen <christian@typo3.com>
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 * @coauthor Jo Hasenau <info@cybercraft.de>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 98: class t3lib_queryGenerator
42 * 245: function makeFieldList()
43 * 273: function init($name,$table,$fieldList='')
44 * 410: function setAndCleanUpExternalLists($name,$list,$force='')
45 * 426: function procesData($qC='')
46 * 529: function cleanUpQueryConfig($queryConfig)
47 * 586: function getFormElements($subLevel=0,$queryConfig='',$parent='')
48 * 744: function makeOptionList($fN, $conf, $table)
49 * 953: function printCodeArray($codeArr,$l=0)
50 * 976: function formatQ($str)
51 * 989: function mkOperatorSelect($name,$op,$draw,$submit)
52 * 1011: function mkTypeSelect($name,$fieldName,$prepend='FIELD_')
53 * 1032: function verifyType($fieldName)
54 * 1049: function verifyComparison($comparison,$neg)
55 * 1068: function mkFieldToInputSelect($name,$fieldName)
56 * 1091: function mkTableSelect($name,$cur)
57 * 1113: function mkCompSelect($name,$comparison,$neg)
58 * 1131: function getSubscript($arr)
59 * 1146: function initUserDef()
60 * 1155: function userDef()
61 * 1164: function userDefCleanUp($queryConfig)
62 * 1175: function getQuery ($queryConfig,$pad='')
63 * 1205: function getQuerySingle($conf,$first)
64 * 1245: function cleanInputVal($conf,$suffix='')
65 * 1270: function getUserDefQuery ($qcArr)
66 * 1278: function updateIcon()
67 * 1287: function getLabelCol()
68 * 1299: function makeSelectorTable($modSettings,$enableList='table,fields,query,group,order,limit')
69 * 1431: function getTreeList($id, $depth, $begin=0, $perms_clause)
70 * 1465: function getSelectQuery($qString = '', $fN = '')
71 * 1504: function JSbottom($formname='forms[0]')
72 * 1510: function typo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue)
73 * 1528: function typo3FormFieldGet(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off)
74 *
75 * TOTAL FUNCTIONS: 32
76 * (This index is automatically created/updated by the extension "extdeveval")
77 *
78 */
79
80
81 /**
82 * Class for generating front end for building queries
83 *
84 * @author Christian Jul Jensen <christian@typo3.com>
85 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
86 * @package TYPO3
87 * @subpackage t3lib
88 */
89 class t3lib_queryGenerator {
90 var $lang = array(
91 'OR' => 'or',
92 'AND' => 'and',
93 'comparison' => array(
94 // Type = text offset = 0
95 '0_' => 'contains',
96 '1_' => 'does not contain',
97 '2_' => 'starts with',
98 '3_' => 'does not start with',
99 '4_' => 'ends with',
100 '5_' => 'does not end with',
101 '6_' => 'equals',
102 '7_' => 'does not equal',
103 // Type = number , offset = 32
104 '32_' => 'equals',
105 '33_' => 'does not equal',
106 '34_' => 'is greater than',
107 '35_' => 'is less than',
108 '36_' => 'is between',
109 '37_' => 'is not between',
110 '38_' => 'is in list',
111 '39_' => 'is not in list',
112 '40_' => 'binary AND equals',
113 '41_' => 'binary AND does not equal',
114 '42_' => 'binary OR equals',
115 '43_' => 'binary OR does not equal',
116 // Type = multiple, relation, files , offset = 64
117 '64_' => 'equals',
118 '65_' => 'does not equal',
119 '66_' => 'contains',
120 '67_' => 'does not contain',
121 '68_' => 'is in list',
122 '69_' => 'is not in list',
123 '70_' => 'binary AND equals',
124 '71_' => 'binary AND does not equal',
125 '72_' => 'binary OR equals',
126 '73_' => 'binary OR does not equal',
127 // Type = date,time offset = 96
128 '96_' => 'equals',
129 '97_' => 'does not equal',
130 '98_' => 'is greater than',
131 '99_' => 'is less than',
132 '100_' => 'is between',
133 '101_' => 'is not between',
134 '102_' => 'binary AND equals',
135 '103_' => 'binary AND does not equal',
136 '104_' => 'binary OR equals',
137 '105_' => 'binary OR does not equal',
138 // Type = boolean, offset = 128
139 '128_' => 'is True',
140 '129_' => 'is False',
141 // Type = binary , offset = 160
142 '160_' => 'equals',
143 '161_' => 'does not equal',
144 '162_' => 'contains',
145 '163_' => 'does not contain'
146 )
147 );
148
149 var $compSQL = array(
150 // Type = text offset = 0
151 '0' => "#FIELD# LIKE '%#VALUE#%'",
152 '1' => "#FIELD# NOT LIKE '%#VALUE#%'",
153 '2' => "#FIELD# LIKE '#VALUE#%'",
154 '3' => "#FIELD# NOT LIKE '#VALUE#%'",
155 '4' => "#FIELD# LIKE '%#VALUE#'",
156 '5' => "#FIELD# NOT LIKE '%#VALUE#'",
157 '6' => "#FIELD# = '#VALUE#'",
158 '7' => "#FIELD# != '#VALUE#'",
159 // Type = number, offset = 32
160 '32' => "#FIELD# = '#VALUE#'",
161 '33' => "#FIELD# != '#VALUE#'",
162 '34' => '#FIELD# > #VALUE#',
163 '35' => '#FIELD# < #VALUE#',
164 '36' => '#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#',
165 '37' => 'NOT (#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#)',
166 '38' => '#FIELD# IN (#VALUE#)',
167 '39' => '#FIELD# NOT IN (#VALUE#)',
168 '40' => '(#FIELD# & #VALUE#)=#VALUE#',
169 '41' => '(#FIELD# & #VALUE#)!=#VALUE#',
170 '42' => '(#FIELD# | #VALUE#)=#VALUE#',
171 '43' => '(#FIELD# | #VALUE#)!=#VALUE#',
172 // Type = multiple, relation, files , offset = 64
173 '64' => "#FIELD# = '#VALUE#'",
174 '65' => "#FIELD# != '#VALUE#'",
175 '66' => "#FIELD# LIKE '%#VALUE#%' AND #FIELD# LIKE '%#VALUE1#%'",
176 '67' => "(#FIELD# NOT LIKE '%#VALUE#%' OR #FIELD# NOT LIKE '%#VALUE1#%')",
177 '68' => '#FIELD# IN (#VALUE#)',
178 '69' => '#FIELD# NOT IN (#VALUE#)',
179 '70' => '(#FIELD# & #VALUE#)=#VALUE#',
180 '71' => '(#FIELD# & #VALUE#)!=#VALUE#',
181 '72' => '(#FIELD# | #VALUE#)=#VALUE#',
182 '73' => '(#FIELD# | #VALUE#)!=#VALUE#',
183 // Type = date, offset = 32
184 '96' => "#FIELD# = '#VALUE#'",
185 '97' => "#FIELD# != '#VALUE#'",
186 '98' => '#FIELD# > #VALUE#',
187 '99' => '#FIELD# < #VALUE#',
188 '100' => '#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#',
189 '101' => 'NOT (#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#)',
190 '102' => '(#FIELD# & #VALUE#)=#VALUE#',
191 '103' => '(#FIELD# & #VALUE#)!=#VALUE#',
192 '104' => '(#FIELD# | #VALUE#)=#VALUE#',
193 '105' => '(#FIELD# | #VALUE#)!=#VALUE#',
194 // Type = boolean, offset = 128
195 '128' => "#FIELD# = '1'",
196 '129' => "#FIELD# != '1'",
197 // Type = binary = 160
198 '160' => "#FIELD# = '#VALUE#'",
199 '161' => "#FIELD# != '#VALUE#'",
200 '162' => '(#FIELD# & #VALUE#)=#VALUE#',
201 '163' => '(#FIELD# & #VALUE#)=0'
202 );
203
204 var $comp_offsets = array(
205 'text' => 0,
206 'number' => 1,
207 'multiple' => 2,
208 'relation' => 2,
209 'files' => 2,
210 'date' => 3,
211 'time' => 3,
212 'boolean' => 4,
213 'binary' => 5
214 );
215 var $noWrap = ' nowrap';
216
217 var $name; // Form data name prefix
218 var $table; // table for the query
219 var $fieldList; // field list
220 var $fields = array(); // Array of the fields possible
221 var $extFieldLists = array();
222 var $queryConfig = array(); // The query config
223 var $enablePrefix = 0;
224 var $enableQueryParts = 0;
225 var $extJSCODE = '';
226
227 protected $formName = '';
228
229
230 /**
231 * @return [type] ...
232 */
233 function makeFieldList() {
234 global $TCA;
235 $fieldListArr = array();
236 if (is_array($TCA[$this->table])) {
237 t3lib_div::loadTCA($this->table);
238 foreach ($TCA[$this->table]['columns'] as $fN => $value) {
239 $fieldListArr[] = $fN;
240 }
241 $fieldListArr[] = 'uid';
242 $fieldListArr[] = 'pid';
243 $fieldListArr[] = 'deleted';
244 if ($TCA[$this->table]['ctrl']['tstamp']) {
245 $fieldListArr[] = $TCA[$this->table]['ctrl']['tstamp'];
246 }
247 if ($TCA[$this->table]['ctrl']['crdate']) {
248 $fieldListArr[] = $TCA[$this->table]['ctrl']['crdate'];
249 }
250 if ($TCA[$this->table]['ctrl']['cruser_id']) {
251 $fieldListArr[] = $TCA[$this->table]['ctrl']['cruser_id'];
252 }
253 if ($TCA[$this->table]['ctrl']['sortby']) {
254 $fieldListArr[] = $TCA[$this->table]['ctrl']['sortby'];
255 }
256 }
257 return implode(',', $fieldListArr);
258 }
259
260 /**
261 * [Describe function...]
262 *
263 * @param [type] $name: ...
264 * @param [type] $table: ...
265 * @param [type] $fieldList: ...
266 * @return [type] ...
267 */
268 function init($name, $table, $fieldList = '') {
269 global $TCA;
270
271 // Analysing the fields in the table.
272 if (is_array($TCA[$table])) {
273 t3lib_div::loadTCA($table);
274 $this->name = $name;
275 $this->table = $table;
276 $this->fieldList = $fieldList ? $fieldList : $this->makeFieldList();
277
278 $fieldArr = t3lib_div::trimExplode(',', $this->fieldList, 1);
279 foreach ($fieldArr as $fN) {
280 $fC = $TCA[$this->table]['columns'][$fN];
281 $this->fields[$fN] = $fC['config'];
282 $this->fields[$fN]['exclude'] = $fC['exclude'];
283 if (is_array($fC) && $fC['label']) {
284 $this->fields[$fN]['label'] = rtrim(trim($GLOBALS['LANG']->sL($fC['label'])), ':');
285 switch ($this->fields[$fN]['type']) {
286 case 'input':
287 if (preg_match('/int|year/i', $this->fields[$fN]['eval'])) {
288 $this->fields[$fN]['type'] = 'number';
289 } elseif (preg_match('/time/i', $this->fields[$fN]['eval'])) {
290 $this->fields[$fN]['type'] = 'time';
291 } elseif (preg_match('/date/i', $this->fields[$fN]['eval'])) {
292 $this->fields[$fN]['type'] = 'date';
293 } else {
294 $this->fields[$fN]['type'] = 'text';
295 }
296 break;
297 case 'check':
298 if (!$this->fields[$fN]['items']) {
299 $this->fields[$fN]['type'] = 'boolean';
300 } else {
301 $this->fields[$fN]['type'] = 'binary';
302 }
303 break;
304 case 'radio':
305 $this->fields[$fN]['type'] = 'multiple';
306 break;
307 case 'select':
308 $this->fields[$fN]['type'] = 'multiple';
309 if ($this->fields[$fN]['foreign_table']) {
310 $this->fields[$fN]['type'] = 'relation';
311 }
312 if ($this->fields[$fN]['special']) {
313 $this->fields[$fN]['type'] = 'text';
314 }
315 break;
316 case 'group':
317 $this->fields[$fN]['type'] = 'files';
318 if ($this->fields[$fN]['internal_type'] == 'db') {
319 $this->fields[$fN]['type'] = 'relation';
320 }
321 break;
322 case 'user':
323 case 'flex':
324 case 'passthrough':
325 case 'none':
326 case 'text':
327 default:
328 $this->fields[$fN]['type'] = 'text';
329 break;
330 }
331
332 } else {
333 $this->fields[$fN]['label'] = '[FIELD: ' . $fN . ']';
334 switch ($fN) {
335 case 'pid':
336 $this->fields[$fN]['type'] = 'relation';
337 $this->fields[$fN]['allowed'] = 'pages';
338 break;
339 case 'cruser_id':
340 $this->fields[$fN]['type'] = 'relation';
341 $this->fields[$fN]['allowed'] = 'be_users';
342 break;
343 case 'tstamp':
344 case 'crdate':
345 $this->fields[$fN]['type'] = 'time';
346 break;
347 case 'deleted':
348 $this->fields[$fN]['type'] = 'boolean';
349 break;
350 default:
351 $this->fields[$fN]['type'] = 'number';
352 break;
353 }
354 }
355 }
356 }
357
358 /* // EXAMPLE:
359 $this->queryConfig = array(
360 array(
361 'operator' => 'AND',
362 'type' => 'FIELD_spaceBefore',
363 ),
364 array(
365 'operator' => 'AND',
366 'type' => 'FIELD_records',
367 'negate' => 1,
368 'inputValue' => 'foo foo'
369 ),
370 array(
371 'type' => 'newlevel',
372 'nl' => array(
373 array(
374 'operator' => 'AND',
375 'type' => 'FIELD_spaceBefore',
376 'negate' => 1,
377 'inputValue' => 'foo foo'
378 ),
379 array(
380 'operator' => 'AND',
381 'type' => 'FIELD_records',
382 'negate' => 1,
383 'inputValue' => 'foo foo'
384 )
385 )
386 ),
387 array(
388 'operator' => 'OR',
389 'type' => 'FIELD_maillist',
390 )
391 );
392 */
393 $this->initUserDef();
394 }
395
396 /**
397 * [Describe function...]
398 *
399 * @param [type] $name: ...
400 * @param [type] $list: ...
401 * @param [type] $force: ...
402 * @return [type] ...
403 */
404 function setAndCleanUpExternalLists($name, $list, $force = '') {
405 $fields = array_unique(t3lib_div::trimExplode(',', $list . ',' . $force, 1));
406 $reList = array();
407 foreach ($fields as $fN) {
408 if ($this->fields[$fN]) {
409 $reList[] = $fN;
410 }
411 }
412 $this->extFieldLists[$name] = implode(',', $reList);
413 }
414
415 /**
416 * [Describe function...]
417 *
418 * @param [type] $qC: ...
419 * @return [type] ...
420 */
421 function procesData($qC = '') {
422 $this->queryConfig = $qC;
423
424 $POST = t3lib_div::_POST();
425
426 // if delete...
427 if ($POST['qG_del']) {
428 //initialize array to work on, save special parameters
429 $ssArr = $this->getSubscript($POST['qG_del']);
430 $workArr =& $this->queryConfig;
431 for ($i = 0; $i < sizeof($ssArr) - 1; $i++) {
432 $workArr =& $workArr[$ssArr[$i]];
433 }
434 // delete the entry and move the other entries
435 unset($workArr[$ssArr[$i]]);
436 for ($j = $ssArr[$i]; $j < sizeof($workArr); $j++) {
437 $workArr[$j] = $workArr[$j + 1];
438 unset($workArr[$j + 1]);
439 }
440 }
441
442 // if insert...
443 if ($POST['qG_ins']) {
444 //initialize array to work on, save special parameters
445 $ssArr = $this->getSubscript($POST['qG_ins']);
446 $workArr =& $this->queryConfig;
447 for ($i = 0; $i < sizeof($ssArr) - 1; $i++) {
448 $workArr =& $workArr[$ssArr[$i]];
449 }
450 // move all entries above position where new entry is to be inserted
451 for ($j = sizeof($workArr); $j > $ssArr[$i]; $j--) {
452 $workArr[$j] = $workArr[$j - 1];
453 }
454 //clear new entry position
455 unset($workArr[$ssArr[$i] + 1]);
456 $workArr[$ssArr[$i] + 1]['type'] = 'FIELD_';
457 }
458
459 // if move up...
460 if ($POST['qG_up']) {
461 //initialize array to work on
462 $ssArr = $this->getSubscript($POST['qG_up']);
463 $workArr =& $this->queryConfig;
464 for ($i = 0; $i < sizeof($ssArr) - 1; $i++) {
465 $workArr =& $workArr[$ssArr[$i]];
466 }
467 //swap entries
468 $qG_tmp = $workArr[$ssArr[$i]];
469 $workArr[$ssArr[$i]] = $workArr[$ssArr[$i] - 1];
470 $workArr[$ssArr[$i] - 1] = $qG_tmp;
471 }
472
473 // if new level...
474 if ($POST['qG_nl']) {
475 //initialize array to work on
476 $ssArr = $this->getSubscript($POST['qG_nl']);
477 $workArr =& $this->queryConfig;
478 for ($i = 0; $i < sizeof($ssArr) - 1; $i++) {
479 $workArr =& $workArr[$ssArr[$i]];
480 }
481 // Do stuff:
482 $tempEl = $workArr[$ssArr[$i]];
483 if (is_array($tempEl)) {
484 if ($tempEl['type'] != 'newlevel') {
485 $workArr[$ssArr[$i]] = array(
486 'type' => 'newlevel',
487 'operator' => $tempEl['operator'],
488 'nl' => array($tempEl)
489 );
490 }
491 }
492 }
493
494 // if collapse level...
495 if ($POST['qG_remnl']) {
496 //initialize array to work on
497 $ssArr = $this->getSubscript($POST['qG_remnl']);
498 $workArr =& $this->queryConfig;
499 for ($i = 0; $i < sizeof($ssArr) - 1; $i++) {
500 $workArr =& $workArr[$ssArr[$i]];
501 }
502
503 // Do stuff:
504 $tempEl = $workArr[$ssArr[$i]];
505 if (is_array($tempEl)) {
506 if ($tempEl['type'] == 'newlevel') {
507 $a1 = array_slice($workArr, 0, $ssArr[$i]);
508 $a2 = array_slice($workArr, $ssArr[$i]);
509 array_shift($a2);
510 $a3 = $tempEl['nl'];
511 $a3[0]['operator'] = $tempEl['operator'];
512 $workArr = array_merge($a1, $a3, $a2);
513 }
514 }
515 }
516 }
517
518 /**
519 * [Describe function...]
520 *
521 * @param [type] $queryConfig: ...
522 * @return [type] ...
523 */
524 function cleanUpQueryConfig($queryConfig) {
525 //since we dont traverse the array using numeric keys in the upcoming whileloop make sure it's fresh and clean before displaying
526 if (is_array($queryConfig)) {
527 ksort($queryConfig);
528 } else {
529 //queryConfig should never be empty!
530 if (!$queryConfig[0] || !$queryConfig[0]['type']) {
531 $queryConfig[0] = array('type' => 'FIELD_');
532 }
533 }
534 // Traverse:
535 $c = 0;
536 $arrCount = 0;
537 foreach ($queryConfig as $key => $conf) {
538 if (substr($conf['type'], 0, 6) == 'FIELD_') {
539 $fName = substr($conf['type'], 6);
540 $fType = $this->fields[$fName]['type'];
541 } elseif ($conf['type'] == 'newlevel') {
542 $fType = $conf['type'];
543 } else {
544 $fType = 'ignore';
545 }
546 // debug($fType);
547 switch ($fType) {
548 case 'newlevel':
549 if (!$queryConfig[$key]['nl']) {
550 $queryConfig[$key]['nl'][0]['type'] = 'FIELD_';
551 }
552 $queryConfig[$key]['nl'] = $this->cleanUpQueryConfig($queryConfig[$key]['nl']);
553 break;
554 case 'userdef':
555 $queryConfig[$key] = $this->userDefCleanUp($queryConfig[$key]);
556 break;
557 case 'ignore':
558 default:
559 // debug($queryConfig[$key]);
560 $verifiedName = $this->verifyType($fName);
561 $queryConfig[$key]['type'] = 'FIELD_' . $this->verifyType($verifiedName);
562
563 if ($conf['comparison'] >> 5 != $this->comp_offsets[$fType]) {
564 $conf['comparison'] = $this->comp_offsets[$fType] << 5;
565 }
566 $queryConfig[$key]['comparison'] = $this->verifyComparison($conf['comparison'], $conf['negate'] ? 1 : 0);
567
568 $queryConfig[$key]['inputValue'] = $this->cleanInputVal($queryConfig[$key]);
569 $queryConfig[$key]['inputValue1'] = $this->cleanInputVal($queryConfig[$key], 1);
570
571 // debug($queryConfig[$key]);
572 break;
573 }
574 }
575 return $queryConfig;
576 }
577
578 /**
579 * [Describe function...]
580 *
581 * @param [type] $subLevel: ...
582 * @param [type] $queryConfig: ...
583 * @param [type] $parent: ...
584 * @return [type] ...
585 */
586 function getFormElements($subLevel = 0, $queryConfig = '', $parent = '') {
587 $codeArr = array();
588 if (!is_array($queryConfig)) {
589 $queryConfig = $this->queryConfig;
590 }
591
592 $c = 0;
593 $arrCount = 0;
594 $loopcount = 0;
595 foreach ($queryConfig as $key => $conf) {
596 $subscript = $parent . '[' . $key . ']';
597 $lineHTML = '';
598 $lineHTML .= $this->mkOperatorSelect($this->name . $subscript, $conf['operator'], $c, ($conf['type'] != 'FIELD_'));
599 if (substr($conf['type'], 0, 6) == 'FIELD_') {
600 $fName = substr($conf['type'], 6);
601 $this->fieldName = $fName;
602 $fType = $this->fields[$fName]['type'];
603 if ($conf['comparison'] >> 5 != $this->comp_offsets[$fType]) {
604 $conf['comparison'] = $this->comp_offsets[$fType] << 5;
605 }
606
607 //nasty nasty...
608 //make sure queryConfig contains _actual_ comparevalue.
609 //mkCompSelect don't care, but getQuery does.
610 $queryConfig[$key]['comparison'] += (isset($conf['negate']) - ($conf['comparison'] % 2));
611
612 } elseif ($conf['type'] == 'newlevel') {
613 $fType = $conf['type'];
614 } else {
615 $fType = 'ignore';
616 }
617 switch ($fType) {
618 case 'ignore':
619 break;
620 case 'newlevel':
621 if (!$queryConfig[$key]['nl']) {
622 $queryConfig[$key]['nl'][0]['type'] = 'FIELD_';
623 }
624 $lineHTML .= '<input type="hidden" name="' . $this->name . $subscript . '[type]" value="newlevel">';
625 $codeArr[$arrCount]['sub'] = $this->getFormElements($subLevel + 1, $queryConfig[$key]['nl'], $subscript . '[nl]');
626 break;
627 case 'userdef':
628 $lineHTML .= $this->userDef($this->name . $subscript, $conf, $fName, $fType);
629 break;
630 case 'date':
631 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
632 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
633 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
634
635 if ($conf['comparison'] == 100 || $conf['comparison'] == 101) { // between
636 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue]_hr' . '" value="' . strftime('%e-%m-%Y', $conf['inputValue']) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue]\', \'date\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '">';
637 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue1]_hr' . '" value="' . strftime('%e-%m-%Y', $conf['inputValue1']) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue1]\', \'date\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $this->name . $subscript . '[inputValue1]' . '">';
638 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue]", "date", "", 0,0);';
639 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue1]", "date", "", 0,0);';
640 } else {
641 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue]_hr' . '" value="' . strftime('%e-%m-%Y', $conf['inputValue']) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue]\', \'date\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '">';
642 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue]", "date", "", 0,0);';
643 }
644 break;
645 case 'time':
646 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
647 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
648
649 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
650 if ($conf['comparison'] == 100 || $conf['comparison'] == 101) { // between:
651 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue]_hr' . '" value="' . strftime('%H:%M %e-%m-%Y', $conf['inputValue']) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue]\', \'datetime\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '">';
652 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue1]_hr' . '" value="' . strftime('%H:%M %e-%m-%Y', $conf['inputValue1']) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue1]\', \'datetime\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $this->name . $subscript . '[inputValue1]' . '">';
653 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue]", "datetime", "", 0,0);';
654 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue1]", "datetime", "", 0,0);';
655 } else {
656 $lineHTML .= '<input type="text" name="' . $this->name . $subscript . '[inputValue]_hr' . '" value="' . strftime('%H:%M %e-%m-%Y', intval($conf['inputValue'])) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . ' onChange="typo3form.fieldGet(\'' . $this->name . $subscript . '[inputValue]\', \'datetime\', \'\', 0,0);"><input type="hidden" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '">';
657 $this->extJSCODE .= 'typo3form.fieldSet("' . $this->name . $subscript . '[inputValue]", "datetime", "", 0,0);';
658 }
659 break;
660 case 'multiple':
661 case 'binary':
662 case 'relation':
663 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
664 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
665 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
666 if ($conf['comparison'] == 68 || $conf['comparison'] == 69 || $conf['comparison'] == 162 || $conf['comparison'] == 163) {
667 $lineHTML .= '<select name="' . $this->name . $subscript . '[inputValue]' . '[]" style="vertical-align:top;" size="5" multiple>';
668 } elseif ($conf['comparison'] == 66 || $conf['comparison'] == 67) {
669 if (is_array($conf['inputValue'])) {
670 $conf['inputValue'] = implode(',', $conf['inputValue']);
671 }
672 $lineHTML .= '<input type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>';
673 } else {
674 $lineHTML .= '<select name="' . $this->name . $subscript . '[inputValue]' . '" style="vertical-align:top;" onChange="submit();">';
675 }
676 if ($conf['comparison'] != 66 && $conf['comparison'] != 67) {
677 $lineHTML .= $this->makeOptionList($fName, $conf, $this->table);
678 $lineHTML .= '</select>';
679 }
680 break;
681 case 'files':
682 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
683 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
684 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
685 if ($conf['comparison'] == 68 || $conf['comparison'] == 69) {
686 $lineHTML .= '<select name="' . $this->name . $subscript . '[inputValue]' . '[]" style="vertical-align:top;" size="5" multiple>';
687 } else {
688 $lineHTML .= '<select name="' . $this->name . $subscript . '[inputValue]' . '" style="vertical-align:top;" onChange="submit();">';
689 }
690 $lineHTML .= '<option value=""></option>' . $this->makeOptionList($fName, $conf, $this->table);
691 $lineHTML .= '</select>';
692 if ($conf['comparison'] == 66 || $conf['comparison'] == 67) {
693 $lineHTML .= ' + <input type="text" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $this->name . $subscript . '[inputValue1]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>';
694 }
695 break;
696 case 'boolean':
697 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
698 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
699 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
700 $lineHTML .= '<input type="hidden" value="1" name="' . $this->name . $subscript . '[inputValue]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>';
701 break;
702 default:
703 $lineHTML .= $this->mkTypeSelect($this->name . $subscript . '[type]', $fName);
704 $lineHTML .= $this->mkCompSelect($this->name . $subscript . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
705 $lineHTML .= '<input type="checkbox" class="checkbox"' . ($conf['negate'] ? ' checked' : '') . ' name="' . $this->name . $subscript . '[negate]' . '" onClick="submit();">';
706 if ($conf['comparison'] == 37 || $conf['comparison'] == 36) { // between:
707 $lineHTML .= '<input type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(5) . '>
708 <input type="text" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $this->name . $subscript . '[inputValue1]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(5) . '>'; // onChange='submit();'
709 } else {
710 $lineHTML .= '<input type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $this->name . $subscript . '[inputValue]' . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>'; // onChange="submit();"
711 }
712 break;
713 }
714 if ($fType != 'ignore') {
715 $lineHTML .= $this->updateIcon();
716 if ($loopcount) {
717 $lineHTML .= '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/garbage.gif', 'width="11" height="12"') . 'title="Remove condition" name="qG_del' . $subscript . '">';
718 }
719 $lineHTML .= '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/add.gif', 'width="12" height="12"') . ' title="Add condition" name="qG_ins' . $subscript . '">';
720 if ($c != 0) {
721 $lineHTML .= '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/pil2up.gif', 'width="12" height="7"') . ' title="Move up" name="qG_up' . $subscript . '">';
722 }
723
724 if ($c != 0 && $fType != 'newlevel') {
725 $lineHTML .= '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/pil2right.gif', 'height="12" width="7"') . ' title="New level" name="qG_nl' . $subscript . '">';
726 }
727 if ($fType == 'newlevel') {
728 $lineHTML .= '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/pil2left.gif', 'height="12" width="7"') . ' title="Collapse new level" name="qG_remnl' . $subscript . '">';
729 }
730
731 $codeArr[$arrCount]['html'] = $lineHTML;
732 $codeArr[$arrCount]['query'] = $this->getQuerySingle($conf, $c > 0 ? 0 : 1);
733 $arrCount++;
734 $c++;
735 }
736 $loopcount = 1;
737 }
738 $this->queryConfig = $queryConfig;
739
740 return $codeArr;
741 }
742
743 /**
744 * [Describe function...]
745 *
746 * @param [type] $codeArr: ...
747 * @param [type] $l: ...
748 * @param [type] $table: ...
749 * @return [type] ...
750 */
751 function makeOptionList($fN, $conf, $table) {
752 $out = '';
753 $fieldSetup = $this->fields[$fN];
754 if ($fieldSetup['type'] == 'files') {
755 if ($conf['comparison'] == 66 || $conf['comparison'] == 67) {
756 $fileExtArray = explode(',', $fieldSetup['allowed']);
757 natcasesort($fileExtArray);
758 foreach ($fileExtArray as $fileExt) {
759 if (t3lib_div::inList($conf['inputValue'], $fileExt)) {
760 $out .= '<option value="' . $fileExt . '" selected>.' . $fileExt . '</option>';
761 } else {
762 $out .= '<option value="' . $fileExt . '">.' . $fileExt . '</option>';
763 }
764 }
765 }
766 $d = dir(PATH_site . $fieldSetup['uploadfolder']);
767 while (false !== ($entry = $d->read())) {
768 if ($entry == '.' || $entry == '..') {
769 continue;
770 }
771 $fileArray[] = $entry;
772 }
773 $d->close();
774 natcasesort($fileArray);
775 foreach ($fileArray as $fileName) {
776 if (t3lib_div::inList($conf['inputValue'], $fileName)) {
777 $out .= '<option value="' . $fileName . '" selected>' . $fileName . '</option>';
778 } else {
779 $out .= '<option value="' . $fileName . '">' . $fileName . '</option>';
780 }
781 }
782 }
783 if ($fieldSetup['type'] == 'multiple') {
784 foreach ($fieldSetup['items'] as $key => $val) {
785 if (substr($val[0], 0, 4) == 'LLL:') {
786 $value = $GLOBALS['LANG']->sL($val[0]);
787 } else {
788 $value = $val[0];
789 }
790 if (t3lib_div::inList($conf['inputValue'], $val[1])) {
791 $out .= '<option value="' . $val[1] . '" selected>' . $value . '</option>';
792 } else {
793 $out .= '<option value="' . $val[1] . '">' . $value . '</option>';
794 }
795 }
796 }
797 if ($fieldSetup['type'] == 'binary') {
798 foreach ($fieldSetup['items'] as $key => $val) {
799 if (substr($val[0], 0, 4) == 'LLL:') {
800 $value = $GLOBALS['LANG']->sL($val[0]);
801 } else {
802 $value = $val[0];
803 }
804 if (t3lib_div::inList($conf['inputValue'], pow(2, $key))) {
805 $out .= '<option value="' . pow(2, $key) . '" selected>' . $value . '</option>';
806 } else {
807 $out .= '<option value="' . pow(2, $key) . '">' . $value . '</option>';
808 }
809 }
810 }
811 if ($fieldSetup['type'] == 'relation') {
812 if ($fieldSetup['items']) {
813 foreach ($fieldSetup['items'] as $key => $val) {
814 if (substr($val[0], 0, 4) == 'LLL:') {
815 $value = $GLOBALS['LANG']->sL($val[0]);
816 } else {
817 $value = $val[0];
818 }
819 if (t3lib_div::inList($conf['inputValue'], $val[1])) {
820 $out .= '<option value="' . $val[1] . '" selected>' . $value . '</option>';
821 } else {
822 $out .= '<option value="' . $val[1] . '">' . $value . '</option>';
823 }
824 }
825 }
826 global $TCA;
827 if (stristr($fieldSetup['allowed'], ',')) {
828 $from_table_Arr = explode(',', $fieldSetup['allowed']);
829 $useTablePrefix = 1;
830 if (!$fieldSetup['prepend_tname']) {
831 $checkres = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fN, $table, t3lib_BEfunc::deleteClause($table), $groupBy = '', $orderBy = '', $limit = '');
832 if ($checkres) {
833 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($checkres)) {
834 if (stristr($row[$fN], ',')) {
835 $checkContent = explode(',', $row[$fN]);
836 foreach ($checkContent as $singleValue) {
837 if (!stristr($singleValue, '_')) {
838 $dontPrefixFirstTable = 1;
839 }
840 }
841 } else {
842 $singleValue = $row[$fN];
843 if (strlen($singleValue) && !stristr($singleValue, '_')) {
844 $dontPrefixFirstTable = 1;
845 }
846 }
847 }
848 }
849 }
850 } else {
851 $from_table_Arr[0] = $fieldSetup['allowed'];
852 }
853 if ($fieldSetup['prepend_tname']) {
854 $useTablePrefix = 1;
855 }
856 if ($fieldSetup['foreign_table']) {
857 $from_table_Arr[0] = $fieldSetup['foreign_table'];
858 }
859 $counter = 0;
860 $webMountPageTree = '';
861 while (list(, $from_table) = each($from_table_Arr)) {
862 if (($useTablePrefix && !$dontPrefixFirstTable && $counter != 1) || $counter == 1) {
863 $tablePrefix = $from_table . '_';
864 }
865 $counter = 1;
866 if (is_array($TCA[$from_table])) {
867 t3lib_div::loadTCA($from_table);
868 $labelField = $TCA[$from_table]['ctrl']['label'];
869 $altLabelField = $TCA[$from_table]['ctrl']['label_alt'];
870 if ($TCA[$from_table]['columns'][$labelField]['config']['items']) {
871 foreach ($TCA[$from_table]['columns'][$labelField]['config']['items'] as $labelArray) {
872 if (substr($labelArray[0], 0, 4) == 'LLL:') {
873 $labelFieldSelect[$labelArray[1]] = $GLOBALS['LANG']->sL($labelArray[0]);
874 } else {
875 $labelFieldSelect[$labelArray[1]] = $labelArray[0];
876 }
877 }
878 $useSelectLabels = 1;
879 }
880 if ($TCA[$from_table]['columns'][$altLabelField]['config']['items']) {
881 foreach ($TCA[$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
882 if (substr($altLabelArray[0], 0, 4) == 'LLL:') {
883 $altLabelFieldSelect[$altLabelArray[1]] = $GLOBALS['LANG']->sL($altLabelArray[0]);
884 } else {
885 $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0];
886 }
887 }
888 $useAltSelectLabels = 1;
889 }
890 $altLabelFieldSelect = $altLabelField ? ',' . $altLabelField : '';
891 $select_fields = 'uid,' . $labelField . $altLabelFieldSelect;
892 if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
893 $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
894 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
895 foreach ($webMounts as $key => $val) {
896 if ($webMountPageTree) {
897 $webMountPageTreePrefix = ',';
898 }
899 $webMountPageTree .= $webMountPageTreePrefix . $this->getTreeList($val, 999, $begin = 0, $perms_clause);
900 }
901 if ($from_table == 'pages') {
902 $where_clause = 'uid IN (' . $webMountPageTree . ') ';
903 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
904 $where_clause .= t3lib_BEfunc::deleteClause($from_table) . ' AND' . $perms_clause;
905 }
906 } else {
907 $where_clause = 'pid IN (' . $webMountPageTree . ') ';
908 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
909 $where_clause .= t3lib_BEfunc::deleteClause($from_table);
910 }
911 }
912 } else {
913 $where_clause = 'uid';
914 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
915 $where_clause .= t3lib_BEfunc::deleteClause($from_table);
916 }
917 }
918 $orderBy = 'uid';
919 if (!$this->tableArray[$from_table]) {
920 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy, $limit = '');
921 }
922 if ($res) {
923 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
924 $this->tableArray[$from_table][] = $row;
925 }
926 }
927 foreach ($this->tableArray[$from_table] as $key => $val) {
928 if ($useSelectLabels) {
929 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($labelFieldSelect[$val[$labelField]]);
930 } elseif ($val[$labelField]) {
931 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($val[$labelField]);
932 } elseif ($useAltSelectLabels) {
933 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($altLabelFieldSelect[$val[$altLabelField]]);
934 } else {
935 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($val[$altLabelField]);
936 }
937 }
938 if ($GLOBALS['SOBE']->MOD_SETTINGS['options_sortlabel'] && is_array($outArray)) {
939 natcasesort($outArray);
940 }
941 }
942 }
943 foreach ($outArray as $key2 => $val2) {
944 if (t3lib_div::inList($conf['inputValue'], $key2)) {
945 $out .= '<option value="' . $key2 . '" selected>[' . $key2 . '] ' . $val2 . '</option>';
946 } else {
947 $out .= '<option value="' . $key2 . '">[' . $key2 . '] ' . $val2 . '</option>';
948 }
949 }
950 }
951 return $out;
952 }
953
954
955 /**
956 * [Describe function...]
957 *
958 * @param [type] $codeArr: ...
959 * @param [type] $l: ...
960 * @return [type] ...
961 */
962 function printCodeArray($codeArr, $l = 0) {
963 $line = '';
964 if ($l) {
965 $indent = '<td style="vertical-align:top;"><img height="1" width="50"></td>';
966 }
967 $lf = $l * 30;
968 $bgColor = t3lib_div::modifyHTMLColor($GLOBALS['TBE_TEMPLATE']->bgColor2, $lf, $lf, $lf);
969 foreach ($codeArr as $k => $v) {
970 $line .= '<tr>' . $indent . '<td bgcolor="' . $bgColor . '"' . $this->noWrap . '>' . $v['html'] . '</td></tr>';
971 if ($this->enableQueryParts) {
972 $line .= '<tr>' . $indent . '<td>' . $this->formatQ($v['query']) . '</td></tr>';
973 }
974 if (is_array($v['sub'])) {
975 $line .= '<tr>' . $indent . '<td' . $this->noWrap . '>' . $this->printCodeArray($v['sub'], $l + 1) . '</td></tr>';
976 }
977 }
978 $out = '<table border="0" cellpadding="0" cellspacing="1">' . $line . '</table>';
979 return $out;
980 }
981
982 /**
983 * [Describe function...]
984 *
985 * @param [type] $str: ...
986 * @return [type] ...
987 */
988 function formatQ($str) {
989 return '<font size="1" face="verdana" color="maroon"><i>' . htmlspecialchars($str) . '</i></font>';
990 }
991
992 /**
993 * [Describe function...]
994 *
995 * @param [type] $name: ...
996 * @param [type] $op: ...
997 * @param [type] $draw: ...
998 * @param [type] $submit: ...
999 * @return [type] ...
1000 */
1001 function mkOperatorSelect($name, $op, $draw, $submit) {
1002 if ($draw) {
1003 $out = '<select name="' . $name . '[operator]"' . ($submit ? ' onChange="submit();"' : '') . '>'; //
1004 $out .= '<option value="AND"' . (!$op || $op == "AND" ? ' selected' : '') . '>' . $this->lang["AND"] . '</option>';
1005 $out .= '<option value="OR"' . ($op == 'OR' ? ' selected' : '') . '>' . $this->lang['OR'] . '</option>';
1006 $out .= '</select>';
1007 } else {
1008 $out = '<input type="hidden" value="' . $op . '" name="' . $name . '[operator]">';
1009 $out .= '<img src="clear.gif" height="1" width="47">';
1010
1011 }
1012 return $out;
1013 }
1014
1015 /**
1016 * [Describe function...]
1017 *
1018 * @param [type] $name: ...
1019 * @param [type] $fieldName: ...
1020 * @param [type] $prepend: ...
1021 * @return [type] ...
1022 */
1023 function mkTypeSelect($name, $fieldName, $prepend = 'FIELD_') {
1024 $out = '<select name="' . $name . '" onChange="submit();">';
1025 $out .= '<option value=""></option>';
1026 foreach ($this->fields as $key => $value) {
1027 if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
1028 $label = $this->fields[$key]['label'];
1029 $label_alt = $this->fields[$key]['label_alt'];
1030 $out .= '<option value="' . $prepend . $key . '"' . ($key == $fieldName ? ' selected' : '') . '>' . $label . '</option>';
1031 }
1032 }
1033 $out .= '</select>';
1034 return $out;
1035 }
1036
1037 /**
1038 * [Describe function...]
1039 *
1040 * @param [type] $fieldName: ...
1041 * @return [type] ...
1042 */
1043 function verifyType($fieldName) {
1044 $first = '';
1045 foreach ($this->fields as $key => $value) {
1046 if (!$first) {
1047 $first = $key;
1048 }
1049 if ($key == $fieldName) {
1050 return $key;
1051 }
1052 }
1053 return $first;
1054 }
1055
1056 /**
1057 * [Describe function...]
1058 *
1059 * @param [type] $comparison: ...
1060 * @param [type] $neg: ...
1061 * @return [type] ...
1062 */
1063 function verifyComparison($comparison, $neg) {
1064 $compOffSet = $comparison >> 5;
1065 $first = -1;
1066 for ($i = 32 * $compOffSet + $neg; $i < 32 * ($compOffSet + 1); $i += 2) {
1067 if ($first == -1) {
1068 $first = $i;
1069 }
1070 if (($i >> 1) == ($comparison >> 1)) {
1071 return $i;
1072 }
1073 }
1074 return $first;
1075 }
1076
1077 /**
1078 * [Describe function...]
1079 *
1080 * @param [type] $name: ...
1081 * @param [type] $fieldName: ...
1082 * @return [type] ...
1083 */
1084 function mkFieldToInputSelect($name, $fieldName) {
1085 $out = '<input type="Text" value="' . htmlspecialchars($fieldName) . '" name="' . $name . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth() . '>' . $this->updateIcon();
1086 $out .= '<a href="#" onClick="document.forms[0][\'' . $name . '\'].value=\'\';return false;">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => 'Clear list')) . '</a>';
1087 $out .= '<BR><select name="_fieldListDummy" size="5" onChange="document.forms[0][\'' . $name . '\'].value+=\',\'+this.value">';
1088 foreach ($this->fields as $key => $value) {
1089 if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
1090 $label = $this->fields[$key]['label'];
1091 $label_alt = $this->fields[$key]['label_alt'];
1092 $out .= '<option value="' . $key . '"' . ($key == $fieldName ? ' selected' : '') . '>' . $label . '</option>';
1093 }
1094 }
1095 $out .= '</select>';
1096 return $out;
1097 }
1098
1099 /**
1100 * [Describe function...]
1101 *
1102 * @param [type] $name: ...
1103 * @param [type] $cur: ...
1104 * @return [type] ...
1105 */
1106 function mkTableSelect($name, $cur) {
1107 global $TCA;
1108 $out = '<select name="' . $name . '" onChange="submit();">';
1109 $out .= '<option value=""></option>';
1110 foreach ($TCA as $tN => $value) {
1111 if ($GLOBALS['BE_USER']->check('tables_select', $tN)) {
1112 $out .= '<option value="' . $tN . '"' . ($tN == $cur ? ' selected' : '') . '>' . $GLOBALS['LANG']->sl($TCA[$tN]['ctrl']['title']) . '</option>';
1113 }
1114 }
1115 $out .= '</select>';
1116 return $out;
1117 }
1118
1119 /**
1120 * [Describe function...]
1121 *
1122 * @param [type] $name: ...
1123 * @param [type] $comparison: ...
1124 * @param [type] $neg: ...
1125 * @return [type] ...
1126 */
1127 function mkCompSelect($name, $comparison, $neg) {
1128 $compOffSet = $comparison >> 5;
1129 $out = '<select name="' . $name . '" onChange="submit();">';
1130 for ($i = 32 * $compOffSet + $neg; $i < 32 * ($compOffSet + 1); $i += 2) {
1131 if ($this->lang['comparison'][$i . '_']) {
1132 $out .= '<option value="' . $i . '"' . (($i >> 1) == ($comparison >> 1) ? ' selected' : '') . '>' . $this->lang['comparison'][$i . '_'] . '</option>';
1133 }
1134 }
1135 $out .= '</select>';
1136 return $out;
1137 }
1138
1139 /**
1140 * [Describe function...]
1141 *
1142 * @param [type] $arr: ...
1143 * @return [type] ...
1144 */
1145 function getSubscript($arr) {
1146 while (is_array($arr)) {
1147 reset($arr);
1148 list($key,) = each($arr);
1149 $retArr[] = $key;
1150 $arr = $arr[$key];
1151 }
1152 return $retArr;
1153 }
1154
1155 /**
1156 * [Describe function...]
1157 *
1158 * @return [type] ...
1159 */
1160 function initUserDef() {
1161
1162 }
1163
1164 /**
1165 * [Describe function...]
1166 *
1167 * @return [type] ...
1168 */
1169 function userDef() {
1170 }
1171
1172 /**
1173 * [Describe function...]
1174 *
1175 * @param [type] $queryConfig: ...
1176 * @return [type] ...
1177 */
1178 function userDefCleanUp($queryConfig) {
1179 return $queryConfig;
1180 }
1181
1182 /**
1183 * [Describe function...]
1184 *
1185 * @param [type] $queryConfig: ...
1186 * @param [type] $pad: ...
1187 * @return [type] ...
1188 */
1189 function getQuery($queryConfig, $pad = '') {
1190 $qs = '';
1191 // Since we don't traverse the array using numeric keys in the upcoming whileloop make sure it's fresh and clean
1192 ksort($queryConfig);
1193 $first = 1;
1194 foreach ($queryConfig as $key => $conf) {
1195 switch ($conf['type']) {
1196 case 'newlevel':
1197 $qs .= LF . $pad . trim($conf['operator']) . ' (' . $this->getQuery($queryConfig[$key]['nl'], $pad . ' ') . LF . $pad . ')';
1198 break;
1199 case 'userdef':
1200 $qs .= LF . $pad . getUserDefQuery($conf, $first);
1201 break;
1202 default:
1203 $qs .= LF . $pad . $this->getQuerySingle($conf, $first);
1204 break;
1205 }
1206 $first = 0;
1207 }
1208 return $qs;
1209 }
1210
1211 /**
1212 * [Describe function...]
1213 *
1214 * @param [type] $conf: ...
1215 * @param [type] $first: ...
1216 * @return [type] ...
1217 */
1218 function getQuerySingle($conf, $first) {
1219 $qs = '';
1220 $prefix = $this->enablePrefix ? $this->table . '.' : '';
1221 if (!$first) {
1222 // Is it OK to insert the AND operator if none is set?
1223 $qs .= trim(($conf['operator'] ? $conf['operator'] : 'AND')) . ' ';
1224 }
1225 $qsTmp = str_replace('#FIELD#', $prefix . trim(substr($conf['type'], 6)), $this->compSQL[$conf['comparison']]);
1226 $inputVal = $this->cleanInputVal($conf);
1227 if ($conf['comparison'] == 68 || $conf['comparison'] == 69) {
1228 $inputVal = explode(',', $inputVal);
1229 foreach ($inputVal as $key => $fileName) {
1230 $inputVal[$key] = "'" . $fileName . "'";
1231 }
1232 $inputVal = implode(',', $inputVal);
1233 $qsTmp = str_replace('#VALUE#', $inputVal, $qsTmp);
1234 } elseif ($conf['comparison'] == 162 || $conf['comparison'] == 163) {
1235 $inputValArray = explode(',', $inputVal);
1236 $inputVal = 0;
1237 foreach ($inputValArray as $key => $fileName) {
1238 $inputVal += intval($fileName);
1239 }
1240 $qsTmp = str_replace('#VALUE#', $inputVal, $qsTmp);
1241 } else {
1242 $qsTmp = str_replace('#VALUE#', $GLOBALS['TYPO3_DB']->quoteStr($inputVal, $this->table), $qsTmp);
1243 }
1244 if ($conf['comparison'] == 37 || $conf['comparison'] == 36 || $conf['comparison'] == 66 || $conf['comparison'] == 67 || $conf['comparison'] == 100 || $conf['comparison'] == 101) { // between:
1245 $inputVal = $this->cleanInputVal($conf, '1');
1246 $qsTmp = str_replace('#VALUE1#', $GLOBALS['TYPO3_DB']->quoteStr($inputVal, $this->table), $qsTmp);
1247 }
1248 $qs .= trim($qsTmp);
1249 return $qs;
1250 }
1251
1252 /**
1253 * [Describe function...]
1254 *
1255 * @param [type] $conf: ...
1256 * @param [type] $suffix: ...
1257 * @return [type] ...
1258 */
1259 function cleanInputVal($conf, $suffix = '') {
1260 if (($conf['comparison'] >> 5 == 0) || ($conf['comparison'] == 32 || $conf['comparison'] == 33 || $conf['comparison'] == 64 || $conf['comparison'] == 65 || $conf['comparison'] == 66 || $conf['comparison'] == 67 || $conf['comparison'] == 96 || $conf['comparison'] == 97)) {
1261 $inputVal = $conf['inputValue' . $suffix];
1262 } elseif ($conf['comparison'] == 39 || $conf['comparison'] == 38) { // in list:
1263 $inputVal = implode(',', t3lib_div::intExplode(',', $conf['inputValue' . $suffix]));
1264 } elseif ($conf['comparison'] == 68 || $conf['comparison'] == 69 || $conf['comparison'] == 162 || $conf['comparison'] == 163) { // in list:
1265 if (is_array($conf['inputValue' . $suffix])) {
1266 $inputVal = implode(',', $conf['inputValue' . $suffix]);
1267 } elseif ($conf['inputValue' . $suffix]) {
1268 $inputVal = $conf['inputValue' . $suffix];
1269 } else {
1270 $inputVal = 0;
1271 }
1272 } else {
1273 $inputVal = doubleval($conf['inputValue' . $suffix]);
1274 }
1275 return $inputVal;
1276 }
1277
1278 /**
1279 * [Describe function...]
1280 *
1281 * @param [type] $qcArr: ...
1282 * @return [type] ...
1283 */
1284 function getUserDefQuery($qcArr) {
1285 }
1286
1287 /**
1288 * [Describe function...]
1289 *
1290 * @return [type] ...
1291 */
1292 function updateIcon() {
1293 return '<input type="image" border="0" ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/refresh_n.gif', 'width="14" height="14"') . ' title="Update" name="just_update">';
1294 }
1295
1296 /**
1297 * [Describe function...]
1298 *
1299 * @return [type] ...
1300 */
1301 function getLabelCol() {
1302 global $TCA;
1303 return $TCA[$this->table]['ctrl']['label'];
1304 }
1305
1306 /**
1307 * [Describe function...]
1308 *
1309 * @param [type] $modSettings: ...
1310 * @param [type] $enableList: ...
1311 * @return [type] ...
1312 */
1313 function makeSelectorTable($modSettings, $enableList = 'table,fields,query,group,order,limit') {
1314 $enableArr = explode(',', $enableList);
1315 // Make output
1316 $TDparams = ' class="bgColor5" nowrap';
1317
1318 if (in_array('table', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectATable']) {
1319 $out = '
1320 <tr>
1321 <td' . $TDparams . '><strong>Select a table:</strong></td>
1322 <td' . $TDparams . '>' . $this->mkTableSelect('SET[queryTable]', $this->table) . '</td>
1323 </tr>';
1324 }
1325 if ($this->table) {
1326
1327 // Init fields:
1328 $this->setAndCleanUpExternalLists('queryFields', $modSettings['queryFields'], 'uid,' . $this->getLabelCol());
1329 $this->setAndCleanUpExternalLists('queryGroup', $modSettings['queryGroup']);
1330 $this->setAndCleanUpExternalLists('queryOrder', $modSettings['queryOrder'] . ',' . $modSettings['queryOrder2']);
1331
1332 // Limit:
1333 $this->extFieldLists['queryLimit'] = $modSettings['queryLimit'];
1334 if (!$this->extFieldLists['queryLimit']) {
1335 $this->extFieldLists['queryLimit'] = 100;
1336 }
1337 $parts = t3lib_div::intExplode(',', $this->extFieldLists['queryLimit']);
1338 if ($parts[1]) {
1339 $this->limitBegin = $parts[0];
1340 $this->limitLength = $parts[1];
1341 } else {
1342 $this->limitLength = $this->extFieldLists['queryLimit'];
1343 }
1344 $this->extFieldLists['queryLimit'] = implode(',', array_slice($parts, 0, 2));
1345
1346 // Insert Descending parts
1347 if ($this->extFieldLists['queryOrder']) {
1348 $descParts = explode(',', $modSettings['queryOrderDesc'] . ',' . $modSettings['queryOrder2Desc']);
1349 $orderParts = explode(',', $this->extFieldLists['queryOrder']);
1350 $reList = array();
1351 foreach ($orderParts as $kk => $vv) {
1352 $reList[] = $vv . ($descParts[$kk] ? ' DESC' : '');
1353 }
1354 $this->extFieldLists['queryOrder_SQL'] = implode(',', $reList);
1355 }
1356
1357 // Query Generator:
1358 $this->procesData($modSettings['queryConfig'] ? unserialize($modSettings['queryConfig']) : '');
1359 // debug($this->queryConfig);
1360 $this->queryConfig = $this->cleanUpQueryConfig($this->queryConfig);
1361 // debug($this->queryConfig);
1362 $this->enableQueryParts = $modSettings['search_query_smallparts'];
1363
1364 $codeArr = $this->getFormElements();
1365 $queryCode = $this->printCodeArray($codeArr);
1366
1367 if (in_array('fields', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectFields']) {
1368 $out .= '
1369 <tr>
1370 <td' . $TDparams . '><strong>Select fields:</strong></td>
1371 <td' . $TDparams . '>' . $this->mkFieldToInputSelect('SET[queryFields]', $this->extFieldLists['queryFields']) . '</td>
1372 </tr>';
1373 }
1374 if (in_array('query', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableMakeQuery']) {
1375 $out .= '<tr>
1376 <td colspan="2"' . $TDparams . '><strong>Make Query:</strong></td>
1377 </tr>
1378 <tr>
1379 <td colspan="2">' . $queryCode . '</td>
1380 </tr>
1381 ';
1382 }
1383 if (in_array('group', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableGroupBy']) {
1384 $out .= '<tr>
1385 <td' . $TDparams . '><strong>Group By:</strong></td>
1386 <td' . $TDparams . '>' . $this->mkTypeSelect('SET[queryGroup]', $this->extFieldLists['queryGroup'], '') . '</td>
1387 </tr>';
1388 }
1389 if (in_array('order', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableOrderBy']) {
1390 $orderByArr = explode(',', $this->extFieldLists['queryOrder']);
1391 // debug($orderByArr);
1392 $orderBy = '';
1393 $orderBy .= $this->mkTypeSelect('SET[queryOrder]', $orderByArr[0], '') .
1394 '&nbsp;' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrderDesc]', $modSettings['queryOrderDesc'], '', '', 'id="checkQueryOrderDesc"') . '&nbsp;<label for="checkQueryOrderDesc">Descending</label>';
1395 if ($orderByArr[0]) {
1396 $orderBy .= '<BR>' . $this->mkTypeSelect('SET[queryOrder2]', $orderByArr[1], '') .
1397 '&nbsp;' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrder2Desc]', $modSettings['queryOrder2Desc'], '', '', 'id="checkQueryOrder2Desc"') . '&nbsp;<label for="checkQueryOrder2Desc">Descending</label>';
1398 }
1399 $out .= '<tr>
1400 <td' . $TDparams . '><strong>Order By:</strong></td>
1401 <td' . $TDparams . '>' . $orderBy . '</td>
1402 </tr>';
1403 }
1404 if (in_array('limit', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableLimit']) {
1405 $limit = '<input type="Text" value="' . htmlspecialchars($this->extFieldLists['queryLimit']) . '" name="SET[queryLimit]" id="queryLimit"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>' . $this->updateIcon();
1406
1407 $prevLimit = ($this->limitBegin - $this->limitLength) < 0 ? 0 :
1408 $this->limitBegin - $this->limitLength;
1409 if ($this->limitBegin) {
1410 $prevButton = '<input type="button" value="previous ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $prevLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>';
1411 }
1412 if (!$this->limitLength) {
1413 $this->limitLength = 100;
1414 }
1415 $nextLimit = $this->limitBegin + $this->limitLength;
1416 if ($nextLimit < 0) {
1417 $nextLimit = 0;
1418 }
1419 if ($nextLimit) {
1420 $nextButton = '<input type="button" value="next ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $nextLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>';
1421 }
1422
1423 $numberButtons = '<input type="button" value="10" onclick=\'document.getElementById("queryLimit").value="10";document.forms[0].submit();\'>';
1424 $numberButtons .= '<input type="button" value="20" onclick=\'document.getElementById("queryLimit").value="20";document.forms[0].submit();\'>';
1425 $numberButtons .= '<input type="button" value="50" onclick=\'document.getElementById("queryLimit").value="50";document.forms[0].submit();\'>';
1426 $numberButtons .= '<input type="button" value="100" onclick=\'document.getElementById("queryLimit").value="100";document.forms[0].submit();\'>';
1427 $out .= '<tr>
1428 <td' . $TDparams . '><strong>Limit:</strong></td>
1429 <td' . $TDparams . '>' . $limit . $prevButton . $nextButton . '&nbsp;' . $numberButtons . '</td>
1430 </tr>
1431 ';
1432 }
1433 }
1434 $out = '<table border="0" cellpadding="3" cellspacing="1" class="qg-make-query">' . $out . '</table>';
1435 $out .= $this->JSbottom($this->formName);
1436 return $out;
1437 }
1438
1439 /**
1440 * [Describe function...]
1441 *
1442 * @param [type] $qString: ...
1443 * @param [type] $depth: ...
1444 * @param [type] $begin: ...
1445 * @param [type] $perms_clause: ...
1446 * @return [type] ...
1447 */
1448 function getTreeList($id, $depth, $begin = 0, $perms_clause) {
1449 $depth = intval($depth);
1450 $begin = intval($begin);
1451 $id = intval($id);
1452 if ($begin == 0) {
1453 $theList = $id;
1454 } else {
1455 $theList = '';
1456 }
1457 if ($id && $depth > 0) {
1458 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
1459 'uid',
1460 'pages',
1461 'pid=' . $id . ' ' . t3lib_BEfunc::deleteClause('pages') . ' AND ' . $perms_clause
1462 );
1463 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
1464 if ($begin <= 0) {
1465 $theList .= ',' . $row['uid'];
1466 }
1467 if ($depth > 1) {
1468 $theList .= $this->getTreeList($row['uid'], $depth - 1, $begin - 1, $perms_clause);
1469 }
1470 }
1471 }
1472 return $theList;
1473 }
1474
1475 /**
1476 * [Describe function...]
1477 *
1478 * @param [type] $qString: ...
1479 * @param [type] $fN: ...
1480 * @return [type] ...
1481 */
1482 function getSelectQuery($qString = '', $fN = '') {
1483 if (!$qString) {
1484 $qString = $this->getQuery($this->queryConfig);
1485 }
1486 $qString = '(' . $qString . ')';
1487 if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
1488 $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
1489 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
1490 $webMountPageTree = '';
1491 foreach ($webMounts as $key => $val) {
1492 if ($webMountPageTree) {
1493 $webMountPageTreePrefix = ',';
1494 }
1495 $webMountPageTree .= $webMountPageTreePrefix . $this->getTreeList($val, 999, $begin = 0, $perms_clause);
1496 }
1497 if ($this->table == 'pages') {
1498 $qString .= ' AND uid IN (' . $webMountPageTree . ')';
1499 } else {
1500 $qString .= ' AND pid IN (' . $webMountPageTree . ')';
1501 }
1502 }
1503 $fieldlist = $this->extFieldLists['queryFields'] .
1504 ',pid' .
1505 ($GLOBALS['TCA'][$this->table]['ctrl']['delete'] ? ',' . $GLOBALS['TCA'][$this->table]['ctrl']['delete'] : '');
1506 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
1507 $qString .= t3lib_BEfunc::deleteClause($this->table);
1508 }
1509 $query = $GLOBALS['TYPO3_DB']->SELECTquery(
1510 $fieldlist,
1511 $this->table,
1512 $qString,
1513 trim($this->extFieldLists['queryGroup']),
1514 $this->extFieldLists['queryOrder'] ? trim($this->extFieldLists['queryOrder_SQL']) : '',
1515 $this->extFieldLists['queryLimit']
1516 );
1517 return $query;
1518 }
1519
1520 /**
1521 * [Describe function...]
1522 *
1523 * @param [type] $formname: ...
1524 * @return [type] ...
1525 */
1526 function JSbottom($formname) {
1527 $out = '';
1528 if ($this->extJSCODE) {
1529 $out .= '
1530 <script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . '../t3lib/jsfunc.evalfield.js"></script>
1531 <script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . 'jsfunc.tbe_editor.js"></script>
1532 <script language="javascript" type="text/javascript">
1533 TBE_EDITOR.formname = "' . $formname . '";
1534 TBE_EDITOR.formnameUENC = "' . rawurlencode($formname) . '";
1535 TBE_EDITOR.backend_interface = "' . $GLOBALS['BE_USER']->uc['interfaceSetup'] . '";
1536 ' . $this->extJSCODE . '
1537 </script>';
1538 }
1539 return $out;
1540 }
1541
1542 /**
1543 * Sets the current name of the input form.
1544 *
1545 * @param string $formName: The name of the form.
1546 * @return void
1547 */
1548 public function setFormName($formName) {
1549 $this->formName = trim($formName);
1550 }
1551 }
1552
1553
1554 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_querygenerator.php'])) {
1555 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_querygenerator.php']);
1556 }
1557
1558 ?>