Fixed issue #17284: Formprotection persistToken method is called too often, causing...
[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 $fieldSetup = $this->fields[$fN];
753 if ($fieldSetup['type'] == 'files') {
754 if ($conf['comparison'] == 66 || $conf['comparison'] == 67) {
755 $fileExtArray = explode(',', $fieldSetup['allowed']);
756 natcasesort($fileExtArray);
757 foreach ($fileExtArray as $fileExt) {
758 if (t3lib_div::inList($conf['inputValue'], $fileExt)) {
759 $out .= '<option value="' . $fileExt . '" selected>.' . $fileExt . '</option>';
760 } else {
761 $out .= '<option value="' . $fileExt . '">.' . $fileExt . '</option>';
762 }
763 }
764 }
765 $d = dir(PATH_site . $fieldSetup['uploadfolder']);
766 while (false !== ($entry = $d->read())) {
767 if ($entry == '.' || $entry == '..') {
768 continue;
769 }
770 $fileArray[] = $entry;
771 }
772 $d->close();
773 natcasesort($fileArray);
774 foreach ($fileArray as $fileName) {
775 if (t3lib_div::inList($conf['inputValue'], $fileName)) {
776 $out .= '<option value="' . $fileName . '" selected>' . $fileName . '</option>';
777 } else {
778 $out .= '<option value="' . $fileName . '">' . $fileName . '</option>';
779 }
780 }
781 }
782 if ($fieldSetup['type'] == 'multiple') {
783 foreach ($fieldSetup['items'] as $key => $val) {
784 if (substr($val[0], 0, 4) == 'LLL:') {
785 $value = $GLOBALS['LANG']->sL($val[0]);
786 } else {
787 $value = $val[0];
788 }
789 if (t3lib_div::inList($conf['inputValue'], $val[1])) {
790 $out .= '<option value="' . $val[1] . '" selected>' . $value . '</option>';
791 } else {
792 $out .= '<option value="' . $val[1] . '">' . $value . '</option>';
793 }
794 }
795 }
796 if ($fieldSetup['type'] == 'binary') {
797 foreach ($fieldSetup['items'] as $key => $val) {
798 if (substr($val[0], 0, 4) == 'LLL:') {
799 $value = $GLOBALS['LANG']->sL($val[0]);
800 } else {
801 $value = $val[0];
802 }
803 if (t3lib_div::inList($conf['inputValue'], pow(2, $key))) {
804 $out .= '<option value="' . pow(2, $key) . '" selected>' . $value . '</option>';
805 } else {
806 $out .= '<option value="' . pow(2, $key) . '">' . $value . '</option>';
807 }
808 }
809 }
810 if ($fieldSetup['type'] == 'relation') {
811 if ($fieldSetup['items']) {
812 foreach ($fieldSetup['items'] as $key => $val) {
813 if (substr($val[0], 0, 4) == 'LLL:') {
814 $value = $GLOBALS['LANG']->sL($val[0]);
815 } else {
816 $value = $val[0];
817 }
818 if (t3lib_div::inList($conf['inputValue'], $val[1])) {
819 $out .= '<option value="' . $val[1] . '" selected>' . $value . '</option>';
820 } else {
821 $out .= '<option value="' . $val[1] . '">' . $value . '</option>';
822 }
823 }
824 }
825 global $TCA;
826 if (stristr($fieldSetup['allowed'], ',')) {
827 $from_table_Arr = explode(',', $fieldSetup['allowed']);
828 $useTablePrefix = 1;
829 if (!$fieldSetup['prepend_tname']) {
830 $checkres = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fN, $table, t3lib_BEfunc::deleteClause($table), $groupBy = '', $orderBy = '', $limit = '');
831 if ($checkres) {
832 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($checkres)) {
833 if (stristr($row[$fN], ',')) {
834 $checkContent = explode(',', $row[$fN]);
835 foreach ($checkContent as $singleValue) {
836 if (!stristr($singleValue, '_')) {
837 $dontPrefixFirstTable = 1;
838 }
839 }
840 } else {
841 $singleValue = $row[$fN];
842 if (strlen($singleValue) && !stristr($singleValue, '_')) {
843 $dontPrefixFirstTable = 1;
844 }
845 }
846 }
847 }
848 }
849 } else {
850 $from_table_Arr[0] = $fieldSetup['allowed'];
851 }
852 if ($fieldSetup['prepend_tname']) {
853 $useTablePrefix = 1;
854 }
855 if ($fieldSetup['foreign_table']) {
856 $from_table_Arr[0] = $fieldSetup['foreign_table'];
857 }
858 $counter = 0;
859 $webMountPageTree = '';
860 while (list(, $from_table) = each($from_table_Arr)) {
861 if (($useTablePrefix && !$dontPrefixFirstTable && $counter != 1) || $counter == 1) {
862 $tablePrefix = $from_table . '_';
863 }
864 $counter = 1;
865 if (is_array($TCA[$from_table])) {
866 t3lib_div::loadTCA($from_table);
867 $labelField = $TCA[$from_table]['ctrl']['label'];
868 $altLabelField = $TCA[$from_table]['ctrl']['label_alt'];
869 if ($TCA[$from_table]['columns'][$labelField]['config']['items']) {
870 foreach ($TCA[$from_table]['columns'][$labelField]['config']['items'] as $labelArray) {
871 if (substr($labelArray[0], 0, 4) == 'LLL:') {
872 $labelFieldSelect[$labelArray[1]] = $GLOBALS['LANG']->sL($labelArray[0]);
873 } else {
874 $labelFieldSelect[$labelArray[1]] = $labelArray[0];
875 }
876 }
877 $useSelectLabels = 1;
878 }
879 if ($TCA[$from_table]['columns'][$altLabelField]['config']['items']) {
880 foreach ($TCA[$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
881 if (substr($altLabelArray[0], 0, 4) == 'LLL:') {
882 $altLabelFieldSelect[$altLabelArray[1]] = $GLOBALS['LANG']->sL($altLabelArray[0]);
883 } else {
884 $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0];
885 }
886 }
887 $useAltSelectLabels = 1;
888 }
889 $altLabelFieldSelect = $altLabelField ? ',' . $altLabelField : '';
890 $select_fields = 'uid,' . $labelField . $altLabelFieldSelect;
891 if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
892 $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
893 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
894 foreach ($webMounts as $key => $val) {
895 if ($webMountPageTree) {
896 $webMountPageTreePrefix = ',';
897 }
898 $webMountPageTree .= $webMountPageTreePrefix . $this->getTreeList($val, 999, $begin = 0, $perms_clause);
899 }
900 if ($from_table == 'pages') {
901 $where_clause = 'uid IN (' . $webMountPageTree . ') ';
902 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
903 $where_clause .= t3lib_BEfunc::deleteClause($from_table) . ' AND' . $perms_clause;
904 }
905 } else {
906 $where_clause = 'pid IN (' . $webMountPageTree . ') ';
907 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
908 $where_clause .= t3lib_BEfunc::deleteClause($from_table);
909 }
910 }
911 } else {
912 $where_clause = 'uid';
913 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
914 $where_clause .= t3lib_BEfunc::deleteClause($from_table);
915 }
916 }
917 $orderBy = 'uid';
918 if (!$this->tableArray[$from_table]) {
919 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy, $limit = '');
920 }
921 if ($res) {
922 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
923 $this->tableArray[$from_table][] = $row;
924 }
925 }
926 foreach ($this->tableArray[$from_table] as $key => $val) {
927 if ($useSelectLabels) {
928 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($labelFieldSelect[$val[$labelField]]);
929 } elseif ($val[$labelField]) {
930 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($val[$labelField]);
931 } elseif ($useAltSelectLabels) {
932 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($altLabelFieldSelect[$val[$altLabelField]]);
933 } else {
934 $outArray[$tablePrefix . $val['uid']] = htmlspecialchars($val[$altLabelField]);
935 }
936 }
937 if ($GLOBALS['SOBE']->MOD_SETTINGS['options_sortlabel'] && is_array($outArray)) {
938 natcasesort($outArray);
939 }
940 }
941 }
942 foreach ($outArray as $key2 => $val2) {
943 if (t3lib_div::inList($conf['inputValue'], $key2)) {
944 $out .= '<option value="' . $key2 . '" selected>[' . $key2 . '] ' . $val2 . '</option>';
945 } else {
946 $out .= '<option value="' . $key2 . '">[' . $key2 . '] ' . $val2 . '</option>';
947 }
948 }
949 }
950 return $out;
951 }
952
953
954 /**
955 * [Describe function...]
956 *
957 * @param [type] $codeArr: ...
958 * @param [type] $l: ...
959 * @return [type] ...
960 */
961 function printCodeArray($codeArr, $l = 0) {
962 $line = '';
963 if ($l) {
964 $indent = '<td style="vertical-align:top;"><img height="1" width="50"></td>';
965 }
966 $lf = $l * 30;
967 $bgColor = t3lib_div::modifyHTMLColor($GLOBALS['TBE_TEMPLATE']->bgColor2, $lf, $lf, $lf);
968 foreach ($codeArr as $k => $v) {
969 $line .= '<tr>' . $indent . '<td bgcolor="' . $bgColor . '"' . $this->noWrap . '>' . $v['html'] . '</td></tr>';
970 if ($this->enableQueryParts) {
971 $line .= '<tr>' . $indent . '<td>' . $this->formatQ($v['query']) . '</td></tr>';
972 }
973 if (is_array($v['sub'])) {
974 $line .= '<tr>' . $indent . '<td' . $this->noWrap . '>' . $this->printCodeArray($v['sub'], $l + 1) . '</td></tr>';
975 }
976 }
977 $out = '<table border="0" cellpadding="0" cellspacing="1">' . $line . '</table>';
978 return $out;
979 }
980
981 /**
982 * [Describe function...]
983 *
984 * @param [type] $str: ...
985 * @return [type] ...
986 */
987 function formatQ($str) {
988 return '<font size="1" face="verdana" color="maroon"><i>' . htmlspecialchars($str) . '</i></font>';
989 }
990
991 /**
992 * [Describe function...]
993 *
994 * @param [type] $name: ...
995 * @param [type] $op: ...
996 * @param [type] $draw: ...
997 * @param [type] $submit: ...
998 * @return [type] ...
999 */
1000 function mkOperatorSelect($name, $op, $draw, $submit) {
1001 if ($draw) {
1002 $out = '<select name="' . $name . '[operator]"' . ($submit ? ' onChange="submit();"' : '') . '>'; //
1003 $out .= '<option value="AND"' . (!$op || $op == "AND" ? ' selected' : '') . '>' . $this->lang["AND"] . '</option>';
1004 $out .= '<option value="OR"' . ($op == 'OR' ? ' selected' : '') . '>' . $this->lang['OR'] . '</option>';
1005 $out .= '</select>';
1006 } else {
1007 $out .= '<input type="hidden" value="' . $op . '" name="' . $name . '[operator]">';
1008 $out .= '<img src="clear.gif" height="1" width="47">';
1009
1010 }
1011 return $out;
1012 }
1013
1014 /**
1015 * [Describe function...]
1016 *
1017 * @param [type] $name: ...
1018 * @param [type] $fieldName: ...
1019 * @param [type] $prepend: ...
1020 * @return [type] ...
1021 */
1022 function mkTypeSelect($name, $fieldName, $prepend = 'FIELD_') {
1023 $out = '<select name="' . $name . '" onChange="submit();">';
1024 $out .= '<option value=""></option>';
1025 foreach ($this->fields as $key => $value) {
1026 if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
1027 $label = $this->fields[$key]['label'];
1028 $label_alt = $this->fields[$key]['label_alt'];
1029 $out .= '<option value="' . $prepend . $key . '"' . ($key == $fieldName ? ' selected' : '') . '>' . $label . '</option>';
1030 }
1031 }
1032 $out .= '</select>';
1033 return $out;
1034 }
1035
1036 /**
1037 * [Describe function...]
1038 *
1039 * @param [type] $fieldName: ...
1040 * @return [type] ...
1041 */
1042 function verifyType($fieldName) {
1043 $first = '';
1044 foreach ($this->fields as $key => $value) {
1045 if (!$first) {
1046 $first = $key;
1047 }
1048 if ($key == $fieldName) {
1049 return $key;
1050 }
1051 }
1052 return $first;
1053 }
1054
1055 /**
1056 * [Describe function...]
1057 *
1058 * @param [type] $comparison: ...
1059 * @param [type] $neg: ...
1060 * @return [type] ...
1061 */
1062 function verifyComparison($comparison, $neg) {
1063 $compOffSet = $comparison >> 5;
1064 $first = -1;
1065 for ($i = 32 * $compOffSet + $neg; $i < 32 * ($compOffSet + 1); $i += 2) {
1066 if ($first == -1) {
1067 $first = $i;
1068 }
1069 if (($i >> 1) == ($comparison >> 1)) {
1070 return $i;
1071 }
1072 }
1073 return $first;
1074 }
1075
1076 /**
1077 * [Describe function...]
1078 *
1079 * @param [type] $name: ...
1080 * @param [type] $fieldName: ...
1081 * @return [type] ...
1082 */
1083 function mkFieldToInputSelect($name, $fieldName) {
1084 $out = '<input type="Text" value="' . htmlspecialchars($fieldName) . '" name="' . $name . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth() . '>' . $this->updateIcon();
1085 $out .= '<a href="#" onClick="document.forms[0][\'' . $name . '\'].value=\'\';return false;">' . t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => 'Clear list')) . '</a>';
1086 $out .= '<BR><select name="_fieldListDummy" size="5" onChange="document.forms[0][\'' . $name . '\'].value+=\',\'+this.value">';
1087 foreach ($this->fields as $key => $value) {
1088 if (!$value['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table . ':' . $key)) {
1089 $label = $this->fields[$key]['label'];
1090 $label_alt = $this->fields[$key]['label_alt'];
1091 $out .= '<option value="' . $key . '"' . ($key == $fieldName ? ' selected' : '') . '>' . $label . '</option>';
1092 }
1093 }
1094 $out .= '</select>';
1095 return $out;
1096 }
1097
1098 /**
1099 * [Describe function...]
1100 *
1101 * @param [type] $name: ...
1102 * @param [type] $cur: ...
1103 * @return [type] ...
1104 */
1105 function mkTableSelect($name, $cur) {
1106 global $TCA;
1107 $out = '<select name="' . $name . '" onChange="submit();">';
1108 $out .= '<option value=""></option>';
1109 foreach ($TCA as $tN => $value) {
1110 if ($GLOBALS['BE_USER']->check('tables_select', $tN)) {
1111 $out .= '<option value="' . $tN . '"' . ($tN == $cur ? ' selected' : '') . '>' . $GLOBALS['LANG']->sl($TCA[$tN]['ctrl']['title']) . '</option>';
1112 }
1113 }
1114 $out .= '</select>';
1115 return $out;
1116 }
1117
1118 /**
1119 * [Describe function...]
1120 *
1121 * @param [type] $name: ...
1122 * @param [type] $comparison: ...
1123 * @param [type] $neg: ...
1124 * @return [type] ...
1125 */
1126 function mkCompSelect($name, $comparison, $neg) {
1127 $compOffSet = $comparison >> 5;
1128 $out = '<select name="' . $name . '" onChange="submit();">';
1129 for ($i = 32 * $compOffSet + $neg; $i < 32 * ($compOffSet + 1); $i += 2) {
1130 if ($this->lang['comparison'][$i . '_']) {
1131 $out .= '<option value="' . $i . '"' . (($i >> 1) == ($comparison >> 1) ? ' selected' : '') . '>' . $this->lang['comparison'][$i . '_'] . '</option>';
1132 }
1133 }
1134 $out .= '</select>';
1135 return $out;
1136 }
1137
1138 /**
1139 * [Describe function...]
1140 *
1141 * @param [type] $arr: ...
1142 * @return [type] ...
1143 */
1144 function getSubscript($arr) {
1145 while (is_array($arr)) {
1146 reset($arr);
1147 list($key,) = each($arr);
1148 $retArr[] = $key;
1149 $arr = $arr[$key];
1150 }
1151 return $retArr;
1152 }
1153
1154 /**
1155 * [Describe function...]
1156 *
1157 * @return [type] ...
1158 */
1159 function initUserDef() {
1160
1161 }
1162
1163 /**
1164 * [Describe function...]
1165 *
1166 * @return [type] ...
1167 */
1168 function userDef() {
1169 }
1170
1171 /**
1172 * [Describe function...]
1173 *
1174 * @param [type] $queryConfig: ...
1175 * @return [type] ...
1176 */
1177 function userDefCleanUp($queryConfig) {
1178 return $queryConfig;
1179 }
1180
1181 /**
1182 * [Describe function...]
1183 *
1184 * @param [type] $queryConfig: ...
1185 * @param [type] $pad: ...
1186 * @return [type] ...
1187 */
1188 function getQuery($queryConfig, $pad = '') {
1189 $qs = '';
1190 // Since we don't traverse the array using numeric keys in the upcoming whileloop make sure it's fresh and clean
1191 ksort($queryConfig);
1192 $first = 1;
1193 foreach ($queryConfig as $key => $conf) {
1194 switch ($conf['type']) {
1195 case 'newlevel':
1196 $qs .= LF . $pad . trim($conf['operator']) . ' (' . $this->getQuery($queryConfig[$key]['nl'], $pad . ' ') . LF . $pad . ')';
1197 break;
1198 case 'userdef':
1199 $qs .= LF . $pad . getUserDefQuery($conf, $first);
1200 break;
1201 default:
1202 $qs .= LF . $pad . $this->getQuerySingle($conf, $first);
1203 break;
1204 }
1205 $first = 0;
1206 }
1207 return $qs;
1208 }
1209
1210 /**
1211 * [Describe function...]
1212 *
1213 * @param [type] $conf: ...
1214 * @param [type] $first: ...
1215 * @return [type] ...
1216 */
1217 function getQuerySingle($conf, $first) {
1218 $prefix = $this->enablePrefix ? $this->table . '.' : '';
1219 if (!$first) {
1220 // Is it OK to insert the AND operator if none is set?
1221 $qs .= trim(($conf['operator'] ? $conf['operator'] : 'AND')) . ' ';
1222 }
1223 $qsTmp = str_replace('#FIELD#', $prefix . trim(substr($conf['type'], 6)), $this->compSQL[$conf['comparison']]);
1224 $inputVal = $this->cleanInputVal($conf);
1225 if ($conf['comparison'] == 68 || $conf['comparison'] == 69) {
1226 $inputVal = explode(',', $inputVal);
1227 foreach ($inputVal as $key => $fileName) {
1228 $inputVal[$key] = "'" . $fileName . "'";
1229 }
1230 $inputVal = implode(',', $inputVal);
1231 $qsTmp = str_replace('#VALUE#', $inputVal, $qsTmp);
1232 } elseif ($conf['comparison'] == 162 || $conf['comparison'] == 163) {
1233 $inputValArray = explode(',', $inputVal);
1234 $inputVal = 0;
1235 foreach ($inputValArray as $key => $fileName) {
1236 $inputVal += intval($fileName);
1237 }
1238 $qsTmp = str_replace('#VALUE#', $inputVal, $qsTmp);
1239 } else {
1240 $qsTmp = str_replace('#VALUE#', $GLOBALS['TYPO3_DB']->quoteStr($inputVal, $this->table), $qsTmp);
1241 }
1242 if ($conf['comparison'] == 37 || $conf['comparison'] == 36 || $conf['comparison'] == 66 || $conf['comparison'] == 67 || $conf['comparison'] == 100 || $conf['comparison'] == 101) { // between:
1243 $inputVal = $this->cleanInputVal($conf, '1');
1244 $qsTmp = str_replace('#VALUE1#', $GLOBALS['TYPO3_DB']->quoteStr($inputVal, $this->table), $qsTmp);
1245 }
1246 $qs .= trim($qsTmp);
1247 return $qs;
1248 }
1249
1250 /**
1251 * [Describe function...]
1252 *
1253 * @param [type] $conf: ...
1254 * @param [type] $suffix: ...
1255 * @return [type] ...
1256 */
1257 function cleanInputVal($conf, $suffix = '') {
1258 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)) {
1259 $inputVal = $conf['inputValue' . $suffix];
1260 } elseif ($conf['comparison'] == 39 || $conf['comparison'] == 38) { // in list:
1261 $inputVal = implode(',', t3lib_div::intExplode(',', $conf['inputValue' . $suffix]));
1262 } elseif ($conf['comparison'] == 68 || $conf['comparison'] == 69 || $conf['comparison'] == 162 || $conf['comparison'] == 163) { // in list:
1263 if (is_array($conf['inputValue' . $suffix])) {
1264 $inputVal = implode(',', $conf['inputValue' . $suffix]);
1265 } elseif ($conf['inputValue' . $suffix]) {
1266 $inputVal = $conf['inputValue' . $suffix];
1267 } else {
1268 $inputVal = 0;
1269 }
1270 } else {
1271 $inputVal = doubleval($conf['inputValue' . $suffix]);
1272 }
1273 return $inputVal;
1274 }
1275
1276 /**
1277 * [Describe function...]
1278 *
1279 * @param [type] $qcArr: ...
1280 * @return [type] ...
1281 */
1282 function getUserDefQuery($qcArr) {
1283 }
1284
1285 /**
1286 * [Describe function...]
1287 *
1288 * @return [type] ...
1289 */
1290 function updateIcon() {
1291 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">';
1292 }
1293
1294 /**
1295 * [Describe function...]
1296 *
1297 * @return [type] ...
1298 */
1299 function getLabelCol() {
1300 global $TCA;
1301 return $TCA[$this->table]['ctrl']['label'];
1302 }
1303
1304 /**
1305 * [Describe function...]
1306 *
1307 * @param [type] $modSettings: ...
1308 * @param [type] $enableList: ...
1309 * @return [type] ...
1310 */
1311 function makeSelectorTable($modSettings, $enableList = 'table,fields,query,group,order,limit') {
1312 $enableArr = explode(',', $enableList);
1313 // Make output
1314 $TDparams = ' class="bgColor5" nowrap';
1315
1316 if (in_array('table', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectATable']) {
1317 $out = '
1318 <tr>
1319 <td' . $TDparams . '><strong>Select a table:</strong></td>
1320 <td' . $TDparams . '>' . $this->mkTableSelect('SET[queryTable]', $this->table) . '</td>
1321 </tr>';
1322 }
1323 if ($this->table) {
1324
1325 // Init fields:
1326 $this->setAndCleanUpExternalLists('queryFields', $modSettings['queryFields'], 'uid,' . $this->getLabelCol());
1327 $this->setAndCleanUpExternalLists('queryGroup', $modSettings['queryGroup']);
1328 $this->setAndCleanUpExternalLists('queryOrder', $modSettings['queryOrder'] . ',' . $modSettings['queryOrder2']);
1329
1330 // Limit:
1331 $this->extFieldLists['queryLimit'] = $modSettings['queryLimit'];
1332 if (!$this->extFieldLists['queryLimit']) {
1333 $this->extFieldLists['queryLimit'] = 100;
1334 }
1335 $parts = t3lib_div::intExplode(',', $this->extFieldLists['queryLimit']);
1336 if ($parts[1]) {
1337 $this->limitBegin = $parts[0];
1338 $this->limitLength = $parts[1];
1339 } else {
1340 $this->limitLength = $this->extFieldLists['queryLimit'];
1341 }
1342 $this->extFieldLists['queryLimit'] = implode(',', array_slice($parts, 0, 2));
1343
1344 // Insert Descending parts
1345 if ($this->extFieldLists['queryOrder']) {
1346 $descParts = explode(',', $modSettings['queryOrderDesc'] . ',' . $modSettings['queryOrder2Desc']);
1347 $orderParts = explode(',', $this->extFieldLists['queryOrder']);
1348 $reList = array();
1349 foreach ($orderParts as $kk => $vv) {
1350 $reList[] = $vv . ($descParts[$kk] ? ' DESC' : '');
1351 }
1352 $this->extFieldLists['queryOrder_SQL'] = implode(',', $reList);
1353 }
1354
1355 // Query Generator:
1356 $this->procesData($modSettings['queryConfig'] ? unserialize($modSettings['queryConfig']) : '');
1357 // debug($this->queryConfig);
1358 $this->queryConfig = $this->cleanUpQueryConfig($this->queryConfig);
1359 // debug($this->queryConfig);
1360 $this->enableQueryParts = $modSettings['search_query_smallparts'];
1361
1362 $codeArr = $this->getFormElements();
1363 $queryCode = $this->printCodeArray($codeArr);
1364
1365 if (in_array('fields', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableSelectFields']) {
1366 $out .= '
1367 <tr>
1368 <td' . $TDparams . '><strong>Select fields:</strong></td>
1369 <td' . $TDparams . '>' . $this->mkFieldToInputSelect('SET[queryFields]', $this->extFieldLists['queryFields']) . '</td>
1370 </tr>';
1371 }
1372 if (in_array('query', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableMakeQuery']) {
1373 $out .= '<tr>
1374 <td colspan="2"' . $TDparams . '><strong>Make Query:</strong></td>
1375 </tr>
1376 <tr>
1377 <td colspan="2">' . $queryCode . '</td>
1378 </tr>
1379 ';
1380 }
1381 if (in_array('group', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableGroupBy']) {
1382 $out .= '<tr>
1383 <td' . $TDparams . '><strong>Group By:</strong></td>
1384 <td' . $TDparams . '>' . $this->mkTypeSelect('SET[queryGroup]', $this->extFieldLists['queryGroup'], '') . '</td>
1385 </tr>';
1386 }
1387 if (in_array('order', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableOrderBy']) {
1388 $orderByArr = explode(',', $this->extFieldLists['queryOrder']);
1389 // debug($orderByArr);
1390 $orderBy = '';
1391 $orderBy .= $this->mkTypeSelect('SET[queryOrder]', $orderByArr[0], '') .
1392 '&nbsp;' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrderDesc]', $modSettings['queryOrderDesc'], '', '', 'id="checkQueryOrderDesc"') . '&nbsp;<label for="checkQueryOrderDesc">Descending</label>';
1393 if ($orderByArr[0]) {
1394 $orderBy .= '<BR>' . $this->mkTypeSelect('SET[queryOrder2]', $orderByArr[1], '') .
1395 '&nbsp;' . t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id, 'SET[queryOrder2Desc]', $modSettings['queryOrder2Desc'], '', '', 'id="checkQueryOrder2Desc"') . '&nbsp;<label for="checkQueryOrder2Desc">Descending</label>';
1396 }
1397 $out .= '<tr>
1398 <td' . $TDparams . '><strong>Order By:</strong></td>
1399 <td' . $TDparams . '>' . $orderBy . '</td>
1400 </tr>';
1401 }
1402 if (in_array('limit', $enableArr) && !$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableLimit']) {
1403 $limit = '<input type="Text" value="' . htmlspecialchars($this->extFieldLists['queryLimit']) . '" name="SET[queryLimit]" id="queryLimit"' . $GLOBALS['TBE_TEMPLATE']->formWidth(10) . '>' . $this->updateIcon();
1404
1405 $prevLimit = ($this->limitBegin - $this->limitLength) < 0 ? 0 :
1406 $this->limitBegin - $this->limitLength;
1407 if ($this->limitBegin) {
1408 $prevButton = '<input type="button" value="previous ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $prevLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>';
1409 }
1410 if (!$this->limitLength) {
1411 $this->limitLength = 100;
1412 }
1413 $nextLimit = $this->limitBegin + $this->limitLength;
1414 if ($nextLimit < 0) {
1415 $nextLimit = 0;
1416 }
1417 if ($nextLimit) {
1418 $nextButton = '<input type="button" value="next ' . $this->limitLength . '" onclick=\'document.getElementById("queryLimit").value="' . $nextLimit . ',' . $this->limitLength . '";document.forms[0].submit();\'>';
1419 }
1420
1421 $numberButtons = '<input type="button" value="10" onclick=\'document.getElementById("queryLimit").value="10";document.forms[0].submit();\'>';
1422 $numberButtons .= '<input type="button" value="20" onclick=\'document.getElementById("queryLimit").value="20";document.forms[0].submit();\'>';
1423 $numberButtons .= '<input type="button" value="50" onclick=\'document.getElementById("queryLimit").value="50";document.forms[0].submit();\'>';
1424 $numberButtons .= '<input type="button" value="100" onclick=\'document.getElementById("queryLimit").value="100";document.forms[0].submit();\'>';
1425 $out .= '<tr>
1426 <td' . $TDparams . '><strong>Limit:</strong></td>
1427 <td' . $TDparams . '>' . $limit . $prevButton . $nextButton . '&nbsp;' . $numberButtons . '</td>
1428 </tr>
1429 ';
1430 }
1431 }
1432 $out = '<table border="0" cellpadding="3" cellspacing="1" class="qg-make-query">' . $out . '</table>';
1433 $out .= $this->JSbottom($this->formName);
1434 return $out;
1435 }
1436
1437 /**
1438 * [Describe function...]
1439 *
1440 * @param [type] $qString: ...
1441 * @param [type] $depth: ...
1442 * @param [type] $begin: ...
1443 * @param [type] $perms_clause: ...
1444 * @return [type] ...
1445 */
1446 function getTreeList($id, $depth, $begin = 0, $perms_clause) {
1447 $depth = intval($depth);
1448 $begin = intval($begin);
1449 $id = intval($id);
1450 if ($begin == 0) {
1451 $theList = $id;
1452 } else {
1453 $theList = '';
1454 }
1455 if ($id && $depth > 0) {
1456 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
1457 'uid',
1458 'pages',
1459 'pid=' . $id . ' ' . t3lib_BEfunc::deleteClause('pages') . ' AND ' . $perms_clause
1460 );
1461 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
1462 if ($begin <= 0) {
1463 $theList .= ',' . $row['uid'];
1464 }
1465 if ($depth > 1) {
1466 $theList .= $this->getTreeList($row['uid'], $depth - 1, $begin - 1, $perms_clause);
1467 }
1468 }
1469 }
1470 return $theList;
1471 }
1472
1473 /**
1474 * [Describe function...]
1475 *
1476 * @param [type] $qString: ...
1477 * @param [type] $fN: ...
1478 * @return [type] ...
1479 */
1480 function getSelectQuery($qString = '', $fN = '') {
1481 if (!$qString) {
1482 $qString = $this->getQuery($this->queryConfig);
1483 }
1484 $qString = '(' . $qString . ')';
1485 if (!$GLOBALS['BE_USER']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts']) {
1486 $webMounts = $GLOBALS['BE_USER']->returnWebmounts();
1487 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
1488 $webMountPageTree = '';
1489 foreach ($webMounts as $key => $val) {
1490 if ($webMountPageTree) {
1491 $webMountPageTreePrefix = ',';
1492 }
1493 $webMountPageTree .= $webMountPageTreePrefix . $this->getTreeList($val, 999, $begin = 0, $perms_clause);
1494 }
1495 if ($this->table == 'pages') {
1496 $qString .= ' AND uid IN (' . $webMountPageTree . ')';
1497 } else {
1498 $qString .= ' AND pid IN (' . $webMountPageTree . ')';
1499 }
1500 }
1501 $fieldlist = $this->extFieldLists['queryFields'] .
1502 ',pid' .
1503 ($GLOBALS['TCA'][$this->table]['ctrl']['delete'] ? ',' . $GLOBALS['TCA'][$this->table]['ctrl']['delete'] : '');
1504 if (!$GLOBALS['SOBE']->MOD_SETTINGS['show_deleted']) {
1505 $qString .= t3lib_BEfunc::deleteClause($this->table);
1506 }
1507 $query = $GLOBALS['TYPO3_DB']->SELECTquery(
1508 $fieldlist,
1509 $this->table,
1510 $qString,
1511 trim($this->extFieldLists['queryGroup']),
1512 $this->extFieldLists['queryOrder'] ? trim($this->extFieldLists['queryOrder_SQL']) : '',
1513 $this->extFieldLists['queryLimit']
1514 );
1515 return $query;
1516 }
1517
1518 /**
1519 * [Describe function...]
1520 *
1521 * @param [type] $formname: ...
1522 * @return [type] ...
1523 */
1524 function JSbottom($formname) {
1525 if ($this->extJSCODE) {
1526 $out .= '
1527 <script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . '../t3lib/jsfunc.evalfield.js"></script>
1528 <script language="javascript" type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . 'jsfunc.tbe_editor.js"></script>
1529 <script language="javascript" type="text/javascript">
1530 TBE_EDITOR.formname = "' . $formname . '";
1531 TBE_EDITOR.formnameUENC = "' . rawurlencode($formname) . '";
1532 TBE_EDITOR.backend_interface = "' . $GLOBALS['BE_USER']->uc['interfaceSetup'] . '";
1533 ' . $this->extJSCODE . '
1534 </script>';
1535 return $out;
1536 }
1537 }
1538
1539 /**
1540 * Sets the current name of the input form.
1541 *
1542 * @param string $formName: The name of the form.
1543 * @return void
1544 */
1545 public function setFormName($formName) {
1546 $this->formName = trim($formName);
1547 }
1548 }
1549
1550
1551 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_querygenerator.php'])) {
1552 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_querygenerator.php']);
1553 }
1554
1555 ?>