32 public $storeList =
'search_query_smallparts,search_result_labels,labels_noprefix,show_deleted,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery';
55 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_t3lib_fullsearch.xlf');
67 <input type="text" name="SET[sword]" value="' . htmlspecialchars(
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'sword']) .
'"' .
$GLOBALS[
'TBE_TEMPLATE']->formWidth(20) .
'><input type="submit" name="submit" value="Search All Records"> 83 foreach ($storeArray as $k => $v) {
84 $opt[] =
'<option value="' . $k .
'">' . htmlspecialchars($v) .
'</option>';
87 if (\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'sys_action') &&
$GLOBALS[
'BE_USER']->isAdmin()) {
88 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_action',
'type=2',
'',
'title');
89 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res)) {
90 $opt[] =
'<option value="0">__Save to Action:__</option>';
91 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
92 $opt[] =
'<option value="-' . $row[
'uid'] .
'">' . htmlspecialchars(($row[
'title'] .
' [' . $row[
'uid'] .
']')) .
'</option>';
95 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
97 $TDparams =
' nowrap="nowrap" class="bgColor4"';
99 <table border="0" cellpadding="3" cellspacing="1"> 100 <tr' . $TDparams .
'><td><select name="storeControl[STORE]" onChange="document.forms[0][\'storeControl[title]\'].value= this.options[this.selectedIndex].value!=0 ? this.options[this.selectedIndex].text : \'\';">' . implode(LF, $opt) .
'</select><input type="submit" name="storeControl[LOAD]" value="Load"></td></tr> 101 <tr' . $TDparams .
'><td nowrap><input name="storeControl[title]" value="" type="text" max="80"' .
$GLOBALS[
'SOBE']->doc->formWidth() .
'><input type="submit" name="storeControl[SAVE]" value="Save" onClick="if (document.forms[0][\'storeControl[STORE]\'].options[document.forms[0][\'storeControl[STORE]\'].selectedIndex].value<0) return confirm(\'Are you sure you want to overwrite the existing query in this action?\');"><input type="submit" name="storeControl[REMOVE]" value="Remove"></td></tr> 117 $savedStoreArray = unserialize(
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'storeArray']);
118 if (is_array($savedStoreArray)) {
119 $storeArray = array_merge($storeArray, $savedStoreArray);
133 if (is_array($storeQueryConfigs)) {
134 foreach ($storeQueryConfigs as $k => $v) {
135 if (!isset($storeArray[$k])) {
136 unset($storeQueryConfigs[$k]);
140 return $storeQueryConfigs;
152 $keyArr = explode(
',', $this->storeList);
153 $storeQueryConfigs[$index] = array();
154 foreach ($keyArr as $k) {
155 $storeQueryConfigs[$index][$k] =
$GLOBALS[
'SOBE']->MOD_SETTINGS[$k];
157 return $storeQueryConfigs;
167 public function saveQueryInAction(
$uid) {
168 if (\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'sys_action')) {
169 $keyArr = explode(
',', $this->storeList);
171 foreach ($keyArr as $k) {
172 $saveArr[$k] =
$GLOBALS[
'SOBE']->MOD_SETTINGS[$k];
176 if ($saveArr[
'queryTable']) {
179 $qGen->init(
'queryConfig', $saveArr[
'queryTable']);
180 $qGen->makeSelectorTable($saveArr);
181 $qGen->enablePrefix = 1;
182 $qString = $qGen->getQuery($qGen->queryConfig);
184 $qSelect = $qGen->getSelectQuery($qString);
185 $res = @
$GLOBALS[
'TYPO3_DB']->sql_query($qCount);
186 if (!
$GLOBALS[
'TYPO3_DB']->sql_error()) {
187 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
189 $dA[
't2_data'] = serialize(array(
192 'qSelect' => $qSelect,
193 'qString' => $qString
195 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'sys_action',
'uid=' . (
int)
$uid, $dA);
213 if ($storeQueryConfigs[$storeIndex]) {
214 $keyArr = explode(
',', $this->storeList);
215 foreach ($keyArr as $k) {
216 $writeArray[$k] = $storeQueryConfigs[$storeIndex][$k];
230 $storeQueryConfigs = unserialize(
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'storeQueryConfigs']);
232 $storeIndex = (int)$storeControl[
'STORE'];
234 $writeArray = array();
235 if (is_array($storeControl)) {
237 if ($storeControl[
'LOAD']) {
238 if ($storeIndex > 0) {
241 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf(
$GLOBALS[
'LANG']->getLL(
'query_loaded'), htmlspecialchars($storeArray[$storeIndex])));
242 } elseif ($storeIndex < 0 && \
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'sys_action')) {
243 $actionRecord = BackendUtility::getRecord(
'sys_action', abs($storeIndex));
244 if (is_array($actionRecord)) {
245 $dA = unserialize($actionRecord[
't2_data']);
247 if (is_array($dA[
'qC'])) {
248 $dbSC[0] = $dA[
'qC'];
252 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf(
$GLOBALS[
'LANG']->getLL(
'query_from_action_loaded'), htmlspecialchars($actionRecord[
'title'])));
255 } elseif ($storeControl[
'SAVE']) {
256 if ($storeIndex < 0) {
257 $qOK = $this->saveQueryInAction(abs($storeIndex));
264 if (trim($storeControl[
'title'])) {
265 if ($storeIndex > 0) {
266 $storeArray[$storeIndex] = $storeControl[
'title'];
268 $storeArray[] = $storeControl[
'title'];
270 $storeIndex = key($storeArray);
277 } elseif ($storeControl[
'REMOVE']) {
278 if ($storeIndex > 0) {
279 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf(
$GLOBALS[
'LANG']->getLL(
'query_removed'), htmlspecialchars($storeArray[$storeControl[
'STORE']])));
281 unset($storeArray[$storeControl[
'STORE']]);
286 $msg = $flashMessage->render();
289 if ($saveStoreArray) {
291 unset($storeArray[0]);
292 $writeArray[
'storeArray'] = serialize($storeArray);
293 $writeArray[
'storeQueryConfigs'] = serialize($this->
cleanStoreQueryConfigs($storeQueryConfigs, $storeArray));
307 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
't3lib_fullsearch'])) {
308 $this->hookArray =
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
't3lib_fullsearch'];
311 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableStoreControl']) {
314 $output .=
'<br />' . $msg;
316 $output .=
$GLOBALS[
'SOBE']->doc->spacer(20);
320 $qGen->init(
'queryConfig',
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'queryTable']);
321 if ($this->formName) {
322 $qGen->setFormName($this->formName);
324 $tmpCode = $qGen->makeSelectorTable(
$GLOBALS[
'SOBE']->MOD_SETTINGS);
325 $output .=
$GLOBALS[
'SOBE']->doc->section(
'Make query', $tmpCode, 0, 1);
326 $mQ =
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'search_query_makeQuery'];
328 if ($qGen->table && is_array(
$GLOBALS[
'TCA'][$qGen->table])) {
331 $qGen->enablePrefix = 1;
332 $qString = $qGen->getQuery($qGen->queryConfig);
338 $qExplain = $qGen->getSelectQuery($qString);
339 if ($mQ ==
'explain') {
340 $qExplain =
'EXPLAIN ' . $qExplain;
343 if (!
$GLOBALS[
'BE_USER']->userTS[
'mod.'][
'dbint.'][
'disableShowSQLQuery']) {
344 $output .=
$GLOBALS[
'SOBE']->doc->section(
'SQL query', $this->
tableWrap(htmlspecialchars($qExplain)), 0, 1);
346 $res = @
$GLOBALS[
'TYPO3_DB']->sql_query($qExplain);
347 if (
$GLOBALS[
'TYPO3_DB']->sql_error()) {
348 $out =
'<BR><strong>Error:</strong><BR><font color="red"><strong>' .
$GLOBALS[
'TYPO3_DB']->sql_error() .
'</strong></font>';
349 $output .=
$GLOBALS[
'SOBE']->doc->section(
'SQL error', $out, 0, 1);
352 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
353 $output .=
$GLOBALS[
'SOBE']->doc->section($cPR[
'header'], $cPR[
'content'], 0, 1);
374 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_row($res);
375 $cPR[
'header'] =
'Count';
376 $cPR[
'content'] =
'<BR><strong>' . $row[0] .
'</strong> records selected.';
380 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
384 if (is_array($this->hookArray[
'beforeResultTable'])) {
385 foreach ($this->hookArray[
'beforeResultTable'] as $_funcRef) {
389 if (count($rowArr)) {
390 $out .=
'<table border="0" cellpadding="2" cellspacing="1" width="100%">' . $this->
resultRowTitles($lrow,
$GLOBALS[
'TCA'][$table], $table) . implode(LF, $rowArr) .
'</table>';
393 $out =
'<em>No rows selected!</em>';
395 $cPR[
'header'] =
'Result';
396 $cPR[
'content'] = $out;
401 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
403 $rowArr[] = $this->
csvValues(array_keys($row),
',',
'');
408 if (count($rowArr)) {
409 $out .=
'<textarea name="whatever" rows="20" wrap="off"' .
$GLOBALS[
'SOBE']->doc->formWidthText($this->formW,
'',
'off') .
' class="fixed-font">' .
GeneralUtility::formatForTextarea(implode(LF, $rowArr)) .
'</textarea>';
410 if (!$this->noDownloadB) {
411 $out .=
'<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\'' . $this->downloadScript .
'\';
">'; 414 if (GeneralUtility::_GP('download_file')) { 415 $filename = 'TYPO3_' . $table . '_export_' . date('dmy-Hi') . '.csv'; 416 $mimeType = 'application/octet-stream'; 417 header('Content-Type: ' . $mimeType); 418 header('Content-Disposition: attachment; filename=' . $filename); 419 echo implode(CRLF, $rowArr); 424 $out = '<em>No rows selected!</em>'; 426 $cPR['header'] = 'Result'; 427 $cPR['content'] = $out; 432 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 433 $out .= '<br />' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($row); 435 $cPR['header'] = 'Explain SQL query'; 436 $cPR['content'] = $out; 452 public function csvValues($row, $delim = ',', $quote = '"', $conf = array(), $table = '') { 454 if ($GLOBALS['SOBE
']->MOD_SETTINGS['search_result_labels
'] && $table) { 455 foreach ($valueArray as $key => $val) { 456 $valueArray[$key] = $this->getProcessedValueExtra($table, $key, $val, $conf, ';
'); 459 return GeneralUtility::csvValues($valueArray, $delim, $quote); 469 public function tableWrap($str) { 470 return '<table border=
"0" cellpadding=
"10" cellspacing=
"0" class=
"bgColor4"><tr><td nowrap><pre>
' . $str . '</pre></td></tr></table>
'; 479 public function search() { 480 $SET = $GLOBALS['SOBE
']->MOD_SETTINGS; 481 $swords = $SET['sword
']; 486 foreach ($GLOBALS['TCA
'] as $table => $value) { 488 $conf = $GLOBALS['TCA
'][$table]; 489 // Avoid querying tables with no columns 490 if (empty($conf['columns
'])) { 493 $fieldsInDatabase = $GLOBALS['TYPO3_DB
']->admin_get_fields($table); 494 $list = array_intersect(array_keys($conf['columns
']), array_keys($fieldsInDatabase)); 496 $qp = $GLOBALS['TYPO3_DB
']->searchQuery(array($swords), $list, $table); 498 $count = $GLOBALS['TYPO3_DB
']->exec_SELECTcountRows('*
', $table, $qp . BackendUtility::deleteClause($table)); 499 if ($count || $showAlways) { 501 $out .= '<strong>TABLE:</strong>
' . $GLOBALS['LANG
']->sL($conf['ctrl
']['title
']) . '<BR>
'; 502 $out .= '<strong>Results:</strong>
' . $count . '<BR>
'; 506 $res = $GLOBALS['TYPO3_DB
']->exec_SELECTquery('uid,
' . $conf['ctrl
']['label
'], $table, $qp . BackendUtility::deleteClause($table), '', '', $limit); 507 while ($row = $GLOBALS['TYPO3_DB
']->sql_fetch_assoc($res)) { 508 $rowArr[] = $this->resultRowDisplay($row, $conf, $table); 511 $GLOBALS['TYPO3_DB
']->sql_free_result($res); 512 $out .= '<table border=
"0" cellpadding=
"2" cellspacing=
"1">
' . $this->resultRowTitles($lrow, $conf, $table) . implode(LF, $rowArr) . '</table>
'; 530 public function resultRowDisplay($row, $conf, $table) { 531 static $even = FALSE; 532 $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler
'); 533 $SET = $GLOBALS['SOBE
']->MOD_SETTINGS; 534 $out = '<tr
class=
"bgColor' . ($even ? '6' : '4') . '">
'; 536 foreach ($row as $fN => $fV) { 537 if (GeneralUtility::inList($SET['queryFields
'], $fN) || !$SET['queryFields
'] && $fN != 'pid
' && $fN != 'deleted
') { 538 if ($SET['search_result_labels
']) { 539 $fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />
'); 541 $fVnew = htmlspecialchars($fV); 543 $out .= '<td>
' . $fVnew . '</td>
'; 546 $params = '&edit[
' . $table . '][
' . $row['uid
'] . ']=edit
'; 547 $out .= '<td nowrap>
'; 548 if (!$row['deleted
']) { 549 $out .= '<a href=
"#" onClick=
"top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">
' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-dialog-information
') . '</a>
'; 550 $out .= '<a href=
"#" onClick=
"' . BackendUtility::editOnClick($params, $GLOBALS['BACK_PATH'], (GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array) GeneralUtility::_POST('SET')))) . '">
' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open
') . '</a>
'; 552 $out .= '<a href=
"' . GeneralUtility::linkThisUrl(($GLOBALS['BACK_PATH'] . 'tce_db.php'), array( 553 ('cmd[' . $table . '][' . $row['uid'] . '][undelete]') => '1', 554 'redirect' => GeneralUtility::linkThisScript(array()) 555 )) . BackendUtility::getUrlToken('tceAction') . '">
'; 556 $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore
', array('title
' => 'undelete only
')) . '</a>
'; 557 $out .= '<a href=
"' . GeneralUtility::linkThisUrl(($GLOBALS['BACK_PATH'] . 'tce_db.php'), array( 558 ('cmd[' . $table . '][' . $row['uid'] . '][undelete]') => '1', 559 'redirect' => GeneralUtility::linkThisUrl('alt_doc.php', array( 560 ('edit[' . $table . '][' . $row['uid'] . ']') => 'edit', 561 'returnUrl' => GeneralUtility::linkThisScript(array()) 563 )) . BackendUtility::getUrlToken('tceAction') . '">
'; 564 $out .= \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-restore-edit
', array('title
' => 'undelete and edit
')) . '</a>
'; 566 $_params = array($table => $row); 567 if (is_array($this->hookArray['additionalButtons
'])) { 568 foreach ($this->hookArray['additionalButtons
'] as $_funcRef) { 569 $out .= GeneralUtility::callUserFunction($_funcRef, $_params, $this); 589 public function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString) { 590 // Analysing the fields in the table. 591 if (is_array($GLOBALS['TCA
'][$table])) { 592 $fC = $GLOBALS['TCA
'][$table]['columns
'][$fN]; 593 $fields = $fC['config
']; 594 $fields['exclude
'] = $fC['exclude
']; 595 if (is_array($fC) && $fC['label
']) { 596 $fields['label
'] = preg_replace('/:$/
', '', trim($GLOBALS['LANG
']->sL($fC['label
']))); 597 switch ($fields['type
']) { 599 if (preg_match('/
int|year/i
', $fields['eval
'])) { 600 $fields['type
'] = 'number
'; 601 } elseif (preg_match('/time/i
', $fields['eval
'])) { 602 $fields['type
'] = 'time
'; 603 } elseif (preg_match('/date/i
', $fields['eval
'])) { 604 $fields['type
'] = 'date
'; 606 $fields['type
'] = 'text
'; 610 if (!$fields['items
']) { 611 $fields['type
'] = 'boolean'; 613 $fields['type
'] = 'binary
'; 617 $fields['type
'] = 'multiple
'; 620 $fields['type
'] = 'multiple
'; 621 if ($fields['foreign_table
']) { 622 $fields['type
'] = 'relation
'; 624 if ($fields['special
']) { 625 $fields['type
'] = 'text
'; 629 $fields['type
'] = 'files
'; 630 if ($fields['internal_type
'] == 'db
') { 631 $fields['type
'] = 'relation
'; 645 $fields['type
'] = 'text
'; 648 $fields['label
'] = '[FIELD:
' . $fN . ']
'; 651 $fields['type
'] = 'relation
'; 652 $fields['allowed
'] = 'pages
'; 655 $fields['type
'] = 'relation
'; 656 $fields['allowed
'] = 'be_users
'; 661 $fields['type
'] = 'time
'; 664 $fields['type
'] = 'number
'; 668 switch ($fields['type
']) { 671 $out = strftime('%e-%m-%Y
', $fV); 676 if ($splitString == '<br />
') { 677 $out = strftime('%H:%M
' . $splitString . '%e-%m-%Y
', $fV); 679 $out = strftime('%H:%M %e-%m-%Y
', $fV); 688 $out = $this->makeValueList($fN, $fV, $fields, $table, $splitString); 691 $out = $fV ? 'True
' : 'False
'; 696 $out = htmlspecialchars($fV); 711 public function getTreeList($id, $depth, $begin = 0, $perms_clause) { 712 $depth = (int)$depth; 713 $begin = (int)$begin; 723 if ($id && $depth > 0) { 724 $res = $GLOBALS['TYPO3_DB
']->exec_SELECTquery('uid
', 'pages
', 'pid=
' . $id . ' ' . BackendUtility::deleteClause('pages
') . ' AND
' . $perms_clause); 725 while ($row = $GLOBALS['TYPO3_DB
']->sql_fetch_assoc($res)) { 727 $theList .= ',
' . $row['uid
']; 730 $theList .= $this->getTreeList($row['uid
'], $depth - 1, $begin - 1, $perms_clause); 733 $GLOBALS['TYPO3_DB
']->sql_free_result($res); 749 public function makeValueList($fN, $fV, $conf, $table, $splitString) { 752 if ($fieldSetup['type
'] == 'files
') { 753 $d = dir(PATH_site . $fieldSetup['uploadfolder
']); 754 while (FALSE !== ($entry = $d->read())) { 755 if ($entry == '.
' || $entry == '..
') { 758 $fileArray[] = $entry; 761 natcasesort($fileArray); 762 while (list(, $fileName) = each($fileArray)) { 763 if (GeneralUtility::inList($fV, $fileName) || $fV == $fileName) { 765 $out = htmlspecialchars($fileName); 767 $out .= $splitString . htmlspecialchars($fileName); 772 if ($fieldSetup['type
'] == 'multiple
') { 773 foreach ($fieldSetup['items
'] as $key => $val) { 774 if (substr($val[0], 0, 4) == 'LLL:
') { 775 $value = $GLOBALS['LANG
']->sL($val[0]); 779 if (GeneralUtility::inList($fV, $val[1]) || $fV == $val[1]) { 781 $out = htmlspecialchars($value); 783 $out .= $splitString . htmlspecialchars($value); 788 if ($fieldSetup['type
'] == 'binary
') { 789 foreach ($fieldSetup['items
'] as $Key => $val) { 790 if (substr($val[0], 0, 4) == 'LLL:
') { 791 $value = $GLOBALS['LANG
']->sL($val[0]); 796 $out = htmlspecialchars($value); 798 $out .= $splitString . htmlspecialchars($value); 802 if ($fieldSetup['type
'] == 'relation
') { 803 if ($fieldSetup['items
']) { 804 foreach ($fieldSetup['items
'] as $key => $val) { 805 if (substr($val[0], 0, 4) == 'LLL:
') { 806 $value = $GLOBALS['LANG
']->sL($val[0]); 810 if (GeneralUtility::inList($fV, $value) || $fV == $value) { 812 $out = htmlspecialchars($value); 814 $out .= $splitString . htmlspecialchars($value); 819 if (stristr($fieldSetup['allowed
'], ',
')) { 820 $from_table_Arr = explode(',
', $fieldSetup['allowed
']); 822 if (!$fieldSetup['prepend_tname
']) { 823 $checkres = $GLOBALS['TYPO3_DB
']->exec_SELECTquery($fN, $table, 'uid
' . BackendUtility::deleteClause($table), ($groupBy = ''), ($orderBy = ''), ($limit = '')); 825 while ($row = $GLOBALS['TYPO3_DB
']->sql_fetch_assoc($checkres)) { 826 if (stristr($row[$fN], ',
')) { 827 $checkContent = explode(',
', $row[$fN]); 828 foreach ($checkContent as $singleValue) { 829 if (!stristr($singleValue, '_
')) { 830 $dontPrefixFirstTable = 1; 834 $singleValue = $row[$fN]; 835 if (strlen($singleValue) && !stristr($singleValue, '_
')) { 836 $dontPrefixFirstTable = 1; 840 $GLOBALS['TYPO3_DB
']->sql_free_result($checkres); 844 $from_table_Arr[0] = $fieldSetup['allowed
']; 846 if ($fieldSetup['prepend_tname
']) { 849 if ($fieldSetup['foreign_table
']) { 850 $from_table_Arr[0] = $fieldSetup['foreign_table
']; 853 foreach ($from_table_Arr as $from_table) { 854 if ($useTablePrefix && !$dontPrefixFirstTable && $counter != 1 || $counter == 1) { 855 $tablePrefix = $from_table . '_
'; 858 if (is_array($GLOBALS['TCA
'][$from_table])) { 859 $labelField = $GLOBALS['TCA
'][$from_table]['ctrl
']['label
']; 860 $altLabelField = $GLOBALS['TCA
'][$from_table]['ctrl
']['label_alt
']; 861 if ($GLOBALS['TCA
'][$from_table]['columns
'][$labelField]['config
']['items
']) { 862 foreach ($GLOBALS['TCA
'][$from_table]['columns
'][$labelField]['config
']['items
'] as $labelArray) { 863 if (substr($labelArray[0], 0, 4) == 'LLL:
') { 864 $labelFieldSelect[$labelArray[1]] = $GLOBALS['LANG
']->sL($labelArray[0]); 866 $labelFieldSelect[$labelArray[1]] = $labelArray[0]; 869 $useSelectLabels = 1; 871 if ($GLOBALS['TCA
'][$from_table]['columns
'][$altLabelField]['config
']['items
']) { 872 foreach ($GLOBALS['TCA
'][$from_table]['columns
'][$altLabelField]['config
']['items
'] as $altLabelArray) { 873 if (substr($altLabelArray[0], 0, 4) == 'LLL:
') { 874 $altLabelFieldSelect[$altLabelArray[1]] = $GLOBALS['LANG
']->sL($altLabelArray[0]); 876 $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0]; 879 $useAltSelectLabels = 1; 881 $altLabelFieldSelect = $altLabelField ? ',
' . $altLabelField : ''; 882 $select_fields = 'uid,
' . $labelField . $altLabelFieldSelect; 883 if (!$GLOBALS['BE_USER
']->isAdmin() && $GLOBALS['TYPO3_CONF_VARS
']['BE
']['lockBeUserToDBmounts
']) { 884 $webMounts = $GLOBALS['BE_USER
']->returnWebmounts(); 885 $perms_clause = $GLOBALS['BE_USER
']->getPagePermsClause(1); 886 $webMountPageTree = ''; 887 foreach ($webMounts as $key => $val) { 888 if ($webMountPageTree) { 889 $webMountPageTreePrefix = ',
'; 891 $webMountPageTree .= $webMountPageTreePrefix . $this->getTreeList($val, 999, ($begin = 0), $perms_clause); 893 if ($from_table == 'pages
') { 894 $where_clause = 'uid IN (
' . $webMountPageTree . ')
' . BackendUtility::deleteClause($from_table) . ' AND
' . $perms_clause; 896 $where_clause = 'pid IN (
' . $webMountPageTree . ')
' . BackendUtility::deleteClause($from_table); 899 $where_clause = 'uid
' . BackendUtility::deleteClause($from_table); 902 if (!$this->tableArray[$from_table]) { 903 $res = $GLOBALS['TYPO3_DB
']->exec_SELECTquery($select_fields, $from_table, $where_clause, ($groupBy = ''), $orderBy, ($limit = '')); 904 $this->tableArray[$from_table] = array(); 907 while ($row = $GLOBALS['TYPO3_DB
']->sql_fetch_assoc($res)) { 908 $this->tableArray[$from_table][] = $row; 910 $GLOBALS['TYPO3_DB
']->sql_free_result($res); 912 foreach ($this->tableArray[$from_table] as $key => $val) { 913 $GLOBALS['SOBE
']->MOD_SETTINGS['labels_noprefix
'] = $GLOBALS['SOBE
']->MOD_SETTINGS['labels_noprefix
'] == 1 ? 'on
' : $GLOBALS['SOBE
']->MOD_SETTINGS['labels_noprefix
']; 914 $prefixString = $GLOBALS['SOBE
']->MOD_SETTINGS['labels_noprefix
'] == 'on
' ? '' : ' [
' . $tablePrefix . $val['uid
'] . ']
'; 915 if (GeneralUtility::inList($fV, $tablePrefix . $val['uid
']) || $fV == $tablePrefix . $val['uid
']) { 916 if ($useSelectLabels) { 918 $out = htmlspecialchars($prefixString . $labelFieldSelect[$val[$labelField]]); 920 $out .= $splitString . htmlspecialchars(($prefixString . $labelFieldSelect[$val[$labelField]])); 922 } elseif ($val[$labelField]) { 924 $out = htmlspecialchars($prefixString . $val[$labelField]); 926 $out .= $splitString . htmlspecialchars(($prefixString . $val[$labelField])); 928 } elseif ($useAltSelectLabels) { 930 $out = htmlspecialchars($prefixString . $altLabelFieldSelect[$val[$altLabelField]]); 932 $out .= $splitString . htmlspecialchars(($prefixString . $altLabelFieldSelect[$val[$altLabelField]])); 936 $out = htmlspecialchars($prefixString . $val[$altLabelField]); 938 $out .= $splitString . htmlspecialchars(($prefixString . $val[$altLabelField])); 958 public function resultRowTitles($row, $conf, $table) { 959 $SET = $GLOBALS['SOBE
']->MOD_SETTINGS; 960 $tableHeader = array(); 962 $tableHeader[] = '<thead><tr
class=
"bgColor5">
'; 963 // Iterate over given columns 964 foreach ($row as $fieldName => $fieldValue) { 965 if (GeneralUtility::inList($SET['queryFields
'], $fieldName) || !$SET['queryFields
'] && $fieldName != 'pid
' && $fieldName != 'deleted
') { 966 $THparams = strlen($fieldValue) < 50 ? ' style=
"white-space:nowrap;"' : ''; 967 if ($GLOBALS['SOBE
']->MOD_SETTINGS['search_result_labels
']) { 968 $title = $GLOBALS['LANG
']->sL($conf['columns
'][$fieldName]['label
'] ? $conf['columns
'][$fieldName]['label
'] : $fieldName, TRUE); 970 $title = $GLOBALS['LANG
']->sL($fieldName, TRUE); 972 $tableHeader[] = '<th
' . $THparams . '>
' . $title . '</th>
'; 975 // Add empty icon column 976 $tableHeader[] = '<th style=
"white-space:nowrap;"></th>
'; 978 $tableHeader[] = '</tr></thead>
'; 979 return implode($tableHeader, LF); 991 public function csvRowTitles($row, $conf, $table) { 993 $SET = $GLOBALS['SOBE
']->MOD_SETTINGS; 994 foreach ($row as $fN => $fV) { 995 if (GeneralUtility::inList($SET['queryFields
'], $fN) || !$SET['queryFields
'] && $fN != 'pid
') { 997 if ($GLOBALS['SOBE
']->MOD_SETTINGS['search_result_labels
']) { 998 $out = $GLOBALS['LANG
']->sL($conf['columns
'][$fN]['label
'] ? $conf['columns
'][$fN]['label
'] : $fN, TRUE); 1000 $out = $GLOBALS['LANG
']->sL($fN, TRUE); 1003 if ($GLOBALS['SOBE
']->MOD_SETTINGS['search_result_labels
']) { 1004 $out .= ',
' . $GLOBALS['LANG
']->sL(($conf['columns
'][$fN]['label
'] ? $conf['columns
'][$fN]['label
'] : $fN), TRUE); 1006 $out .= ',
' . $GLOBALS['LANG
']->sL($fN, TRUE); 1020 public function setFormName($formName) { 1021 $this->formName = trim($formName);
static formatForTextarea($content)
getQueryResultCode($mQ, $res, $table)
csvValues($row, $delim=',', $quote='"', $conf = array(), $table = '')
loadStoreQueryConfigs($storeQueryConfigs, $storeIndex, $writeArray)
static makeInstance($className)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
resultRowTitles($row, $conf, $table)
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
resultRowDisplay($row, $conf, $table)
addToStoreQueryConfigs($storeQueryConfigs, $index)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
cleanStoreQueryConfigs($storeQueryConfigs, $storeArray)
static deleteClause($table, $tableAlias='')