/***************************************************************
* Copyright notice
*
- * (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
+ * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* Class used in module tools/dbint (advanced search) and which may hold code specific for that module
* However the class has a general principle in it which may be used in the web/export module.
*
- * $Id$
- *
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
* @coauthor Jo Hasenau <info@cybercraft.de>
*/
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- * 88: class t3lib_fullsearch
- * 103: function form()
- * 117: function makeStoreControl()
- * 156: function initStoreArray()
- * 176: function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray)
- * 193: function addToStoreQueryConfigs($storeQueryConfigs,$index)
- * 209: function saveQueryInAction($uid)
- * 256: function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray)
- * 272: function procesStoreControl()
- * 344: function queryMaker()
- * 414: function getQueryResultCode($mQ,$res,$table)
- * 534: function csvValues($row, $delim=',', $quote='"', $conf=array(), $table='')
- * 550: function tableWrap($str)
- * 559: function search()
- * 614: function resultRowDisplay($row,$conf,$table)
- * 662: function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString)
- * 781: function getTreeList($id, $depth, $begin = 0, $perms_clause)
- * 818: function makeValueList($fN, $fV, $conf, $table, $splitString)
- * 1028: function resultRowTitles($row,$conf,$table)
- * 1058: function csvRowTitles($row, $conf, $table)
- *
- * TOTAL FUNCTIONS: 19
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
/**
* @return [type] ...
*/
function queryMaker() {
- global $TCA;
-
+ $output = '';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'])) {
$this->hookArray = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3lib_fullsearch'];
}
$mQ = $GLOBALS['SOBE']->MOD_SETTINGS['search_query_makeQuery'];
// Make form elements:
- if ($qGen->table && is_array($TCA[$qGen->table])) {
+ if ($qGen->table && is_array($GLOBALS['TCA'][$qGen->table])) {
if ($mQ) {
// Show query
$qGen->enablePrefix = 1;
$res = @$GLOBALS['TYPO3_DB']->sql_query($qExplain);
if ($GLOBALS['TYPO3_DB']->sql_error()) {
- $out .= '<BR><strong>Error:</strong><BR><font color="red"><strong>' . $GLOBALS['TYPO3_DB']->sql_error() . '</strong></font>';
+ $out = '<BR><strong>Error:</strong><BR><font color="red"><strong>' . $GLOBALS['TYPO3_DB']->sql_error() . '</strong></font>';
$output .= $GLOBALS['SOBE']->doc->section('SQL error', $out, 0, 1);
} else {
$cPR = $this->getQueryResultCode($mQ, $res, $qGen->table);
* @return [type] ...
*/
function getQueryResultCode($mQ, $res, $table) {
- global $TCA;
- $output = '';
+ $out = '';
$cPR = array();
switch ($mQ) {
case 'count':
case 'all':
$rowArr = array();
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
- $rowArr[] = $this->resultRowDisplay($row, $TCA[$table], $table);
+ $rowArr[] = $this->resultRowDisplay($row, $GLOBALS['TCA'][$table], $table);
$lrow = $row;
}
if (is_array($this->hookArray['beforeResultTable'])) {
}
}
if (count($rowArr)) {
- $out .= '<table border="0" cellpadding="2" cellspacing="1" width="100%">' . $this->resultRowTitles($lrow, $TCA[$table], $table) . implode(LF, $rowArr) . '</table>';
+ $out .= '<table border="0" cellpadding="2" cellspacing="1" width="100%">' .
+ $this->resultRowTitles($lrow, $GLOBALS['TCA'][$table], $table) . implode(LF, $rowArr) . '</table>';
}
if (!$out) {
$out = '<em>No rows selected!</em>';
$rowArr[] = $this->csvValues(array_keys($row), ',', '');
$first = 0;
}
- $rowArr[] = $this->csvValues($row, ',', '"', $TCA[$table], $table);
+ $rowArr[] = $this->csvValues($row, ',', '"', $GLOBALS['TCA'][$table], $table);
}
if (count($rowArr)) {
$out .= '<textarea name="whatever" rows="20" wrap="off"' . $GLOBALS['SOBE']->doc->formWidthText($this->formW, '', 'off') . ' class="fixed-font">' . t3lib_div::formatForTextarea(implode(LF, $rowArr)) . '</textarea>';
* @return [type] ...
*/
function search() {
- global $TCA;
$SET = $GLOBALS['SOBE']->MOD_SETTINGS;
$swords = $SET['sword'];
+ $out = '';
$limit = 200;
$showAlways = 0;
if ($swords) {
- foreach ($TCA as $table => $value) {
+ foreach ($GLOBALS['TCA'] as $table => $value) {
// Get fields list
t3lib_div::loadTCA($table);
- $conf = $TCA[$table];
+ $conf = $GLOBALS['TCA'][$table];
// avoid querying tables with no columns
if (empty($conf['columns'])) {
$out .= '<a href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . t3lib_iconWorks::getSpriteIcon('status-dialog-information') . '</a>';
$out .= '<a href="#" onClick="' . t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], t3lib_div::getIndpEnv('REQUEST_URI') . t3lib_div::implodeArrayForUrl('SET', (array) t3lib_div::_POST('SET'))) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
} else {
- $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisScript(array()))) . '">';
+ $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php',
+ array(
+ 'cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1',
+ 'redirect' => t3lib_div::linkThisScript(array()))) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
$out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore', array('title' => 'undelete only')) . '</a>';
- $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php', array('cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1', 'redirect' => t3lib_div::linkThisUrl('alt_doc.php', array('edit[' . $table . '][' . $row['uid'] . ']' => 'edit', 'returnUrl' => t3lib_div::linkThisScript(array()))))) . '">';
+ $out .= '<a href="' . t3lib_div::linkThisUrl($GLOBALS['BACK_PATH'] . 'tce_db.php',
+ array(
+ 'cmd[' . $table . '][' . $row['uid'] . '][undelete]' => '1',
+ 'redirect' => t3lib_div::linkThisUrl('alt_doc.php',
+ array(
+ 'edit[' . $table . '][' . $row['uid'] . ']' => 'edit',
+ 'returnUrl' => t3lib_div::linkThisScript(array())
+ )
+ )
+ )
+ ) . t3lib_BEfunc::getUrlToken('tceAction') . '">';
$out .= t3lib_iconWorks::getSpriteIcon('actions-edit-restore-edit', array('title' => 'undelete and edit')) . '</a>';
}
$_params = array($table => $row);
* @return [type] ...
*/
function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString) {
- global $TCA;
// Analysing the fields in the table.
- if (is_array($TCA[$table])) {
+ if (is_array($GLOBALS['TCA'][$table])) {
t3lib_div::loadTCA($table);
- $fC = $TCA[$table]['columns'][$fN];
+ $fC = $GLOBALS['TCA'][$table]['columns'][$fN];
$fields = $fC['config'];
$fields['exclude'] = $fC['exclude'];
if (is_array($fC) && $fC['label']) {
}
}
}
- global $TCA;
if (stristr($fieldSetup['allowed'], ',')) {
$from_table_Arr = explode(',', $fieldSetup['allowed']);
$useTablePrefix = 1;
$tablePrefix = $from_table . '_';
}
$counter = 1;
- if (is_array($TCA[$from_table])) {
+ if (is_array($GLOBALS['TCA'][$from_table])) {
t3lib_div::loadTCA($from_table);
- $labelField = $TCA[$from_table]['ctrl']['label'];
- $altLabelField = $TCA[$from_table]['ctrl']['label_alt'];
- if ($TCA[$from_table]['columns'][$labelField]['config']['items']) {
- reset($TCA[$from_table]['columns'][$labelField]['config']['items']);
- while (list(, $labelArray) = each($TCA[$from_table]['columns'][$labelField]['config']['items'])) {
+ $labelField = $GLOBALS['TCA'][$from_table]['ctrl']['label'];
+ $altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];
+ if ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items']) {
+ foreach ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items'] as $labelArray) {
if (substr($labelArray[0], 0, 4) == 'LLL:') {
$labelFieldSelect[$labelArray[1]] = $GLOBALS['LANG']->sL($labelArray[0]);
} else {
}
$useSelectLabels = 1;
}
- if ($TCA[$from_table]['columns'][$altLabelField]['config']['items']) {
- reset($TCA[$from_table]['columns'][$altLabelField]['config']['items']);
- foreach ($TCA[$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
+ if ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items']) {
+ foreach ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
if (substr($altLabelArray[0], 0, 4) == 'LLL:') {
$altLabelFieldSelect[$altLabelArray[1]] = $GLOBALS['LANG']->sL($altLabelArray[0]);
} else {
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
- reset($this->tableArray[$from_table]);
foreach ($this->tableArray[$from_table] as $key => $val) {
$GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] = $GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'] == 1 ? 'on' :
$GLOBALS['SOBE']->MOD_SETTINGS['labels_noprefix'];
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']);
}
-?>
+?>
\ No newline at end of file