* Changed quotes in 3 files. Cleanup + needed by an upcoming patch.
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 27 Dec 2005 11:08:31 +0000 (11:08 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Tue, 27 Dec 2005 11:08:31 +0000 (11:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@942 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_fullsearch.php
t3lib/class.t3lib_querygenerator.php
typo3/sysext/lowlevel/dbint/index.php

index d44dfd9..0a08aea 100755 (executable)
@@ -48,7 +48,7 @@
  *  267:     function procesStoreControl()
  *  339:     function queryMaker()
  *  402:     function getQueryResultCode($mQ,$res,$table)
- *  509:     function csvValues($row,$delim=",",$quote='"')
+ *  509:     function csvValues($row,$delim=',',$quote='"')
  *  519:     function tableWrap($str)
  *  528:     function search()
  *  583:     function resultRowDisplay($row,$conf,$table)
@@ -81,8 +81,8 @@
  * @subpackage t3lib
  */
 class t3lib_fullsearch {
-       var $storeList = "search_query_smallparts,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery";
-       var $downloadScript = "index.php";
+       var $storeList = 'search_query_smallparts,queryConfig,queryTable,queryFields,queryLimit,queryOrder,queryOrderDesc,queryOrder2,queryOrder2Desc,queryGroup,search_query_makeQuery';
+       var $downloadScript = 'index.php';
        var $formW=48;
        var $noDownloadB=0;
 
@@ -98,7 +98,7 @@ class t3lib_fullsearch {
        function form() {
                $out='
                Search Word:<BR>
-               <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">
+               <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">
                ';
 
                return $out;
@@ -112,22 +112,22 @@ class t3lib_fullsearch {
        function makeStoreControl()     {
                        // Load/Save
                $storeArray = $this->initStoreArray();
-               $cur="";
+               $cur='';
 
                        // Store Array:
                $opt=array();
                reset($storeArray);
                while(list($k,$v)=each($storeArray))    {
-                       $opt[]='<option value="'.$k.'"'.(!strcmp($cur,$v)?" selected":"").'>'.htmlspecialchars($v).'</option>';
+                       $opt[]='<option value="'.$k.'"'.(!strcmp($cur,$v)?' selected':'').'>'.htmlspecialchars($v).'</option>';
                }
 
                        // Actions:
-               if (t3lib_extMgm::isLoaded("sys_action"))       {
+               if (t3lib_extMgm::isLoaded('sys_action'))       {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', 'type=2', '', 'title');
                        if ($GLOBALS['TYPO3_DB']->sql_num_rows($res))   {
                                $opt[]='<option value="0">__Save to Action:__</option>';
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
-                                       $opt[]='<option value="-'.$row["uid"].'"'.(!strcmp($cur,"-".$row["uid"])?" selected":"").'>'.htmlspecialchars($row["title"]." [".$row["uid"]."]").'</option>';
+                                       $opt[]='<option value="-'.$row['uid'].'"'.(!strcmp($cur,'-'.$row['uid'])?' selected':'').'>'.htmlspecialchars($row['title'].' ['.$row['uid'].']').'</option>';
                                }
                        }
                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
@@ -135,9 +135,9 @@ class t3lib_fullsearch {
 
                $TDparams=' nowrap="nowrap" class="bgColor4"';
                $tmpCode='
-               <table border=0 cellpadding=3 cellspacing=1>
+               <table border="0" cellpadding="3" cellspacing="1">
                <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(chr(10),$opt).'</select><input type="submit" name="storeControl[LOAD]" value="Load"></td></tr>
-               <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>
+               <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>
                </table>
                ';
                return $tmpCode;
@@ -150,10 +150,10 @@ class t3lib_fullsearch {
         */
        function initStoreArray()       {
                $storeArray=array(
-                       "0" => "[New]"
+                       '0' => '[New]'
                );
 
-               $savedStoreArray = unserialize($GLOBALS["SOBE"]->MOD_SETTINGS["storeArray"]);
+               $savedStoreArray = unserialize($GLOBALS['SOBE']->MOD_SETTINGS['storeArray']);
 
                if (is_array($savedStoreArray)) {
                        $storeArray = array_merge($storeArray,$savedStoreArray);
@@ -186,11 +186,11 @@ class t3lib_fullsearch {
         * @return      [type]          ...
         */
        function addToStoreQueryConfigs($storeQueryConfigs,$index)      {
-               $keyArr = explode(",",$this->storeList);
+               $keyArr = explode(',',$this->storeList);
                reset($keyArr);
                $storeQueryConfigs[$index]=array();
                while(list(,$k)=each($keyArr))  {
-                       $storeQueryConfigs[$index][$k]=$GLOBALS["SOBE"]->MOD_SETTINGS[$k];
+                       $storeQueryConfigs[$index][$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
                }
                return $storeQueryConfigs;
        }
@@ -202,19 +202,19 @@ class t3lib_fullsearch {
         * @return      [type]          ...
         */
        function saveQueryInAction($uid)        {
-               if (t3lib_extMgm::isLoaded("sys_action"))       {
-                       $keyArr = explode(",",$this->storeList);
+               if (t3lib_extMgm::isLoaded('sys_action'))       {
+                       $keyArr = explode(',',$this->storeList);
                        reset($keyArr);
                        $saveArr=array();
                        while(list(,$k)=each($keyArr))  {
-                               $saveArr[$k]=$GLOBALS["SOBE"]->MOD_SETTINGS[$k];
+                               $saveArr[$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
                        }
 
                        $qOK = 0;
                                // Show query
-                       if ($saveArr["queryTable"])     {
-                               $qGen = t3lib_div::makeInstance("t3lib_queryGenerator");
-                               $qGen->init("queryConfig",$saveArr["queryTable"]);
+                       if ($saveArr['queryTable'])     {
+                               $qGen = t3lib_div::makeInstance('t3lib_queryGenerator');
+                               $qGen->init('queryConfig',$saveArr['queryTable']);
                                $qGen->makeSelectorTable($saveArr);
 
                                $qGen->enablePrefix=1;
@@ -225,13 +225,13 @@ class t3lib_fullsearch {
                                $res = @$GLOBALS['TYPO3_DB']->sql(TYPO3_db,$qCount);
                                if (!$GLOBALS['TYPO3_DB']->sql_error()) {
                                        $dA = array();
-                                       $dA["t2_data"] = serialize(array(
-                                               "qC"=>$saveArr,
-                                               "qCount" => $qCount,
-                                               "qSelect" => $qSelect,
-                                               "qString" => $qString
+                                       $dA['t2_data'] = serialize(array(
+                                               'qC'=>$saveArr,
+                                               'qCount' => $qCount,
+                                               'qSelect' => $qSelect,
+                                               'qString' => $qString
                                        ));
-                                       $GLOBALS['TYPO3_DB']->exec_UPDATEquery("sys_action", "uid=".intval($uid), $dA);
+                                       $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_action', 'uid='.intval($uid), $dA);
                                        $qOK=1;
                                }
                        }
@@ -250,7 +250,7 @@ class t3lib_fullsearch {
         */
        function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray)      {
                if ($storeQueryConfigs[$storeIndex])    {
-                       $keyArr = explode(",",$this->storeList);
+                       $keyArr = explode(',',$this->storeList);
                        reset($keyArr);
                        while(list(,$k)=each($keyArr))  {
                                $writeArray[$k]=$storeQueryConfigs[$storeIndex][$k];
@@ -266,46 +266,46 @@ class t3lib_fullsearch {
         */
        function procesStoreControl()   {
                $storeArray = $this->initStoreArray();
-               $storeQueryConfigs = unserialize($GLOBALS["SOBE"]->MOD_SETTINGS["storeQueryConfigs"]);
+               $storeQueryConfigs = unserialize($GLOBALS['SOBE']->MOD_SETTINGS['storeQueryConfigs']);
 
-               $storeControl = t3lib_div::_GP("storeControl");
-               $storeIndex = intval($storeControl["STORE"]);
+               $storeControl = t3lib_div::_GP('storeControl');
+               $storeIndex = intval($storeControl['STORE']);
                $saveStoreArray=0;
                $writeArray=array();
                if (is_array($storeControl))    {
-                       if ($storeControl["LOAD"])      {
+                       if ($storeControl['LOAD'])      {
                                if ($storeIndex>0)      {
                                        $writeArray=$this->loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray);
                                        $saveStoreArray=1;
                                        $msg="'".htmlspecialchars($storeArray[$storeIndex])."' query loaded!";
-                               } elseif ($storeIndex<0 && t3lib_extMgm::isLoaded("sys_action"))        {
-                                       $actionRecord=t3lib_BEfunc::getRecord("sys_action",abs($storeIndex));
+                               } elseif ($storeIndex<0 && t3lib_extMgm::isLoaded('sys_action'))        {
+                                       $actionRecord=t3lib_BEfunc::getRecord('sys_action',abs($storeIndex));
                                        if (is_array($actionRecord))    {
-                                               $dA = unserialize($actionRecord["t2_data"]);
+                                               $dA = unserialize($actionRecord['t2_data']);
                                                $dbSC=array();
-                                               if (is_array($dA["qC"]))        {
-                                                       $dbSC[0] = $dA["qC"];
+                                               if (is_array($dA['qC']))        {
+                                                       $dbSC[0] = $dA['qC'];
                                                }
-                                               $writeArray=$this->loadStoreQueryConfigs($dbSC,"0",$writeArray);
+                                               $writeArray=$this->loadStoreQueryConfigs($dbSC,'0',$writeArray);
                                                $saveStoreArray=1;
-                                               $acTitle=htmlspecialchars($actionRecord["title"]);
+                                               $acTitle=htmlspecialchars($actionRecord['title']);
                                                $msg="Query from action '".$acTitle."' loaded!";
                                        }
                                }
-                       } elseif ($storeControl["SAVE"])        {
+                       } elseif ($storeControl['SAVE'])        {
                                if ($storeIndex<0)      {
                                        $qOK = $this->saveQueryInAction(abs($storeIndex));
                                        if ($qOK)       {
-                                               $msg="Query OK and saved.";
+                                               $msg='Query OK and saved.';
                                        } else {
-                                               $msg="No query saved!";
+                                               $msg='No query saved!';
                                        }
                                } else {
-                                       if (trim($storeControl["title"]))       {
+                                       if (trim($storeControl['title']))       {
                                                if ($storeIndex>0)      {
-                                                       $storeArray[$storeIndex]=$storeControl["title"];
+                                                       $storeArray[$storeIndex]=$storeControl['title'];
                                                } else {
-                                                       $storeArray[]=$storeControl["title"];
+                                                       $storeArray[]=$storeControl['title'];
                                                        end($storeArray);
                                                        $storeIndex=key($storeArray);
                                                }
@@ -314,19 +314,19 @@ class t3lib_fullsearch {
                                                $msg="'".htmlspecialchars($storeArray[$storeIndex])."' query saved!";
                                        }
                                }
-                       } elseif ($storeControl["REMOVE"])      {
+                       } elseif ($storeControl['REMOVE'])      {
                                if ($storeIndex>0)      {
-                                       $msg="'".$storeArray[$storeControl["STORE"]]."' query entry removed!";
-                                       unset($storeArray[$storeControl["STORE"]]);     // Removing
+                                       $msg="'".$storeArray[$storeControl['STORE']]."' query entry removed!";
+                                       unset($storeArray[$storeControl['STORE']]);     // Removing
                                        $saveStoreArray=1;
                                }
                        }
                }
                if ($saveStoreArray)    {
                        unset($storeArray[0]);  // making sure, index 0 is not set!
-                       $writeArray["storeArray"]=serialize($storeArray);
-                       $writeArray["storeQueryConfigs"]=serialize($this->cleanStoreQueryConfigs($storeQueryConfigs,$storeArray));
-                       $GLOBALS["SOBE"]->MOD_SETTINGS = t3lib_BEfunc::getModuleData($GLOBALS["SOBE"]->MOD_MENU, $writeArray, $GLOBALS["SOBE"]->MCONF["name"], "ses");
+                       $writeArray['storeArray']=serialize($storeArray);
+                       $writeArray['storeQueryConfigs']=serialize($this->cleanStoreQueryConfigs($storeQueryConfigs,$storeArray));
+                       $GLOBALS['SOBE']->MOD_SETTINGS = t3lib_BEfunc::getModuleData($GLOBALS['SOBE']->MOD_MENU, $writeArray, $GLOBALS['SOBE']->MCONF['name'], 'ses');
                }
                return $msg;
        }
@@ -341,20 +341,20 @@ class t3lib_fullsearch {
 
                $msg=$this->procesStoreControl();
 
-               $output.= $GLOBALS["SOBE"]->doc->section('Load/Save Query',$this->makeStoreControl(),0,1);
+               $output.= $GLOBALS['SOBE']->doc->section('Load/Save Query',$this->makeStoreControl(),0,1);
                if ($msg)       {
-                       $output.= $GLOBALS["SOBE"]->doc->section('','<font color=red><strong>'.$msg.'</strong></font>');
+                       $output.= $GLOBALS['SOBE']->doc->section('','<font color=red><strong>'.$msg.'</strong></font>');
                }
-               $output.= $GLOBALS["SOBE"]->doc->spacer(20);
+               $output.= $GLOBALS['SOBE']->doc->spacer(20);
 
 
                        // Query Maker:
-               $qGen = t3lib_div::makeInstance("t3lib_queryGenerator");
-               $qGen->init("queryConfig",$GLOBALS["SOBE"]->MOD_SETTINGS["queryTable"]);
-               $tmpCode=$qGen->makeSelectorTable($GLOBALS["SOBE"]->MOD_SETTINGS);
-               $output.= $GLOBALS["SOBE"]->doc->section('Make query',$tmpCode,0,1);
+               $qGen = t3lib_div::makeInstance('t3lib_queryGenerator');
+               $qGen->init('queryConfig',$GLOBALS['SOBE']->MOD_SETTINGS['queryTable']);
+               $tmpCode=$qGen->makeSelectorTable($GLOBALS['SOBE']->MOD_SETTINGS);
+               $output.= $GLOBALS['SOBE']->doc->section('Make query',$tmpCode,0,1);
 
-               $mQ = $GLOBALS["SOBE"]->MOD_SETTINGS["search_query_makeQuery"];
+               $mQ = $GLOBALS['SOBE']->MOD_SETTINGS['search_query_makeQuery'];
 
                        // Make form elements:
                if ($qGen->table && is_array($TCA[$qGen->table]))       {
@@ -365,26 +365,26 @@ class t3lib_fullsearch {
 //                             debug($qGen->queryConfig);
 
                                switch($mQ)     {
-                                       case "count":
+                                       case 'count':
                                                $qExplain = $GLOBALS['TYPO3_DB']->SELECTquery('count(*)', $qGen->table, $qString.t3lib_BEfunc::deleteClause($qGen->table));
                                        break;
                                        default:
                                                $qExplain = $qGen->getSelectQuery($qString);
-                                               if ($mQ=="explain")     {
-                                                       $qExplain="EXPLAIN ".$qExplain;
+                                               if ($mQ=='explain')     {
+                                                       $qExplain='EXPLAIN '.$qExplain;
                                                }
                                        break;
                                }
 
-                               $output.= $GLOBALS["SOBE"]->doc->section('SQL query',$this->tableWrap(htmlspecialchars($qExplain)),0,1);
+                               $output.= $GLOBALS['SOBE']->doc->section('SQL query',$this->tableWrap(htmlspecialchars($qExplain)),0,1);
 
                                $res = @$GLOBALS['TYPO3_DB']->sql(TYPO3_db,$qExplain);
                                if ($GLOBALS['TYPO3_DB']->sql_error())  {
-                                       $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);
+                                       $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);
-                                       $output.=$GLOBALS["SOBE"]->doc->section($cPR["header"],$cPR["content"],0,1);
+                                       $output.=$GLOBALS['SOBE']->doc->section($cPR['header'],$cPR['content'],0,1);
                                }
                        }
                }
@@ -401,65 +401,65 @@ class t3lib_fullsearch {
         */
        function getQueryResultCode($mQ,$res,$table)    {
                global $TCA;
-               $output="";
+               $output='';
                $cPR=array();
                switch($mQ)     {
-                       case "count":
+                       case 'count':
                                $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
-                               $cPR["header"]='Count';
-                               $cPR["content"]="<BR><strong>".$row[0]. "</strong> records selected.";
+                               $cPR['header']='Count';
+                               $cPR['content']='<BR><strong>'.$row[0]. '</strong> records selected.';
                        break;
-                       case "all":
+                       case 'all':
                                $rowArr=array();
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                        $rowArr[]=$this->resultRowDisplay($row,$TCA[$table],$table);
                                        $lrow=$row;
                                }
                                if (count($rowArr))     {
-                                       $out.="<table border=0 cellpadding=2 cellspacing=1>".$this->resultRowTitles($lrow,$TCA[$table],$table).implode(chr(10),$rowArr)."</table>";
+                                       $out.='<table border="0" cellpadding="2" cellspacing="1">'.$this->resultRowTitles($lrow,$TCA[$table],$table).implode(chr(10),$rowArr).'</table>';
                                }
-                               if (!$out)      $out="<em>No rows selected!</em>";
-                               $cPR["header"]='Result';
-                               $cPR["content"]=$out;
+                               if (!$out)      $out='<em>No rows selected!</em>';
+                               $cPR['header']='Result';
+                               $cPR['content']=$out;
                        break;
-                       case "csv":
+                       case 'csv':
                                $rowArr=array();
                                $first=1;
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                        if ($first)     {
-                                               $rowArr[]=$this->csvValues(array_keys($row),",","");
+                                               $rowArr[]=$this->csvValues(array_keys($row),',','');
                                                $first=0;
                                        }
                                        $rowArr[]=$this->csvValues($row);
                                }
                                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(chr(10),$rowArr)).'</textarea>';
+                                       $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea(implode(chr(10),$rowArr)).'</textarea>';
                                        if (!$this->noDownloadB)        {
                                                $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">';               // document.forms[0].target=\'_blank\';
                                        }
                                                // Downloads file:
-                                       if (t3lib_div::_GP("download_file"))    {
-                                               $filename="TYPO3_".$table."_export_".date("dmy-Hi").".csv";
-                                               $mimeType = "application/octet-stream";
-                                               Header("Content-Type: ".$mimeType);
-                                               Header("Content-Disposition: attachment; filename=".$filename);
+                                       if (t3lib_div::_GP('download_file'))    {
+                                               $filename='TYPO3_'.$table.'_export_'.date('dmy-Hi').'.csv';
+                                               $mimeType = 'application/octet-stream';
+                                               header('Content-Type: '.$mimeType);
+                                               header('Content-Disposition: attachment; filename='.$filename);
                                                echo implode(chr(13).chr(10),$rowArr);
                                                exit;
                                        }
                                }
-                               if (!$out)      $out="<em>No rows selected!</em>";
-                               $cPR["header"]='Result';
-                               $cPR["content"]=$out;
+                               if (!$out)      $out='<em>No rows selected!</em>';
+                               $cPR['header']='Result';
+                               $cPR['content']=$out;
                        break;
-                       case "xml":
-                               $className=t3lib_div::makeInstanceClassName("t3lib_xml");
-                               $xmlObj = new $className("typo3_export");
+                       case 'xml':
+                               $className=t3lib_div::makeInstanceClassName('t3lib_xml');
+                               $xmlObj = new $className('typo3_export');
                                $xmlObj->includeNonEmptyValues=1;
                                $xmlObj->renderHeader();
                                $first=1;
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                        if ($first)     {
-                                               $xmlObj->setRecFields($table,implode(",",array_keys($row)));
+                                               $xmlObj->setRecFields($table,implode(',',array_keys($row)));
                //                              debug($xmlObj->XML_recFields);
                                                $first=0;
                                        }
@@ -468,31 +468,31 @@ class t3lib_fullsearch {
                                $xmlObj->renderFooter();
                                if ($GLOBALS['TYPO3_DB']->sql_num_rows($res))   {
                                        $xmlData=$xmlObj->getResult();
-                                       $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS["SOBE"]->doc->formWidthText($this->formW,"","off").' class="fixed-font">'.t3lib_div::formatForTextarea($xmlData).'</textarea>';
+                                       $out.='<textarea name="whatever" rows="20" wrap="off"'.$GLOBALS['SOBE']->doc->formWidthText($this->formW,'','off').' class="fixed-font">'.t3lib_div::formatForTextarea($xmlData).'</textarea>';
                                        if (!$this->noDownloadB)        {
                                                $out.='<BR><input type="submit" name="download_file" value="Click to download file" onClick="document.location=\''.$this->downloadScript.'\';">';               // document.forms[0].target=\'_blank\';
                                        }
                                                // Downloads file:
-                                       if (t3lib_div::_GP("download_file"))    {
-                                               $filename="TYPO3_".$table."_export_".date("dmy-Hi").".xml";
-                                               $mimeType = "application/octet-stream";
-                                               Header("Content-Type: ".$mimeType);
-                                               Header("Content-Disposition: attachment; filename=".$filename);
+                                       if (t3lib_div::_GP('download_file'))    {
+                                               $filename='TYPO3_'.$table.'_export_'.date('dmy-Hi').'.xml';
+                                               $mimeType = 'application/octet-stream';
+                                               Header('Content-Type: '.$mimeType);
+                                               Header('Content-Disposition: attachment; filename='.$filename);
                                                echo $xmlData;
                                                exit;
                                        }
                                }
-                               if (!$out)      $out="<em>No rows selected!</em>";
-                               $cPR["header"]='Result';
-                               $cPR["content"]=$out;
+                               if (!$out)      $out='<em>No rows selected!</em>';
+                               $cPR['header']='Result';
+                               $cPR['content']=$out;
                        break;
-                       case "explain":
+                       case 'explain':
                        default:
                                while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
-                                       $out.="<BR>".t3lib_div::view_array($row);
+                                       $out.='<BR>'.t3lib_div::view_array($row);
                                }
-                               $cPR["header"]='Explain SQL query';
-                               $cPR["content"]=$out;
+                               $cPR['header']='Explain SQL query';
+                               $cPR['content']=$out;
                        break;
                }
                return $cPR;
@@ -506,7 +506,7 @@ class t3lib_fullsearch {
         * @param       [type]          $quote: ...
         * @return      [type]          ...
         */
-       function csvValues($row,$delim=",",$quote='"')  {
+       function csvValues($row,$delim=',',$quote='"')  {
                return t3lib_div::csvValues($row,$delim,$quote);
        }
 
@@ -517,7 +517,7 @@ class t3lib_fullsearch {
         * @return      [type]          ...
         */
        function tableWrap($str)        {
-               return '<table border=0 cellpadding=10 cellspacing=0 class="bgColor4"><tr><td nowrap><pre>'.$str.'</pre></td></tr></table>';
+               return '<table border="0" cellpadding="10" cellspacing="0" class="bgColor4"><tr><td nowrap><pre>'.$str.'</pre></td></tr></table>';
        }
 
        /**
@@ -527,8 +527,8 @@ class t3lib_fullsearch {
         */
        function search()       {
                global $TCA;
-               $SET = t3lib_div::_GP("SET");
-               $swords = $SET["sword"];
+               $SET = t3lib_div::_GP('SET');
+               $swords = $SET['sword'];
 
                $limit=200;
                $showAlways=0;
@@ -539,9 +539,9 @@ class t3lib_fullsearch {
                                t3lib_div::loadTCA($table);
                                $conf=$TCA[$table];
 
-                               reset($conf["columns"]);
+                               reset($conf['columns']);
                                $list=array();
-                               while(list($field,)=each($conf["columns"]))     {
+                               while(list($field,)=each($conf['columns']))     {
                                        $list[]=$field;
                                }
                                        // Get query
@@ -552,8 +552,8 @@ class t3lib_fullsearch {
                                list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                                if($count || $showAlways)       {
                                                // Output header:
-                                       $out.="<strong>TABLE:</strong> ".$GLOBALS["LANG"]->sL($conf["ctrl"]["title"])."<BR>";
-                                       $out.="<strong>Results:</strong> ".$count."<BR>";
+                                       $out.='<strong>TABLE:</strong> '.$GLOBALS['LANG']->sL($conf['ctrl']['title']).'<BR>';
+                                       $out.='<strong>Results:</strong> '.$count.'<BR>';
 
                                                // Show to limit
                                        if ($count)     {
@@ -563,9 +563,9 @@ class t3lib_fullsearch {
                                                        $rowArr[]=$this->resultRowDisplay($row,$conf,$table);
                                                        $lrow=$row;
                                                }
-                                               $out.="<table border=0 cellpadding=2 cellspacing=1>".$this->resultRowTitles($lrow,$conf,$table).implode(chr(10),$rowArr)."</table>";
+                                               $out.='<table border="0" cellpadding="2" cellspacing="1">'.$this->resultRowTitles($lrow,$conf,$table).implode(chr(10),$rowArr).'</table>';
                                        }
-                                       $out.="<HR>";
+                                       $out.='<HR>';
                                }
                        }
                }
@@ -584,12 +584,12 @@ class t3lib_fullsearch {
                $out='<tr class="bgColor4">';
                reset($row);
                while(list($fN,$fV)=each($row)) {
-                       $TDparams = " nowrap";
+                       $TDparams = ' nowrap';
                        $fVnew = t3lib_BEfunc::getProcessedValueExtra($table,$fN,$fV);
                        $out.='<td'.$TDparams.'>'.htmlspecialchars($fVnew).'</td>';
                }
-               $params = '&edit['.$table.']['.$row["uid"].']=edit';
-               $out.='<td nowrap><A HREF="#" onClick="top.launchView(\''.$table.'\','.$row["uid"].',\''.$GLOBALS["BACK_PATH"].'\');return false;"><img src="'.$GLOBALS["BACK_PATH"].'gfx/zoom2.gif" width="12" height="12" alt="" /></a><A HREF="#" onClick="'.t3lib_BEfunc::editOnClick($params,$GLOBALS["BACK_PATH"],t3lib_div::getIndpEnv("REQUEST_URI").t3lib_div::implodeArrayForUrl("SET",t3lib_div::_POST("SET"))).'"><img src="'.$GLOBALS["BACK_PATH"].'gfx/edit2.gif" width="11" height="12" border="0" alt=""></a></td>
+               $params = '&edit['.$table.']['.$row['uid'].']=edit';
+               $out.='<td nowrap><a href="#" onClick="top.launchView(\''.$table.'\','.$row['uid'].',\''.$GLOBALS['BACK_PATH'].'\');return false;"><img src="'.$GLOBALS['BACK_PATH'].'gfx/zoom2.gif" width="12" height="12" alt="" /></a><a href="#" onClick="'.t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'],t3lib_div::getIndpEnv('REQUEST_URI').t3lib_div::implodeArrayForUrl('SET',t3lib_div::_POST('SET'))).'"><img src="'.$GLOBALS['BACK_PATH'].'gfx/edit2.gif" width="11" height="12" border="0" alt=""></a></td>
                </tr>
                ';
                return $out;
@@ -607,8 +607,8 @@ class t3lib_fullsearch {
                $out='<tr class="bgColor5">';
                reset($row);
                while(list($fN,$fV)=each($row)) {
-                       if (strlen($fV)<50)             {$TDparams = " nowrap";} else {$TDparams = "";}
-                       $out.='<td'.$TDparams.'><strong>'.$GLOBALS["LANG"]->sL($conf["columns"][$fN]["label"]?$conf["columns"][$fN]["label"]:$fN,1).'</strong></td>';
+                       if (strlen($fV)<50)             {$TDparams = ' nowrap';} else {$TDparams = '';}
+                       $out.='<td'.$TDparams.'><strong>'.$GLOBALS['LANG']->sL($conf['columns'][$fN]['label']?$conf['columns'][$fN]['label']:$fN,1).'</strong></td>';
                }
                $out.='<td nowrap></td>
                </tr>
@@ -617,7 +617,7 @@ class t3lib_fullsearch {
        }
 }
 
-if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["t3lib/class.t3lib_fullsearch.php"])       {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["t3lib/class.t3lib_fullsearch.php"]);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php'])       {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_fullsearch.php']);
 }
 ?>
\ No newline at end of file
index dc96653..6e40eb5 100755 (executable)
  *
  *   95: class t3lib_queryGenerator
  *  176:     function makeFieldList()
- *  203:     function init($name,$table,$fieldList="")
- *  292:     function setAndCleanUpExternalLists($name,$list,$force="")
- *  308:     function procesData($qC="")
+ *  203:     function init($name,$table,$fieldList='')
+ *  292:     function setAndCleanUpExternalLists($name,$list,$force='')
+ *  308:     function procesData($qC='')
  *  411:     function cleanUpQueryConfig($queryConfig)
- *  468:     function getFormElements($subLevel=0,$queryConfig="",$parent="")
+ *  468:     function getFormElements($subLevel=0,$queryConfig='',$parent='')
  *  555:     function printCodeArray($codeArr,$l=0)
  *  578:     function formatQ($str)
  *  591:     function mkOperatorSelect($name,$op,$draw,$submit)
- *  613:     function mkTypeSelect($name,$fieldName,$prepend="FIELD_")
+ *  613:     function mkTypeSelect($name,$fieldName,$prepend='FIELD_')
  *  632:     function verifyType($fieldName)
  *  649:     function verifyComparison($comparison,$neg)
  *  668:     function mkFieldToInputSelect($name,$fieldName)
  *  744:     function initUserDef()
  *  753:     function userDef()
  *  762:     function userDefCleanUp($queryConfig)
- *  773:     function getQuery ($queryConfig,$pad="")
+ *  773:     function getQuery ($queryConfig,$pad='')
  *  803:     function getQuerySingle($conf,$first)
- *  824:     function cleanInputVal($conf,$suffix="")
+ *  824:     function cleanInputVal($conf,$suffix='')
  *  843:     function getUserDefQuery ($qcArr)
  *  851:     function updateIcon()
  *  860:     function getLabelCol()
- *  872:     function makeSelectorTable($modSettings,$enableList="table,fields,query,group,order,limit")
- *  976:     function getSelectQuery($qString="")
- *  996:     function JSbottom($formname="forms[0]")
+ *  872:     function makeSelectorTable($modSettings,$enableList='table,fields,query,group,order,limit')
+ *  976:     function getSelectQuery($qString='')
+ *  996:     function JSbottom($formname='forms[0]')
  * 1002:     function typo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue)
  * 1020:     function typo3FormFieldGet(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off)
  *
  * TOTAL FUNCTIONS: 30
- * (This index is automatically created/updated by the extension "extdeveval")
+ * (This index is automatically created/updated by the extension 'extdeveval')
  *
  */
 
  */
 class t3lib_queryGenerator     {
        var $lang = array(
-               "OR" => "or",
-               "AND" => "and",
-               "comparison" => array(
+               'OR' => 'or',
+               'AND' => 'and',
+               'comparison' => array(
                                 // Type = text offset = 0
-                       "0_" => "contains",
-                       "1_" => "does not contain",
-                       "2_" => "starts with",
-                       "3_" => "does not start with",
-                       "4_" => "ends with",
-                       "5_" => "does not end with",
-                       "6_" => "equals",
-                       "7_" => "does not equal",
+                       '0_' => 'contains',
+                       '1_' => 'does not contain',
+                       '2_' => 'starts with',
+                       '3_' => 'does not start with',
+                       '4_' => 'ends with',
+                       '5_' => 'does not end with',
+                       '6_' => 'equals',
+                       '7_' => 'does not equal',
                                 // Type = date,number ,        offset = 32
-                       "32_" => "equals",
-                       "33_" => "does not equal",
-                       "34_" => "is greater than",
-                       "35_" => "is less than",
-                       "36_" => "is between",
-                       "37_" => "is not between",
-                       "38_" => "is in list",
-                       "39_" => "is not in list",
-                       "40_" => "binary AND equals",
-                       "41_" => "binary AND does not equal",
-                       "42_" => "binary OR equals",
-                       "43_" => "binary OR does not equal"
+                       '32_' => 'equals',
+                       '33_' => 'does not equal',
+                       '34_' => 'is greater than',
+                       '35_' => 'is less than',
+                       '36_' => 'is between',
+                       '37_' => 'is not between',
+                       '38_' => 'is in list',
+                       '39_' => 'is not in list',
+                       '40_' => 'binary AND equals',
+                       '41_' => 'binary AND does not equal',
+                       '42_' => 'binary OR equals',
+                       '43_' => 'binary OR does not equal'
                )
        );
 
        var $compSQL = array(
                        // Type = text  offset = 0
-               "0" => "#FIELD# LIKE '%#VALUE#%'",
-               "1" => "#FIELD# NOT LIKE '%#VALUE#%'",
-               "2" => "#FIELD# LIKE '#VALUE#%'",
-               "3" => "#FIELD# NOT LIKE '#VALUE#%'",
-               "4" => "#FIELD# LIKE '%#VALUE#'",
-               "5" => "#FIELD# NOT LIKE '%#VALUE#'",
-               "6" => "#FIELD# = '#VALUE#'",
-               "7" => "#FIELD# != '#VALUE#'",
+               '0' => "#FIELD# LIKE '%#VALUE#%'",
+               '1' => "#FIELD# NOT LIKE '%#VALUE#%'",
+               '2' => "#FIELD# LIKE '#VALUE#%'",
+               '3' => "#FIELD# NOT LIKE '#VALUE#%'",
+               '4' => "#FIELD# LIKE '%#VALUE#'",
+               '5' => "#FIELD# NOT LIKE '%#VALUE#'",
+               '6' => "#FIELD# = '#VALUE#'",
+               '7' => "#FIELD# != '#VALUE#'",
                        // Type = date,number , offset = 32
-               "32" => "#FIELD# = '#VALUE#'",
-               "33" => "#FIELD# != '#VALUE#'",
-               "34" => "#FIELD# > #VALUE#",
-               "35" => "#FIELD# < #VALUE#",
-               "36" => "#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#",
-               "37" => "NOT (#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#)",
-               "38" => "#FIELD# IN (#VALUE#)",
-               "39" => "#FIELD# NOT IN (#VALUE#)",
-               "40" => "(#FIELD# & #VALUE#)=#VALUE#",
-               "41" => "(#FIELD# & #VALUE#)!=#VALUE#",
-               "42" => "(#FIELD# | #VALUE#)=#VALUE#",
-               "43" => "(#FIELD# | #VALUE#)!=#VALUE#"
+               '32' => "#FIELD# = '#VALUE#'",
+               '33' => "#FIELD# != '#VALUE#'",
+               '34' => '#FIELD# > #VALUE#',
+               '35' => '#FIELD# < #VALUE#',
+               '36' => '#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#',
+               '37' => 'NOT (#FIELD# >= #VALUE# AND #FIELD# <= #VALUE1#)',
+               '38' => '#FIELD# IN (#VALUE#)',
+               '39' => '#FIELD# NOT IN (#VALUE#)',
+               '40' => '(#FIELD# & #VALUE#)=#VALUE#',
+               '41' => '(#FIELD# & #VALUE#)!=#VALUE#',
+               '42' => '(#FIELD# | #VALUE#)=#VALUE#',
+               '43' => '(#FIELD# | #VALUE#)!=#VALUE#'
        );
 
        var $comp_offsets = array(
-               "text" => 0,
-               "number" => 1,
-               "date" => 1
+               'text' => 0,
+               'number' => 1,
+               'date' => 1
        );
-       var $noWrap=" nowrap";
+       var $noWrap=' nowrap';
 
        var $name;                      // Form data name prefix
        var $table;                     // table for the query
@@ -162,7 +162,7 @@ class t3lib_queryGenerator  {
        var $queryConfig=array(); // The query config
        var $enablePrefix=0;
        var $enableQueryParts = 0;
-       var $extJSCODE="";
+       var $extJSCODE='';
 
 
 
@@ -178,18 +178,18 @@ class t3lib_queryGenerator        {
                $fieldListArr = array();
                if (is_array($TCA[$this->table]))       {
                        t3lib_div::loadTCA($this->table);
-                       reset($TCA[$this->table]["columns"]);
-                       while(list($fN)=each($TCA[$this->table]["columns"]))    {
+                       reset($TCA[$this->table]['columns']);
+                       while(list($fN)=each($TCA[$this->table]['columns']))    {
                                $fieldListArr[]=$fN;
                        }
-                       $fieldListArr[]="uid";
-                       $fieldListArr[]="pid";
-                       if ($TCA[$this->table]["ctrl"]["tstamp"])       $fieldListArr[]=$TCA[$this->table]["ctrl"]["tstamp"];
-                       if ($TCA[$this->table]["ctrl"]["crdate"])       $fieldListArr[]=$TCA[$this->table]["ctrl"]["crdate"];
-                       if ($TCA[$this->table]["ctrl"]["cruser_id"])    $fieldListArr[]=$TCA[$this->table]["ctrl"]["cruser_id"];
-                       if ($TCA[$this->table]["ctrl"]["sortby"])       $fieldListArr[]=$TCA[$this->table]["ctrl"]["sortby"];
+                       $fieldListArr[]='uid';
+                       $fieldListArr[]='pid';
+                       if ($TCA[$this->table]['ctrl']['tstamp'])       $fieldListArr[]=$TCA[$this->table]['ctrl']['tstamp'];
+                       if ($TCA[$this->table]['ctrl']['crdate'])       $fieldListArr[]=$TCA[$this->table]['ctrl']['crdate'];
+                       if ($TCA[$this->table]['ctrl']['cruser_id'])    $fieldListArr[]=$TCA[$this->table]['ctrl']['cruser_id'];
+                       if ($TCA[$this->table]['ctrl']['sortby'])       $fieldListArr[]=$TCA[$this->table]['ctrl']['sortby'];
                }
-               return implode(",",$fieldListArr);
+               return implode(',',$fieldListArr);
        }
 
        /**
@@ -200,7 +200,7 @@ class t3lib_queryGenerator  {
         * @param       [type]          $fieldList: ...
         * @return      [type]          ...
         */
-       function init($name,$table,$fieldList="")       {
+       function init($name,$table,$fieldList='')       {
                global $TCA;
 
                        // Analysing the fields in the table.
@@ -210,35 +210,35 @@ class t3lib_queryGenerator        {
                        $this->table = $table;
                        $this->fieldList = $fieldList ? $fieldList : $this->makeFieldList();
 
-                       $fieldArr = t3lib_div::trimExplode(",",$this->fieldList,1);
+                       $fieldArr = t3lib_div::trimExplode(',',$this->fieldList,1);
                        reset($fieldArr);
                        while(list(,$fN)=each($fieldArr))       {
-                               $fC = $TCA[$this->table]["columns"][$fN];
-                               if (is_array($fC) && $fC["label"])      {
-                                       $this->fields[$fN]["label"] = ereg_replace(":$","",trim($GLOBALS["LANG"]->sL($fC["label"])));
-                                       switch($fC["config"]["type"])   {
-                                               case "input":
-                                                       if (eregi("int|year",$fC["config"]["eval"]))    {
-                                                               $this->fields[$fN]["type"]="number";
-                                                       } elseif (eregi("date|time",$fC["config"]["eval"]))     {
-                                                               $this->fields[$fN]["type"]="date";
+                               $fC = $TCA[$this->table]['columns'][$fN];
+                               if (is_array($fC) && $fC['label'])      {
+                                       $this->fields[$fN]['label'] = ereg_replace(':$','',trim($GLOBALS['LANG']->sL($fC['label'])));
+                                       switch($fC['config']['type'])   {
+                                               case 'input':
+                                                       if (eregi('int|year',$fC['config']['eval']))    {
+                                                               $this->fields[$fN]['type']='number';
+                                                       } elseif (eregi('date|time',$fC['config']['eval']))     {
+                                                               $this->fields[$fN]['type']='date';
                                                        } else {
-                                                               $this->fields[$fN]["type"]="text";
+                                                               $this->fields[$fN]['type']='text';
                                                        }
                                                break;
-                                               case "check":
-                                               case "select":
-                                                       $this->fields[$fN]["type"]="number";
+                                               case 'check':
+                                               case 'select':
+                                                       $this->fields[$fN]['type']='number';
                                                break;
-                                               case "text":
+                                               case 'text':
                                                default:
-                                                       $this->fields[$fN]["type"]="text";
+                                                       $this->fields[$fN]['type']='text';
                                                break;
                                        }
 
                                } else {
-                                       $this->fields[$fN]["label"]="[FIELD: ".$fN."]";
-                                       $this->fields[$fN]["type"]="number";
+                                       $this->fields[$fN]['label']='[FIELD: '.$fN.']';
+                                       $this->fields[$fN]['type']='number';
                                }
                        }
                }
@@ -246,35 +246,35 @@ class t3lib_queryGenerator        {
                /*      // EXAMPLE:
                $this->queryConfig = array(
                        array(
-                               "operator" => "AND",
-                               "type" => "FIELD_spaceBefore",
+                               'operator' => 'AND',
+                               'type' => 'FIELD_spaceBefore',
                        ),
                        array(
-                               "operator" => "AND",
-                               "type" => "FIELD_records",
-                               "negate" => 1,
-                               "inputValue" => "foo foo"
+                               'operator' => 'AND',
+                               'type' => 'FIELD_records',
+                               'negate' => 1,
+                               'inputValue' => 'foo foo'
                        ),
                        array(
-                               "type" => "newlevel",
-                               "nl" => array(
+                               'type' => 'newlevel',
+                               'nl' => array(
                                        array(
-                                               "operator" => "AND",
-                                               "type" => "FIELD_spaceBefore",
-                                               "negate" => 1,
-                                               "inputValue" => "foo foo"
+                                               'operator' => 'AND',
+                                               'type' => 'FIELD_spaceBefore',
+                                               'negate' => 1,
+                                               'inputValue' => 'foo foo'
                                        ),
                                        array(
-                                               "operator" => "AND",
-                                               "type" => "FIELD_records",
-                                               "negate" => 1,
-                                               "inputValue" => "foo foo"
+                                               'operator' => 'AND',
+                                               'type' => 'FIELD_records',
+                                               'negate' => 1,
+                                               'inputValue' => 'foo foo'
                                        )
                                )
                        ),
                        array(
-                               "operator" => "OR",
-                               "type" => "FIELD_maillist",
+                               'operator' => 'OR',
+                               'type' => 'FIELD_maillist',
                        )
                );
                */
@@ -289,14 +289,14 @@ class t3lib_queryGenerator        {
         * @param       [type]          $force: ...
         * @return      [type]          ...
         */
-       function setAndCleanUpExternalLists($name,$list,$force="")      {
-               $fields = array_unique(t3lib_div::trimExplode(",",$list.",".$force,1));
+       function setAndCleanUpExternalLists($name,$list,$force='')      {
+               $fields = array_unique(t3lib_div::trimExplode(',',$list.','.$force,1));
                reset($fields);
                $reList=array();
                while(list(,$fN)=each($fields)) {
                        if ($this->fields[$fN])         $reList[]=$fN;
                }
-               $this->extFieldLists[$name]=implode(",",$reList);
+               $this->extFieldLists[$name]=implode(',',$reList);
        }
 
        /**
@@ -305,15 +305,15 @@ class t3lib_queryGenerator        {
         * @param       [type]          $qC: ...
         * @return      [type]          ...
         */
-       function procesData($qC="")     {
+       function procesData($qC='')     {
                $this->queryConfig = $qC;
 
                $POST = t3lib_div::_POST();
 
                // if delete...
-               if($POST["qG_del"]) {
+               if($POST['qG_del']) {
                        //initialize array to work on, save special parameters
-                       $ssArr = $this->getSubscript($POST["qG_del"]);
+                       $ssArr = $this->getSubscript($POST['qG_del']);
                        $workArr =& $this->queryConfig;
                        for($i=0;$i<sizeof($ssArr)-1;$i++) {
                                $workArr =& $workArr[$ssArr[$i]];
@@ -327,9 +327,9 @@ class t3lib_queryGenerator  {
                }
 
                // if insert...
-               if($POST["qG_ins"]) {
+               if($POST['qG_ins']) {
                        //initialize array to work on, save special parameters
-                       $ssArr = $this->getSubscript($POST["qG_ins"]);
+                       $ssArr = $this->getSubscript($POST['qG_ins']);
                        $workArr =& $this->queryConfig;
                        for($i=0;$i<sizeof($ssArr)-1;$i++) {
                                $workArr =& $workArr[$ssArr[$i]];
@@ -340,13 +340,13 @@ class t3lib_queryGenerator        {
                        }
                        //clear new entry position
                        unset($workArr[$ssArr[$i]+1]);
-                       $workArr[$ssArr[$i]+1]['type'] = "FIELD_";
+                       $workArr[$ssArr[$i]+1]['type'] = 'FIELD_';
                }
 
                // if move up...
-               if($POST["qG_up"]) {
+               if($POST['qG_up']) {
                        //initialize array to work on
-                       $ssArr = $this->getSubscript($POST["qG_up"]);
+                       $ssArr = $this->getSubscript($POST['qG_up']);
                        $workArr =& $this->queryConfig;
                        for($i=0;$i<sizeof($ssArr)-1;$i++) {
                                $workArr =& $workArr[$ssArr[$i]];
@@ -358,9 +358,9 @@ class t3lib_queryGenerator  {
                }
 
                // if new level...
-               if($POST["qG_nl"]) {
+               if($POST['qG_nl']) {
                        //initialize array to work on
-                       $ssArr = $this->getSubscript($POST["qG_nl"]);
+                       $ssArr = $this->getSubscript($POST['qG_nl']);
                        $workArr =& $this->queryConfig;
                        for($i=0;$i<sizeof($ssArr)-1;$i++) {
                                $workArr =& $workArr[$ssArr[$i]];
@@ -368,20 +368,20 @@ class t3lib_queryGenerator        {
                        // Do stuff:
                        $tempEl = $workArr[$ssArr[$i]];
                        if (is_array($tempEl))  {
-                               if ($tempEl["type"]!="newlevel")        {
+                               if ($tempEl['type']!='newlevel')        {
                                        $workArr[$ssArr[$i]]=array(
-                                               "type" => "newlevel",
-                                               "operator" => $tempEl["operator"],
-                                               "nl" => array($tempEl)
+                                               'type' => 'newlevel',
+                                               'operator' => $tempEl['operator'],
+                                               'nl' => array($tempEl)
                                        );
                                }
                        }
                }
 
                // if collapse level...
-               if($POST["qG_remnl"]) {
+               if($POST['qG_remnl']) {
                        //initialize array to work on
-                       $ssArr = $this->getSubscript($POST["qG_remnl"]);
+                       $ssArr = $this->getSubscript($POST['qG_remnl']);
                        $workArr =& $this->queryConfig;
                        for($i=0;$i<sizeof($ssArr)-1;$i++) {
                                $workArr =& $workArr[$ssArr[$i]];
@@ -390,12 +390,12 @@ class t3lib_queryGenerator        {
                        // Do stuff:
                        $tempEl = $workArr[$ssArr[$i]];
                        if (is_array($tempEl))  {
-                               if ($tempEl["type"]=="newlevel")        {
+                               if ($tempEl['type']=='newlevel')        {
                                        $a1 = array_slice($workArr,0,$ssArr[$i]);
                                        $a2 = array_slice($workArr,$ssArr[$i]);
                                        array_shift($a2);
-                                       $a3 = $tempEl["nl"];
-                                       $a3[0]["operator"] = $tempEl["operator"];
+                                       $a3 = $tempEl['nl'];
+                                       $a3[0]['operator'] = $tempEl['operator'];
                                        $workArr=array_merge($a1,$a3,$a2);
                                }
                        }
@@ -414,41 +414,41 @@ class t3lib_queryGenerator        {
                        ksort($queryConfig);
                } else {
                        //queryConfig should never be empty!
-                       if(!$queryConfig[0] || !$queryConfig[0]["type"]) $queryConfig[0] = array("type"=>"FIELD_");
+                       if(!$queryConfig[0] || !$queryConfig[0]['type']) $queryConfig[0] = array('type'=>'FIELD_');
                }
                        // Traverse:
                reset($queryConfig);
                $c=0;
                $arrCount=0;
                while(list($key,$conf)=each($queryConfig))      {
-                       if(substr($conf["type"],0,6)=="FIELD_") {
-                               $fName = substr($conf["type"],6);
-                               $fType = $this->fields[$fName]["type"];
-                       } elseif($conf["type"]=="newlevel") {
-                               $fType = $conf["type"];
+                       if(substr($conf['type'],0,6)=='FIELD_') {
+                               $fName = substr($conf['type'],6);
+                               $fType = $this->fields[$fName]['type'];
+                       } elseif($conf['type']=='newlevel') {
+                               $fType = $conf['type'];
                        } else {
-                               $fType = "ignore";
+                               $fType = 'ignore';
                        }
 //                     debug($fType);
                        switch($fType)  {
-                               case "newlevel":
-                                       if(!$queryConfig[$key]["nl"]) $queryConfig[$key]["nl"][0]["type"] = "FIELD_";
-                                       $queryConfig[$key]["nl"]=$this->cleanUpQueryConfig($queryConfig[$key]["nl"]);
+                               case 'newlevel':
+                                       if(!$queryConfig[$key]['nl']) $queryConfig[$key]['nl'][0]['type'] = 'FIELD_';
+                                       $queryConfig[$key]['nl']=$this->cleanUpQueryConfig($queryConfig[$key]['nl']);
                                break;
-                               case "userdef":
+                               case 'userdef':
                                        $queryConfig[$key]=$this->userDefCleanUp($queryConfig[$key]);
                                break;
-                               case "ignore":
+                               case 'ignore':
                                default:
 //                                     debug($queryConfig[$key]);
                                        $verifiedName=$this->verifyType($fName);
-                                       $queryConfig[$key]["type"]="FIELD_".$this->verifyType($verifiedName);
+                                       $queryConfig[$key]['type']='FIELD_'.$this->verifyType($verifiedName);
 
-                                       if($conf["comparison"] >> 5 != $this->comp_offsets[$fType]) $conf["comparison"] = $this->comp_offsets[$fType] << 5;
-                                       $queryConfig[$key]["comparison"]=$this->verifyComparison($conf["comparison"],$conf["negate"]?1:0);
+                                       if($conf['comparison'] >> 5 != $this->comp_offsets[$fType]) $conf['comparison'] = $this->comp_offsets[$fType] << 5;
+                                       $queryConfig[$key]['comparison']=$this->verifyComparison($conf['comparison'],$conf['negate']?1:0);
 
-                                       $queryConfig[$key]["inputValue"]=$this->cleanInputVal($queryConfig[$key]);
-                                       $queryConfig[$key]["inputValue1"]=$this->cleanInputVal($queryConfig[$key],1);
+                                       $queryConfig[$key]['inputValue']=$this->cleanInputVal($queryConfig[$key]);
+                                       $queryConfig[$key]['inputValue1']=$this->cleanInputVal($queryConfig[$key],1);
 
 //                                     debug($queryConfig[$key]);
                        break;
@@ -465,7 +465,7 @@ class t3lib_queryGenerator  {
         * @param       [type]          $parent: ...
         * @return      [type]          ...
         */
-       function getFormElements($subLevel=0,$queryConfig="",$parent="")        {
+       function getFormElements($subLevel=0,$queryConfig='',$parent='')        {
                $codeArr=array();
                if (!is_array($queryConfig))    $queryConfig=$this->queryConfig;
 
@@ -473,68 +473,68 @@ class t3lib_queryGenerator        {
                $c=0;
                $arrCount=0;
                while(list($key,$conf)=each($queryConfig))      {
-                       $subscript = $parent."[$key]";
-                       $lineHTML = "";
-                       $lineHTML.=$this->mkOperatorSelect($this->name.$subscript,$conf["operator"],$c,($conf["type"]!="FIELD_"));
-                       if(substr($conf["type"],0,6)=="FIELD_") {
-                               $fName = substr($conf["type"],6);
-                               $fType = $this->fields[$fName]["type"];
-                               if($conf["comparison"] >> 5 != $this->comp_offsets[$fType]) $conf["comparison"] = $this->comp_offsets[$fType] << 5;
+                       $subscript = $parent.'[$key]';
+                       $lineHTML = '';
+                       $lineHTML.=$this->mkOperatorSelect($this->name.$subscript,$conf['operator'],$c,($conf['type']!='FIELD_'));
+                       if(substr($conf['type'],0,6)=='FIELD_') {
+                               $fName = substr($conf['type'],6);
+                               $fType = $this->fields[$fName]['type'];
+                               if($conf['comparison'] >> 5 != $this->comp_offsets[$fType]) $conf['comparison'] = $this->comp_offsets[$fType] << 5;
 
                                //nasty nasty...
                                //make sure queryConfig contains _actual_ comparevalue.
                                //mkCompSelect don't care, but getQuery does.
-                               $queryConfig[$key]["comparison"] += (isset($conf["negate"])-($conf["comparison"]%2));
+                               $queryConfig[$key]['comparison'] += (isset($conf['negate'])-($conf['comparison']%2));
 
-                       } elseif($conf["type"]=="newlevel") {
-                               $fType = $conf["type"];
+                       } elseif($conf['type']=='newlevel') {
+                               $fType = $conf['type'];
                        } else {
-                               $fType = "ignore";
+                               $fType = 'ignore';
                        }
 //                     debug($fType);
                        switch($fType)  {
-                               case "ignore":
+                               case 'ignore':
                                break;
-                               case "newlevel":
-                                       if(!$queryConfig[$key]["nl"]) $queryConfig[$key]["nl"][0]["type"] = "FIELD_";
+                               case 'newlevel':
+                                       if(!$queryConfig[$key]['nl']) $queryConfig[$key]['nl'][0]['type'] = 'FIELD_';
                                        $lineHTML.='<input type="hidden" name="'.$this->name.$subscript.'[type]" value="newlevel">';
-                                       $codeArr[$arrCount]["sub"] = $this->getFormElements($subLevel+1,$queryConfig[$key]["nl"],$subscript."[nl]");
+                                       $codeArr[$arrCount]['sub'] = $this->getFormElements($subLevel+1,$queryConfig[$key]['nl'],$subscript.'[nl]');
                                break;
-                               case "userdef":
+                               case 'userdef':
                                         $lineHTML.=$this->userDef($this->name.$subscript,$conf,$fName,$fType);
                                break;
                                default:
                                        $lineHTML.=$this->mkTypeSelect($this->name.$subscript.'[type]',$fName);
-                                       $lineHTML.=$this->mkCompSelect($this->name.$subscript.'[comparison]',$conf["comparison"],$conf["negate"]?1:0);
-                                       $lineHTML.='<input type="checkbox" '.($conf["negate"]?"checked":"").' name="'.$this->name.$subscript.'[negate]'.'" onClick="submit();">';
-
-                                       if ($conf["comparison"]==37 || $conf["comparison"]==36) {       // between:
-                                               $lineHTML.='<input type="text" value="'.htmlspecialchars($conf["inputValue"]).'" name="'.$this->name.$subscript.'[inputValue]'.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(5).'>
-                                               <input type="text" value="'.htmlspecialchars($conf["inputValue1"]).'" name="'.$this->name.$subscript.'[inputValue1]'.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(5).'>
-                                               ';      // onChange="submit();"
-                                       } elseif ($fType=="date") {
-                                               $lineHTML.='<input type="text" name="'.$this->name.$subscript.'[inputValue]_hr'.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(10).' onChange="typo3FormFieldGet(\''.$this->name.$subscript.'[inputValue]\', \'datetime\', \'\', 0,0);"><input type="hidden" value="'.htmlspecialchars($conf["inputValue"]).'" name="'.$this->name.$subscript.'[inputValue]'.'">';
+                                       $lineHTML.=$this->mkCompSelect($this->name.$subscript.'[comparison]',$conf['comparison'],$conf['negate']?1:0);
+                                       $lineHTML.='<input type="checkbox" '.($conf['negate']?'checked':'').' name="'.$this->name.$subscript.'[negate]'.'" onClick="submit();">';
+
+                                       if ($conf['comparison']==37 || $conf['comparison']==36) {       // between:
+                                               $lineHTML.='<input type="text" value="'.htmlspecialchars($conf['inputValue']).'" name="'.$this->name.$subscript.'[inputValue]'.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(5).'>
+                                               <input type="text" value="'.htmlspecialchars($conf['inputValue1']).'" name="'.$this->name.$subscript.'[inputValue1]'.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(5).'>
+                                               ';      // onChange='submit();'
+                                       } elseif ($fType=='date') {
+                                               $lineHTML.='<input type="text" name="'.$this->name.$subscript.'[inputValue]_hr'.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(10).' onChange="typo3FormFieldGet(\''.$this->name.$subscript.'[inputValue]\', \'datetime\', \'\', 0,0);"><input type="hidden" value="'.htmlspecialchars($conf['inputValue']).'" name="'.$this->name.$subscript.'[inputValue]'.'">';
                                                $this->extJSCODE.='typo3FormFieldSet("'.$this->name.$subscript.'[inputValue]", "datetime", "", 0,0);';
                                        } else {
-                                               $lineHTML.='<input type="text" value="'.htmlspecialchars($conf["inputValue"]).'" name="'.$this->name.$subscript.'[inputValue]'.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(10).'>'; // onChange="submit();"
+                                               $lineHTML.='<input type="text" value="'.htmlspecialchars($conf['inputValue']).'" name="'.$this->name.$subscript.'[inputValue]'.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(10).'>'; // onChange="submit();"
                                        }
                                break;
                        }
-                       if($fType != "ignore") {
+                       if($fType != 'ignore') {
                                $lineHTML .= $this->updateIcon();
-                               $lineHTML .= '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/garbage.gif" class="absmiddle" width="11" height="12" hspace=3 vspace=3 title="Remove condition" name="qG_del'.$subscript.'">';
-                               $lineHTML .= '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/add.gif" class="absmiddle" width="12" height="12" hspace=3 vspace=3 title="Add condition" name="qG_ins'.$subscript.'">';
-                               if($c!=0) $lineHTML.= '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/pil2up.gif" class="absmiddle" width="12" height="7" hspace=3 vspace=3 title="Move up" name="qG_up'.$subscript.'">';
+                               $lineHTML .= '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/garbage.gif" class="absmiddle" width="11" height="12" hspace="3" vspace="3" title="Remove condition" name="qG_del'.$subscript.'">';
+                               $lineHTML .= '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/add.gif" class="absmiddle" width="12" height="12" hspace="3" vspace="3" title="Add condition" name="qG_ins'.$subscript.'">';
+                               if($c!=0) $lineHTML.= '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/pil2up.gif" class="absmiddle" width="12" height="7" hspace="3" vspace="3" title="Move up" name="qG_up'.$subscript.'">';
 
-                               if($c!=0 && $fType!="newlevel") {
-                                       $lineHTML.= '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/pil2right.gif" class="absmiddle" height="12" width="7" hspace=3 vspace=3 title="New level" name="qG_nl'.$subscript.'">';
+                               if($c!=0 && $fType!='newlevel') {
+                                       $lineHTML.= '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/pil2right.gif" class="absmiddle" height="12" width="7" hspace="3" vspace="3" title="New level" name="qG_nl'.$subscript.'">';
                                }
-                               if($fType=="newlevel") {
-                                       $lineHTML.= '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/pil2left.gif" class="absmiddle" height="12" width="7" hspace=3 vspace=3 title="Collapse new level" name="qG_remnl'.$subscript.'">';
+                               if($fType=='newlevel') {
+                                       $lineHTML.= '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/pil2left.gif" class="absmiddle" height="12" width="7" hspace="3" vspace="3" title="Collapse new level" name="qG_remnl'.$subscript.'">';
                                }
 
-                               $codeArr[$arrCount]["html"] = $lineHTML;
-                               $codeArr[$arrCount]["query"] = $this->getQuerySingle($conf,$c>0?0:1);
+                               $codeArr[$arrCount]['html'] = $lineHTML;
+                               $codeArr[$arrCount]['query'] = $this->getQuerySingle($conf,$c>0?0:1);
                                $arrCount++;
                                $c++;
                        }
@@ -554,18 +554,18 @@ class t3lib_queryGenerator        {
         */
        function printCodeArray($codeArr,$l=0)  {
                reset($codeArr);
-               $line="";
+               $line='';
                if ($l)         $indent='<td><img height="1" width="50"></td>';
                $lf=$l*30;
-               $bgColor = t3lib_div::modifyHTMLColor($GLOBALS["TBE_TEMPLATE"]->bgColor2,$lf,$lf,$lf);
+               $bgColor = t3lib_div::modifyHTMLColor($GLOBALS['TBE_TEMPLATE']->bgColor2,$lf,$lf,$lf);
                while(list($k,$v)=each($codeArr))       {
-                       $line.= '<tr>'.$indent.'<td bgcolor="'.$bgColor.'"'.$this->noWrap.'>'.$v["html"].'</td></tr>';
-                       if ($this->enableQueryParts)    {$line.= '<tr>'.$indent.'<td>'.$this->formatQ($v["query"]).'</td></tr>';}
-                       if (is_array($v["sub"]))        {
-                               $line.= '<tr>'.$indent.'<td'.$this->noWrap.'>'.$this->printCodeArray($v["sub"],$l+1).'</td></tr>';
+                       $line.= '<tr>'.$indent.'<td bgcolor="'.$bgColor.'"'.$this->noWrap.'>'.$v['html'].'</td></tr>';
+                       if ($this->enableQueryParts)    {$line.= '<tr>'.$indent.'<td>'.$this->formatQ($v['query']).'</td></tr>';}
+                       if (is_array($v['sub']))        {
+                               $line.= '<tr>'.$indent.'<td'.$this->noWrap.'>'.$this->printCodeArray($v['sub'],$l+1).'</td></tr>';
                        }
                }
-               $out='<table border=0 cellpadding=0 cellspacing=1>'.$line.'</table>';
+               $out='<table border="0" cellpadding="0" cellspacing="1">'.$line.'</table>';
                return $out;
        }
 
@@ -576,7 +576,7 @@ class t3lib_queryGenerator  {
         * @return      [type]          ...
         */
        function formatQ($str)  {
-               return '<font size=1 face=verdana color=maroon><i>'.$str.'</i></font>';
+               return '<font size="1" face="verdana" color="maroon"><i>'.$str.'</i></font>';
        }
 
        /**
@@ -592,7 +592,7 @@ class t3lib_queryGenerator  {
                if ($draw)      {
                        $out='<select name="'.$name.'[operator]"'.($submit?' onChange="submit();"':'').'>';     //
                        $out.='<option value="AND"'.(!$op||$op=="AND" ? ' selected':'').'>'.$this->lang["AND"].'</option>';
-                       $out.='<option value="OR"'.($op=="OR" ? ' selected':'').'>'.$this->lang["OR"].'</option>';
+                       $out.='<option value="OR"'.($op=='OR' ? ' selected':'').'>'.$this->lang['OR'].'</option>';
                        $out.='</select>';
                } else {
                        $out.='<input type="hidden" value="'.$op.'" name="'.$name.'[operator]">';
@@ -610,13 +610,13 @@ class t3lib_queryGenerator        {
         * @param       [type]          $prepend: ...
         * @return      [type]          ...
         */
-       function mkTypeSelect($name,$fieldName,$prepend="FIELD_")       {
+       function mkTypeSelect($name,$fieldName,$prepend='FIELD_')       {
                $out='<select name="'.$name.'" onChange="submit();">';
                $out.='<option value=""></option>';
                reset($this->fields);
                while(list($key,)=each($this->fields)) {
-                       if ($GLOBALS["BE_USER"]->check("non_exclude_fields",$this->table.":".$key))     {
-                               $out.='<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]["label"].'</option>';
+                       if ($GLOBALS['BE_USER']->check('non_exclude_fields',$this->table.':'.$key))     {
+                               $out.='<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]['label'].'</option>';
                        }
                }
                $out.='</select>';
@@ -631,7 +631,7 @@ class t3lib_queryGenerator  {
         */
        function verifyType($fieldName) {
                reset($this->fields);
-               $first = "";
+               $first = '';
                while(list($key,)=each($this->fields)) {
                        if (!$first)    $first = $key;
                        if ($key==$fieldName) return $key;
@@ -666,13 +666,13 @@ class t3lib_queryGenerator        {
         * @return      [type]          ...
         */
        function mkFieldToInputSelect($name,$fieldName) {
-               $out='<input type="Text" value="'.htmlspecialchars($fieldName).'" name="'.$name.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth().'>'.$this->updateIcon();
-               $out.='<a href="#" onClick="document.forms[0][\''.$name.'\'].value=\'\';return false;"><img src="'.$GLOBALS["BACK_PATH"].'gfx/garbage.gif" class="absmiddle" width="11" height="12" hspace=3 vspace=3 title="Clear list" border=0></a>';
-               $out.='<BR><select name="_fieldListDummy" size=5 onChange="document.forms[0][\''.$name.'\'].value+=\',\'+this.value">';
+               $out='<input type="Text" value="'.htmlspecialchars($fieldName).'" name="'.$name.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth().'>'.$this->updateIcon();
+               $out.='<a href="#" onClick="document.forms[0][\''.$name.'\'].value=\'\';return false;"><img src="'.$GLOBALS['BACK_PATH'].'gfx/garbage.gif" class="absmiddle" width="11" height="12" hspace="3" vspace="3" title="Clear list" border="0"></a>';
+               $out.='<BR><select name="_fieldListDummy" size="5" onChange="document.forms[0][\''.$name.'\'].value+=\',\'+this.value">';
                reset($this->fields);
                while(list($key,)=each($this->fields)) {
-                       if ($GLOBALS["BE_USER"]->check("non_exclude_fields",$this->table.":".$key))     {
-                               $out.='<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]["label"].'</option>';
+                       if ($GLOBALS['BE_USER']->check('non_exclude_fields',$this->table.':'.$key))     {
+                               $out.='<option value="'.$prepend.$key.'"'.($key==$fieldName ? ' selected':'').'>'.$this->fields[$key]['label'].'</option>';
                        }
                }
                $out.='</select>';
@@ -692,8 +692,8 @@ class t3lib_queryGenerator  {
                $out.='<option value=""></option>';
                reset($TCA);
                while(list($tN)=each($TCA)) {
-                       if ($GLOBALS["BE_USER"]->check("tables_select",$tN))    {
-                               $out.='<option value="'.$tN.'"'.($tN==$cur ? ' selected':'').'>'.$GLOBALS["LANG"]->sl($TCA[$tN]["ctrl"]["title"]).'</option>';
+                       if ($GLOBALS['BE_USER']->check('tables_select',$tN))    {
+                               $out.='<option value="'.$tN.'"'.($tN==$cur ? ' selected':'').'>'.$GLOBALS['LANG']->sl($TCA[$tN]['ctrl']['title']).'</option>';
                        }
                }
                $out.='</select>';
@@ -712,8 +712,8 @@ class t3lib_queryGenerator  {
                $compOffSet = $comparison >> 5;
                $out='<select name="'.$name.'" onChange="submit();">';
                for($i=32*$compOffSet+$neg;$i<32*($compOffSet+1);$i+=2) {
-                       if($this->lang["comparison"][$i."_"]) {
-                               $out.='<option value="'.$i.'"'.(($i >> 1)==($comparison >> 1) ? ' selected':'').'>'.$this->lang["comparison"][$i."_"].'</option>';
+                       if($this->lang['comparison'][$i.'_']) {
+                               $out.='<option value="'.$i.'"'.(($i >> 1)==($comparison >> 1) ? ' selected':'').'>'.$this->lang['comparison'][$i.'_'].'</option>';
                        }
                }
                $out.='</select>';
@@ -770,8 +770,8 @@ class t3lib_queryGenerator  {
         * @param       [type]          $pad: ...
         * @return      [type]          ...
         */
-       function getQuery ($queryConfig,$pad="") {
-               $qs = "";
+       function getQuery ($queryConfig,$pad='') {
+               $qs = '';
                        // Since we don't traverse the array using numeric keys in the upcoming whileloop make sure it's fresh and clean
                ksort($queryConfig);
                reset($queryConfig);
@@ -824,14 +824,14 @@ class t3lib_queryGenerator        {
         * @param       [type]          $suffix: ...
         * @return      [type]          ...
         */
-       function cleanInputVal($conf,$suffix="")        {
-               if(($conf["comparison"] >> 5==0) || ($conf["comparison"]==32 || $conf["comparison"]==33))       {
-                       $inputVal = $conf["inputValue".$suffix];
+       function cleanInputVal($conf,$suffix='')        {
+               if(($conf['comparison'] >> 5==0) || ($conf['comparison']==32 || $conf['comparison']==33))       {
+                       $inputVal = $conf['inputValue'.$suffix];
                } else {
-                       if ($conf["comparison"]==39 || $conf["comparison"]==38) {       // in list:
-                               $inputVal = implode(",",t3lib_div::intExplode(",",$conf["inputValue".$suffix]));
+                       if ($conf['comparison']==39 || $conf['comparison']==38) {       // in list:
+                               $inputVal = implode(',',t3lib_div::intExplode(',',$conf['inputValue'.$suffix]));
                        } else {
-                               $inputVal = doubleval($conf["inputValue".$suffix]);
+                               $inputVal = doubleval($conf['inputValue'.$suffix]);
                        }
                }
                return $inputVal;
@@ -852,7 +852,7 @@ class t3lib_queryGenerator  {
         * @return      [type]          ...
         */
        function updateIcon()   {
-               return '<input type="image" border=0 src="'.$GLOBALS["BACK_PATH"].'gfx/refresh_n.gif" class="absmiddle" width="14" height="14" hspace=3 vspace=3 title="Update" name="just_update">';
+               return '<input type="image" border="0" src="'.$GLOBALS['BACK_PATH'].'gfx/refresh_n.gif" class="absmiddle" width="14" height="14" hspace="3" vspace="3" title="Update" name="just_update">';
        }
 
        /**
@@ -862,7 +862,7 @@ class t3lib_queryGenerator  {
         */
        function getLabelCol()  {
                global $TCA;
-               return $TCA[$this->table]["ctrl"]["label"];
+               return $TCA[$this->table]['ctrl']['label'];
        }
 
        /**
@@ -872,92 +872,92 @@ class t3lib_queryGenerator        {
         * @param       [type]          $enableList: ...
         * @return      [type]          ...
         */
-       function makeSelectorTable($modSettings,$enableList="table,fields,query,group,order,limit")     {
-               $enableArr=explode(",",$enableList);
+       function makeSelectorTable($modSettings,$enableList='table,fields,query,group,order,limit')     {
+               $enableArr=explode(',',$enableList);
                        // Make output
                $TDparams = ' class="bgColor5" nowrap';
 
-               if (in_array("table",$enableArr))       {
+               if (in_array('table',$enableArr))       {
                        $out='
                        <tr>
                                <td'.$TDparams.'><strong>Select a table:</strong></td>
-                               <td'.$TDparams.'>'.$this->mkTableSelect("SET[queryTable]",$this->table).'</td>
+                               <td'.$TDparams.'>'.$this->mkTableSelect('SET[queryTable]',$this->table).'</td>
                        </tr>';
                }
                if ($this->table)       {
 
                                // Init fields:
-                       $this->setAndCleanUpExternalLists("queryFields",$modSettings["queryFields"],"uid,".$this->getLabelCol());
-                       $this->setAndCleanUpExternalLists("queryGroup",$modSettings["queryGroup"]);
-                       $this->setAndCleanUpExternalLists("queryOrder",$modSettings["queryOrder"].",".$modSettings["queryOrder2"]);
+                       $this->setAndCleanUpExternalLists('queryFields',$modSettings['queryFields'],'uid,'.$this->getLabelCol());
+                       $this->setAndCleanUpExternalLists('queryGroup',$modSettings['queryGroup']);
+                       $this->setAndCleanUpExternalLists('queryOrder',$modSettings['queryOrder'].','.$modSettings['queryOrder2']);
 
                                // Limit:
-                       $this->extFieldLists["queryLimit"]=$modSettings["queryLimit"];
-                       if (!$this->extFieldLists["queryLimit"])        $this->extFieldLists["queryLimit"]=100;
-                       $parts = t3lib_div::intExplode(",",$this->extFieldLists["queryLimit"]);
-                       $this->extFieldLists["queryLimit"] = implode(",",array_slice($parts,0,2));
+                       $this->extFieldLists['queryLimit']=$modSettings['queryLimit'];
+                       if (!$this->extFieldLists['queryLimit'])        $this->extFieldLists['queryLimit']=100;
+                       $parts = t3lib_div::intExplode(',',$this->extFieldLists['queryLimit']);
+                       $this->extFieldLists['queryLimit'] = implode(',',array_slice($parts,0,2));
 
                                // Insert Descending parts
-                       if ($this->extFieldLists["queryOrder"]) {
-                               $descParts = explode(",",$modSettings["queryOrderDesc"].",".$modSettings["queryOrder2Desc"]);
-                               $orderParts = explode(",",$this->extFieldLists["queryOrder"]);
+                       if ($this->extFieldLists['queryOrder']) {
+                               $descParts = explode(',',$modSettings['queryOrderDesc'].','.$modSettings['queryOrder2Desc']);
+                               $orderParts = explode(',',$this->extFieldLists['queryOrder']);
                                reset($orderParts);
                                $reList=array();
                                while(list($kk,$vv)=each($orderParts))  {
-                                       $reList[]=$vv.($descParts[$kk]?" DESC":"");
+                                       $reList[]=$vv.($descParts[$kk]?' DESC':'');
                                }
-                               $this->extFieldLists["queryOrder_SQL"] = implode(",",$reList);
+                               $this->extFieldLists['queryOrder_SQL'] = implode(',',$reList);
                        }
 
                                // Query Generator:
-                       $this->procesData($modSettings["queryConfig"] ? unserialize($modSettings["queryConfig"]) : "");
+                       $this->procesData($modSettings['queryConfig'] ? unserialize($modSettings['queryConfig']) : '');
        //              debug($this->queryConfig);
                        $this->queryConfig = $this->cleanUpQueryConfig($this->queryConfig);
        //              debug($this->queryConfig);
-                       $this->enableQueryParts = $modSettings["search_query_smallparts"];
+                       $this->enableQueryParts = $modSettings['search_query_smallparts'];
 
                        $codeArr=$this->getFormElements();
                        $queryCode=$this->printCodeArray($codeArr);
 
-                       if (in_array("fields",$enableArr))      {
+                       if (in_array('fields',$enableArr))      {
                                $out.='
                                <tr>
                                        <td'.$TDparams.'><strong>Select fields:</strong></td>
-                                       <td'.$TDparams.'>'.$this->mkFieldToInputSelect("SET[queryFields]",$this->extFieldLists["queryFields"]).'</td>
+                                       <td'.$TDparams.'>'.$this->mkFieldToInputSelect('SET[queryFields]',$this->extFieldLists['queryFields']).'</td>
                                </tr>';
                        }
-                       if (in_array("query",$enableArr))       {
+                       if (in_array('query',$enableArr))       {
                                $out.='<tr>
-                                       <td colspan=2'.$TDparams.'><strong>Make Query:</strong></td>
+                                       <td colspan="2"'.$TDparams.'><strong>Make Query:</strong></td>
                                </tr>
                                <tr>
-                                       <td colspan=2>'.$queryCode.'</td>
+                                       <td colspan="2">'.$queryCode.'</td>
                                </tr>
                                ';
                        }
-                       if (in_array("group",$enableArr))       {
+                       if (in_array('group',$enableArr))       {
                                $out.='<tr>
                                        <td'.$TDparams.'><strong>Group By:</strong></td>
-                                       <td'.$TDparams.'>'.$this->mkTypeSelect("SET[queryGroup]",$this->extFieldLists["queryGroup"],"").'</td>
+                                       <td'.$TDparams.'>'.$this->mkTypeSelect('SET[queryGroup]',$this->extFieldLists['queryGroup'],'').'</td>
                                </tr>';
                        }
-                       if (in_array("order",$enableArr))       {
-                               $orderByArr = explode(",",$this->extFieldLists["queryOrder"]);
+                       if (in_array('order',$enableArr))       {
+                               $orderByArr = explode(',',$this->extFieldLists['queryOrder']);
                //              debug($orderByArr);
-                               $orderBy="";
-                               $orderBy.=$this->mkTypeSelect("SET[queryOrder]",$orderByArr[0],"").
-                               "&nbsp;".t3lib_BEfunc::getFuncCheck($GLOBALS["SOBE"]->id,"SET[queryOrderDesc]",$modSettings["queryOrderDesc"])."&nbsp;Descending";
+                               $orderBy='';
+                               $orderBy.=$this->mkTypeSelect('SET[queryOrder]',$orderByArr[0],'').
+                               '&nbsp;'.t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id,'SET[queryOrderDesc]',$modSettings['queryOrderDesc']).'&nbsp;Descending';
                                if ($orderByArr[0])     {
-                                       $orderBy.= "<BR>".$this->mkTypeSelect("SET[queryOrder2]",$orderByArr[1],"").
-                                       "&nbsp;".t3lib_BEfunc::getFuncCheck($GLOBALS["SOBE"]->id,"SET[queryOrder2Desc]",$modSettings["queryOrder2Desc"])."&nbsp;Descending";
+                                       $orderBy.= '<BR>'.$this->mkTypeSelect('SET[queryOrder2]',$orderByArr[1],'').
+                                       '&nbsp;'.t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id,'SET[queryOrder2Desc]',$modSettings['queryOrder2Desc']).'&nbsp;Descending';
                                }
                                $out.='<tr>
                                        <td'.$TDparams.'><strong>Order By:</strong></td>
                                        <td'.$TDparams.'>'.$orderBy.'</td>
                                </tr>';
                        }
-                       if (in_array("limit",$enableArr))       {
-                               $limit = '<input type="Text" value="'.htmlspecialchars($this->extFieldLists["queryLimit"]).'" name="SET[queryLimit]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(10).'>'.$this->updateIcon();
+                       if (in_array('limit',$enableArr))       {
+                               $limit = '<input type="Text" value="'.htmlspecialchars($this->extFieldLists['queryLimit']).'" name="SET[queryLimit]"'.$GLOBALS['TBE_TEMPLATE']->formWidth(10).'>'.$this->updateIcon();
                                $out.='<tr>
                                        <td'.$TDparams.'><strong>Limit:</strong></td>
                                        <td'.$TDparams.'>'.$limit.'</td>
@@ -965,7 +965,7 @@ class t3lib_queryGenerator  {
                                ';
                        }
                }
-               $out='<table border=0 cellpadding=3 cellspacing=1>'.$out.'</table>';
+               $out='<table border="0" cellpadding="3" cellspacing="1">'.$out.'</table>';
                $out.=$this->JSbottom();
                return $out;
        }
@@ -976,16 +976,16 @@ class t3lib_queryGenerator        {
         * @param       [type]          $qString: ...
         * @return      [type]          ...
         */
-       function getSelectQuery($qString="")    {
+       function getSelectQuery($qString='')    {
                if (!$qString)  $qString=$this->getQuery($this->queryConfig);
 
                $query = $GLOBALS['TYPO3_DB']->SELECTquery(
-                                               $this->extFieldLists["queryFields"],
+                                               $this->extFieldLists['queryFields'],
                                                $this->table,
                                                $qString.t3lib_BEfunc::deleteClause($this->table),
-                                               trim($this->extFieldLists["queryGroup"]),
-                                               $this->extFieldLists["queryOrder"] ? trim($this->extFieldLists["queryOrder_SQL"]) : '',
-                                               $this->extFieldLists["queryLimit"]
+                                               trim($this->extFieldLists['queryGroup']),
+                                               $this->extFieldLists['queryOrder'] ? trim($this->extFieldLists['queryOrder_SQL']) : '',
+                                               $this->extFieldLists['queryLimit']
                                        );
                return $query;
        }
@@ -996,10 +996,10 @@ class t3lib_queryGenerator        {
         * @param       [type]          $formname: ...
         * @return      [type]          ...
         */
-       function JSbottom($formname="forms[0]") {
+       function JSbottom($formname='forms[0]') {
                if ($this->extJSCODE)   {
                        $out.='
-                       <script language="javascript" type="text/javascript" src="'.$GLOBALS["BACK_PATH"].'t3lib/jsfunc.evalfield.js"></script>
+                       <script language="javascript" type="text/javascript" src="'.$GLOBALS['BACK_PATH'].'t3lib/jsfunc.evalfield.js"></script>
                        <script language="javascript" type="text/javascript">
                                var evalFunc = new evalFunc;
                                function typo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue)  {
index 3e70af2..51a65bc 100755 (executable)
 
 
 unset($MCONF);
-require ("conf.php");
-require ($BACK_PATH."init.php");
-require ($BACK_PATH."template.php");
-require_once (PATH_t3lib."class.t3lib_admin.php");
-require_once (PATH_t3lib."class.t3lib_loaddbgroup.php");
-require_once (PATH_t3lib."class.t3lib_querygenerator.php");
-require_once (PATH_t3lib."class.t3lib_xml.php");
-require_once (PATH_t3lib."class.t3lib_fullsearch.php");
-require_once (PATH_t3lib."class.t3lib_refindex.php");
+require ('conf.php');
+require ($BACK_PATH.'init.php');
+require ($BACK_PATH.'template.php');
+require_once (PATH_t3lib.'class.t3lib_admin.php');
+require_once (PATH_t3lib.'class.t3lib_loaddbgroup.php');
+require_once (PATH_t3lib.'class.t3lib_querygenerator.php');
+require_once (PATH_t3lib.'class.t3lib_xml.php');
+require_once (PATH_t3lib.'class.t3lib_fullsearch.php');
+require_once (PATH_t3lib.'class.t3lib_refindex.php');
 
 $BE_USER->modAccess($MCONF,1);
 
@@ -52,33 +52,33 @@ $BE_USER->modAccess($MCONF,1);
 // Setting english (ONLY!) LOCAL_LANG
 // **************************
 $LOCAL_LANG = Array (
-       "default" => Array (
-               "tables" => "Tables:",
-               "fixLostRecord" => "Click to move this lost record to rootlevel (pid=0)",
-
-               "doktype" => "Document types:",
-               "pages" => "Pages:",
-               "total_pages" => "Total number of pages:",
-               "deleted_pages" => "Marked-deleted pages:",
-               "hidden_pages" => "Hidden pages:",
-               "relations" => "Relations:",
-               "relations_description" => "This will analyse the content of the tables and check if there are 'empty' relations between records or if files are missing from their expected position.",
-
-               "files_many_ref" => "Files referenced from more than one record:",
-               "files_no_ref" => "Files with no references at all (delete them!):",
-               "files_no_file" => "Missing files:",
-               "select_db" => "Select fields:",
-               "group_db" => "Group fields:",
-
-               "tree" => "The Page Tree:",
-               "tree_description" => "This shows all pages in the system in one large tree. Beware that this will probably result in a very long document which will also take some time for the server to compute!",
-               "records" => "Records Statistics:",
-               "records_description" => "This shows some statistics for the records in the database. This runs through the entire page-tree and therefore it will also load the server heavily!",
-               "search" => "Search Whole Database",
-               "search_description" => "This searches through all database tables and records for a text string.",
-               "filesearch" => "Search all filenames for pattern",
-               "filesearch_description" => "Will search recursively for filenames in the PATH_site (subdirs to the website path) matching a certain regex pattern.",
-               "title" => "Database integrity check"
+       'default' => Array (
+               'tables' => 'Tables:',
+               'fixLostRecord' => 'Click to move this lost record to rootlevel (pid=0)',
+
+               'doktype' => 'Document types:',
+               'pages' => 'Pages:',
+               'total_pages' => 'Total number of pages:',
+               'deleted_pages' => 'Marked-deleted pages:',
+               'hidden_pages' => 'Hidden pages:',
+               'relations' => 'Relations:',
+               'relations_description' => 'This will analyse the content of the tables and check if there are \'empty\' relations between records or if files are missing from their expected position.',
+
+               'files_many_ref' => 'Files referenced from more than one record:',
+               'files_no_ref' => 'Files with no references at all (delete them!):',
+               'files_no_file' => 'Missing files:',
+               'select_db' => 'Select fields:',
+               'group_db' => 'Group fields:',
+
+               'tree' => 'The Page Tree:',
+               'tree_description' => 'This shows all pages in the system in one large tree. Beware that this will probably result in a very long document which will also take some time for the server to compute!',
+               'records' => 'Records Statistics:',
+               'records_description' => 'This shows some statistics for the records in the database. This runs through the entire page-tree and therefore it will also load the server heavily!',
+               'search' => 'Search Whole Database',
+               'search_description' => 'This searches through all database tables and records for a text string.',
+               'filesearch' => 'Search all filenames for pattern',
+               'filesearch_description' => 'Will search recursively for filenames in the PATH_site (subdirs to the website path) matching a certain regex pattern.',
+               'title' => 'Database integrity check'
        )
 );
 
@@ -103,11 +103,11 @@ class SC_mod_tools_dbint_index {
         */
        function init() {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-               $this->MCONF = $GLOBALS["MCONF"];
+               $this->MCONF = $GLOBALS['MCONF'];
 
                $this->menuConfig();
 
-               $this->doc = t3lib_div::makeInstance("mediumDoc");
+               $this->doc = t3lib_div::makeInstance('mediumDoc');
                $this->doc->form='<form action="" method="POST">';
                $this->doc->backPath = $BACK_PATH;
                                // JavaScript
@@ -120,10 +120,10 @@ class SC_mod_tools_dbint_index {
                </script>
                ';
                $this->doc->tableLayout = Array (
-                       "defRow" => Array (
-                               "0" => Array('<TD valign="top">','</td>'),
-                               "1" => Array('<TD valign="top">','</td>'),
-                               "defCol" => Array('<TD><img src="'.$this->doc->backPath.'clear.gif" width=15 height=1></td><td valign="top">','</td>')
+                       'defRow' => Array (
+                               '0' => Array('<td valign="top">','</td>'),
+                               '1' => Array('<td valign="top">','</td>'),
+                               'defCol' => Array('<TD><img src="'.$this->doc->backPath.'clear.gif" width="15" height="1"></td><td valign="top">','</td>')
                        )
                );
        }
@@ -139,52 +139,51 @@ class SC_mod_tools_dbint_index {
                        // If empty string it's just a variable, that'll be saved.
                        // Values NOT in this array will not be saved in the settings-array for the module.
                $this->MOD_MENU = array(
-                       "function" => array(
-                               0 => "[ MENU ]",
-                               "records" => "Record Statistics",
-                               "tree" => "Total Page Tree",
-                               "relations" => "Database Relations",
-                               "search" => "Full search",
-                               "filesearch" => "Find filename",
+                       'function' => array(
+                               0 => '[ MENU ]',
+                               'records' => 'Record Statistics',
+                               'tree' => 'Total Page Tree',
+                               'relations' => 'Database Relations',
+                               'search' => 'Full search',
+                               'filesearch' => 'Find filename',
                                'refindex' => 'Manage Reference Index',
                        ),
-                       "search" => array(
-                               "raw" => "Raw search in all fields",
-                               "query" => "Advanced query"
+                       'search' => array(
+                               'raw' => 'Raw search in all fields',
+                               'query' => 'Advanced query'
                        ),
 
-                       "search_query_smallparts" => "",
-
-                       "queryConfig" => "",    // Current query
-                       "queryTable" => "",     // Current table
-                       "queryFields" => "",    // Current tableFields
-                       "queryLimit" => "",     // Current limit
-                       "queryOrder" => "",     // Current Order field
-                       "queryOrderDesc" => "", // Current Order field descending flag
-                       "queryOrder2" => "",    // Current Order2 field
-                       "queryOrder2Desc" => "",        // Current Order2 field descending flag
-                       "queryGroup" => "",     // Current Group field
-
-                       "storeArray" => "",     // Used to store the available Query config memory banks
-                       "storeQueryConfigs" => "",      // Used to store the available Query configs in memory
-
-                       "search_query_makeQuery" => array(
-                               "all" => "Select records",
-                               "count" => "Count results",
-                               "explain" => "Explain query",
-                               "csv" => "CSV Export",
-                               "xml" => "XML Export"
+                       'search_query_smallparts' => '',
+
+                       'queryConfig' => '',    // Current query
+                       'queryTable' => '',     // Current table
+                       'queryFields' => '',    // Current tableFields
+                       'queryLimit' => '',     // Current limit
+                       'queryOrder' => '',     // Current Order field
+                       'queryOrderDesc' => '', // Current Order field descending flag
+                       'queryOrder2' => '',    // Current Order2 field
+                       'queryOrder2Desc' => '',        // Current Order2 field descending flag
+                       'queryGroup' => '',     // Current Group field
+
+                       'storeArray' => '',     // Used to store the available Query config memory banks
+                       'storeQueryConfigs' => '',      // Used to store the available Query configs in memory
+
+                       'search_query_makeQuery' => array(
+                               'all' => 'Select records',
+                               'count' => 'Count results',
+                               'explain' => 'Explain query',
+                               'csv' => 'CSV Export',
+                               'xml' => 'XML Export'
                        ),
 
-
-                       "sword" => ""
+                       'sword' => ''
                );
                        // CLEANSE SETTINGS
-               $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP("SET"), $this->MCONF["name"], "ses");
+               $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], 'ses');
 
-               if (t3lib_div::_GP("queryConfig"))      {
-                       $qA = t3lib_div::_GP("queryConfig");
-                       $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, array("queryConfig"=>serialize($qA)), $this->MCONF["name"], "ses");
+               if (t3lib_div::_GP('queryConfig'))      {
+                       $qA = t3lib_div::_GP('queryConfig');
+                       $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, array('queryConfig'=>serialize($qA)), $this->MCONF['name'], 'ses');
                }
        }
 
@@ -197,23 +196,23 @@ class SC_mod_tools_dbint_index {
                // **************************
                // Content creation
                // **************************
-               $this->content.=$this->doc->startPage($LANG->getLL("title"));
-               $this->menu=t3lib_BEfunc::getFuncMenu(0,"SET[function]",$this->MOD_SETTINGS["function"],$this->MOD_MENU["function"]);
+               $this->content.=$this->doc->startPage($LANG->getLL('title'));
+               $this->menu=t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']);
 
-               switch($this->MOD_SETTINGS["function"]) {
-                       case "search":
+               switch($this->MOD_SETTINGS['function']) {
+                       case 'search':
                                $this->func_search();
                        break;
-                       case "tree":
+                       case 'tree':
                                $this->func_tree();
                        break;
-                       case "records":
+                       case 'records':
                                $this->func_records();
                        break;
-                       case "relations":
+                       case 'relations':
                                $this->func_relations();
                        break;
-                       case "filesearch":
+                       case 'filesearch':
                                $this->func_filesearch();
                        break;
                        case 'refindex':
@@ -226,7 +225,7 @@ class SC_mod_tools_dbint_index {
 
                if ($BE_USER->mayMakeShortcut())        {
                        $this->content.=$this->doc->spacer(20).
-                                               $this->doc->section('',$this->doc->makeShortcutIcon("","function,search,search_query_makeQuery",$this->MCONF["name"]));
+                                               $this->doc->section('',$this->doc->makeShortcutIcon('','function,search,search_query_makeQuery',$this->MCONF['name']));
                }
        }
 
@@ -306,23 +305,23 @@ class SC_mod_tools_dbint_index {
        function func_search()  {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
 
-               $fullsearch = t3lib_div::makeInstance("t3lib_fullsearch");
-               $this->content.=$this->doc->header($LANG->getLL("search"));
+               $fullsearch = t3lib_div::makeInstance('t3lib_fullsearch');
+               $this->content.=$this->doc->header($LANG->getLL('search'));
                $this->content.=$this->doc->spacer(5);
 
-               $menu2=t3lib_BEfunc::getFuncMenu(0,"SET[search]",$this->MOD_SETTINGS["search"],$this->MOD_MENU["search"]);
-               if ($this->MOD_SETTINGS["search"]=="query")     {
-                       $menu2.=t3lib_BEfunc::getFuncMenu(0,"SET[search_query_makeQuery]",$this->MOD_SETTINGS["search_query_makeQuery"],$this->MOD_MENU["search_query_makeQuery"]).
-                                       "&nbsp;".t3lib_BEfunc::getFuncCheck($GLOBALS["SOBE"]->id,"SET[search_query_smallparts]",$this->MOD_SETTINGS["search_query_smallparts"])."&nbsp;Show SQL parts";
+               $menu2=t3lib_BEfunc::getFuncMenu(0,'SET[search]',$this->MOD_SETTINGS['search'],$this->MOD_MENU['search']);
+               if ($this->MOD_SETTINGS['search']=='query')     {
+                       $menu2.=t3lib_BEfunc::getFuncMenu(0,'SET[search_query_makeQuery]',$this->MOD_SETTINGS['search_query_makeQuery'],$this->MOD_MENU['search_query_makeQuery']).
+                                       '&nbsp;'.t3lib_BEfunc::getFuncCheck($GLOBALS['SOBE']->id,'SET[search_query_smallparts]',$this->MOD_SETTINGS['search_query_smallparts']).'&nbsp;Show SQL parts';
                }
                $this->content.=$this->doc->section('',$this->menu);//$this->doc->divider(5);
                $this->content.=$this->doc->section('',$menu2).$this->doc->spacer(10);
 
-               switch($this->MOD_SETTINGS["search"])           {
-                       case "query":
+               switch($this->MOD_SETTINGS['search'])           {
+                       case 'query':
                                $this->content.=$fullsearch->queryMaker();
                        break;
-                       case "raw":
+                       case 'raw':
                        default:
                                $this->content.=$this->doc->section('Search options:',$fullsearch->form(),0,1);
                                $this->content.=$this->doc->section('Result:',$fullsearch->search(),0,1);
@@ -337,18 +336,18 @@ class SC_mod_tools_dbint_index {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
 
                $startID=0;
-               $admin = t3lib_div::makeInstance("t3lib_admin");
+               $admin = t3lib_div::makeInstance('t3lib_admin');
                $admin->genTree_makeHTML=1;
                $admin->backPath = $BACK_PATH;
-               $admin->genTree(intval($startID),'<img src="'.$BACK_PATH.'clear.gif" width=1 height=1 align=top>');
+               $admin->genTree(intval($startID),'<img src="'.$BACK_PATH.'clear.gif" width="1" height="1" align="top">');
 
-               $this->content.=$this->doc->header($LANG->getLL("tree"));
+               $this->content.=$this->doc->header($LANG->getLL('tree'));
                $this->content.=$this->doc->spacer(5);
                $this->content.=$this->doc->section('',$this->menu).$this->doc->divider(5);
                $this->content.=$this->doc->sectionEnd();
 
                $this->content.=$admin->genTree_HTML;
-               $this->content.=$admin->lostRecords($admin->genTree_idlist."0");
+               $this->content.=$admin->lostRecords($admin->genTree_idlist.'0');
        }
 
        /**
@@ -358,58 +357,58 @@ class SC_mod_tools_dbint_index {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
                global $PAGES_TYPES;
 
-               $admin = t3lib_div::makeInstance("t3lib_admin");
+               $admin = t3lib_div::makeInstance('t3lib_admin');
                $admin->genTree_makeHTML=0;
                $admin->backPath = $BACK_PATH;
                $admin->genTree(0,'');
 
-               $this->content.=$this->doc->header($LANG->getLL("records"));
+               $this->content.=$this->doc->header($LANG->getLL('records'));
                $this->content.=$this->doc->spacer(5);
                $this->content.=$this->doc->section('',$this->menu);
 
                        // Pages stat
                $codeArr=Array();
                $i++;
-               $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/pages.gif','width="18" height="16"').' hspace=4 align="top">';
-               $codeArr[$i][]=$LANG->getLL("total_pages");
+               $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/pages.gif','width="18" height="16"').' hspace="4" align="top">';
+               $codeArr[$i][]=$LANG->getLL('total_pages');
                $codeArr[$i][]=count($admin->page_idArray);
                $i++;
-               if (t3lib_extMgm::isLoaded("cms"))      {
-                       $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/hidden_page.gif','width="18" height="16"').' hspace=4 align="top">';
-                       $codeArr[$i][]=$LANG->getLL("hidden_pages");
-                       $codeArr[$i][]=$admin->recStat["hidden"];
+               if (t3lib_extMgm::isLoaded('cms'))      {
+                       $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/hidden_page.gif','width="18" height="16"').' hspace="4" align="top">';
+                       $codeArr[$i][]=$LANG->getLL('hidden_pages');
+                       $codeArr[$i][]=$admin->recStat['hidden'];
                        $i++;
                }
-               $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/deleted_page.gif','width="18" height="16"').' hspace=4 align="top">';
-               $codeArr[$i][]=$LANG->getLL("deleted_pages");
-               $codeArr[$i][]=$admin->recStat["deleted"];
+               $codeArr[$i][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/deleted_page.gif','width="18" height="16"').' hspace="4" align="top">';
+               $codeArr[$i][]=$LANG->getLL('deleted_pages');
+               $codeArr[$i][]=$admin->recStat['deleted'];
 
-               $this->content.=$this->doc->section($LANG->getLL("pages"),$this->doc->table($codeArr),0,1);
+               $this->content.=$this->doc->section($LANG->getLL('pages'),$this->doc->table($codeArr),0,1);
 
                        // Doktype
                $codeArr=Array();
-               $doktype=$TCA["pages"]["columns"]["doktype"]["config"]["items"];
+               $doktype=$TCA['pages']['columns']['doktype']['config']['items'];
                if (is_array($doktype)) {
                        reset($doktype);
                        while(list($n,$setup)=each($doktype))   {
-                               if ($setup[1]!="--div--")       {
-                                       $codeArr[$n][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/'.($PAGES_TYPES[$setup[1]]['icon'] ? $PAGES_TYPES[$setup[1]]['icon'] : $PAGES_TYPES["default"]['icon']),'width="18" height="16"').' hspace="4" align="top">';
+                               if ($setup[1]!='--div--')       {
+                                       $codeArr[$n][]='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/i/'.($PAGES_TYPES[$setup[1]]['icon'] ? $PAGES_TYPES[$setup[1]]['icon'] : $PAGES_TYPES['default']['icon']),'width="18" height="16"').' hspace="4" align="top">';
                                        $codeArr[$n][]=$LANG->sL($setup[0]).' ('.$setup[1].')';
                                        $codeArr[$n][]=intval($admin->recStat[doktype][$setup[1]]);
                                }
                        }
-                       $this->content.=$this->doc->section($LANG->getLL("doktype"),$this->doc->table($codeArr),0,1);
+                       $this->content.=$this->doc->section($LANG->getLL('doktype'),$this->doc->table($codeArr),0,1);
                }
 
                        // Tables and lost records
-               $id_list="0,".implode($admin->page_idArray,",");
+               $id_list='0,'.implode($admin->page_idArray,',');
                $id_list = t3lib_div::rm_endcomma($id_list);
                $admin->lostRecords($id_list);
                if ($admin->fixLostRecord(t3lib_div::_GET('fixLostRecords_table'),t3lib_div::_GET('fixLostRecords_uid')))       {
-                       $admin = t3lib_div::makeInstance("admin_int");
+                       $admin = t3lib_div::makeInstance('admin_int');
                        $admin->backPath = $BACK_PATH;
                        $admin->genTree(0,'');
-                       $id_list="0,".implode($admin->page_idArray,",");
+                       $id_list='0,'.implode($admin->page_idArray,',');
                        $id_list = t3lib_div::rm_endcomma($id_list);
                        $admin->lostRecords($id_list);
                }
@@ -420,30 +419,30 @@ class SC_mod_tools_dbint_index {
                        reset($TCA);
                        while(list($t)=each($TCA))      {
                                $codeArr[$t][]=t3lib_iconWorks::getIconImage($t,array(),$BACK_PATH,'hspace="4" align="top"');
-                               $codeArr[$t][]=$LANG->sL($TCA[$t]["ctrl"]["title"]);
+                               $codeArr[$t][]=$LANG->sL($TCA[$t]['ctrl']['title']);
                                $codeArr[$t][]=$t;
 
-                               if ($countArr["all"][$t])       {
-                                       $theNumberOfRe = intval($countArr["non_deleted"][$t])."/".(intval($countArr["all"][$t])-intval($countArr["non_deleted"][$t]));
+                               if ($countArr['all'][$t])       {
+                                       $theNumberOfRe = intval($countArr['non_deleted'][$t]).'/'.(intval($countArr['all'][$t])-intval($countArr['non_deleted'][$t]));
                                } else {
-                                       $theNumberOfRe ="";
+                                       $theNumberOfRe ='';
                                }
                                $codeArr[$t][]=$theNumberOfRe;
 
-                               $lr="";
+                               $lr='';
                                if (is_array($admin->lRecords[$t]))     {
                                        reset($admin->lRecords[$t]);
                                        while(list(,$data)=each($admin->lRecords[$t]))  {
                                                if (!t3lib_div::inList($admin->lostPagesList,$data[pid]))       {
-                                                       $lr.='<NOBR><b><A HREF="index.php?SET[function]=records&fixLostRecords_table='.$t.'&fixLostRecords_uid='.$data[uid].'"><img src="'.$BACK_PATH.'gfx/required_h.gif" width=10 hspace=3 height=10 border=0 align="top" title="'.$LANG->getLL("fixLostRecord").'"></a>uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</b></NOBR><BR>';
+                                                       $lr.='<nobr><b><a href="index.php?SET[function]=records&fixLostRecords_table='.$t.'&fixLostRecords_uid='.$data[uid].'"><img src="'.$BACK_PATH.'gfx/required_h.gif" width="10" hspace="3" height="10" border="0" align="top" title="'.$LANG->getLL('fixLostRecord').'"></a>uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</b></nobr><br>';
                                                } else {
-                                                       $lr.='<NOBR><img src="'.$BACK_PATH.'clear.gif" width=16 height=1 border=0><font color="Gray">uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</font></NOBR><BR>';
+                                                       $lr.='<nobr><img src="'.$BACK_PATH.'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:'.$data[uid].', pid:'.$data[pid].', '.t3lib_div::fixed_lgd(strip_tags($data[title]),20).'</font></nobr><br>';
                                                }
                                        }
                                }
                                $codeArr[$t][]=$lr;
                        }
-                       $this->content.=$this->doc->section($LANG->getLL("tables"),$this->doc->table($codeArr),0,1);
+                       $this->content.=$this->doc->section($LANG->getLL('tables'),$this->doc->table($codeArr),0,1);
                }
        }
 
@@ -453,47 +452,47 @@ class SC_mod_tools_dbint_index {
        function func_relations()       {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
 
-               $this->content.=$this->doc->header($LANG->getLL("relations"));
+               $this->content.=$this->doc->header($LANG->getLL('relations'));
                $this->content.=$this->doc->spacer(5);
                $this->content.=$this->doc->section('',$this->menu);
 
-               $admin = t3lib_div::makeInstance("t3lib_admin");
+               $admin = t3lib_div::makeInstance('t3lib_admin');
                $admin->genTree_makeHTML=0;
                $admin->backPath = $BACK_PATH;
 
-               $fkey_arrays = $admin->getGroupFields("");
+               $fkey_arrays = $admin->getGroupFields('');
                $admin->selectNonEmptyRecordsWithFkeys($fkey_arrays);
 
 
                $fileTest=$admin->testFileRefs();
 
-               $code="";
-               if (is_array($fileTest["noReferences"]))        {
-                       while(list(,$val)=each($fileTest["noReferences"]))      {
-                               $code.="<NOBR>".$val[0]."/<b>".$val[1]."</b></NOBR><BR>";
+               $code='';
+               if (is_array($fileTest['noReferences']))        {
+                       while(list(,$val)=each($fileTest['noReferences']))      {
+                               $code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b></nobr><br>';
                        }
                }
-               $this->content.=$this->doc->section($LANG->getLL("files_no_ref"),$code,1,1);
+               $this->content.=$this->doc->section($LANG->getLL('files_no_ref'),$code,1,1);
 
-               $code="";
+               $code='';
                if (is_array($fileTest[moreReferences]))        {
-                       while(list(,$val)=each($fileTest["moreReferences"]))    {
-                               $code.="<NOBR>".$val[0]."/<b>".$val[1]."</b>: ".$val[2]." references:</NOBR><BR>".$val[3]."<BR><BR>";
+                       while(list(,$val)=each($fileTest['moreReferences']))    {
+                               $code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b>: '.$val[2].' references:</nobr><br>'.$val[3].'<br><br>';
                        }
                }
-               $this->content.=$this->doc->section($LANG->getLL("files_many_ref"),$code,1,1);
-
-               $code="";
-               if (is_array($fileTest["noFile"]))      {
-                       ksort($fileTest["noFile"]);
-                       reset($fileTest["noFile"]);
-                       while(list(,$val)=each($fileTest["noFile"]))    {
-                               $code.="<NOBR>".$val[0]."/<b>".$val[1]."</b> is missing! </NOBR><BR>Referenced from: ".$val[2]."<BR><BR>";
+               $this->content.=$this->doc->section($LANG->getLL('files_many_ref'),$code,1,1);
+
+               $code='';
+               if (is_array($fileTest['noFile']))      {
+                       ksort($fileTest['noFile']);
+                       reset($fileTest['noFile']);
+                       while(list(,$val)=each($fileTest['noFile']))    {
+                               $code.='<nobr>'.$val[0].'/<b>'.$val[1].'</b> is missing! </nobr><br>Referenced from: '.$val[2].'<br><br>';
                        }
                }
-               $this->content.=$this->doc->section($LANG->getLL("files_no_file"),$code,1,1);
-               $this->content.=$this->doc->section($LANG->getLL("select_db"),$admin->testDBRefs($admin->checkSelectDBRefs),1,1);
-               $this->content.=$this->doc->section($LANG->getLL("group_db"),$admin->testDBRefs($admin->checkGroupDBRefs),1,1);
+               $this->content.=$this->doc->section($LANG->getLL('files_no_file'),$code,1,1);
+               $this->content.=$this->doc->section($LANG->getLL('select_db'),$admin->testDBRefs($admin->checkSelectDBRefs),1,1);
+               $this->content.=$this->doc->section($LANG->getLL('group_db'),$admin->testDBRefs($admin->checkGroupDBRefs),1,1);
        }
 
        /**
@@ -504,16 +503,16 @@ class SC_mod_tools_dbint_index {
        function func_filesearch()      {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
 
-               $this->content.=$this->doc->header($LANG->getLL("relations"));
+               $this->content.=$this->doc->header($LANG->getLL('relations'));
                $this->content.=$this->doc->spacer(5);
                $this->content.=$this->doc->section('',$this->menu);
 
 
-               $pattern = t3lib_div::_GP("pattern");
-               $pcontent='Enter regex pattern: <input type="text" name="pattern" value="'.htmlspecialchars($pattern?$pattern:$GLOBALS["TYPO3_CONF_VARS"]["BE"]["fileDenyPattern"]).'"> <input type="submit" name="Search">';
+               $pattern = t3lib_div::_GP('pattern');
+               $pcontent='Enter regex pattern: <input type="text" name="pattern" value="'.htmlspecialchars($pattern?$pattern:$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']).'"> <input type="submit" name="Search">';
                $this->content.=$this->doc->section('Pattern',$pcontent,0,1);
 
-               if (strcmp($pattern,""))        {
+               if (strcmp($pattern,''))        {
                        $dirs = t3lib_div::get_dirs(PATH_site);
        #               debug($dirs);
                        $lines=array();
@@ -521,22 +520,22 @@ class SC_mod_tools_dbint_index {
 
                        foreach ($dirs as $key => $value) {
                                $matching_files=array();
-                               $info="";
-                               if (!t3lib_div::inList("typo3,typo3conf,tslib,media,t3lib",$value))     {
-                                       $info = $this->findFile(PATH_site.$value."/",$pattern,$matching_files,$depth);
+                               $info='';
+                               if (!t3lib_div::inList('typo3,typo3conf,tslib,media,t3lib',$value))     {
+                                       $info = $this->findFile(PATH_site.$value.'/',$pattern,$matching_files,$depth);
                                }
                                if (is_array($info))    {
                                        $lines[]='<hr><b>'.$value.'/</b> being checked...';
                                        $lines[]='Dirs: '.$info[0];
                                        if ($info[2])   $lines[]='<span class="typo3-red">ERROR: Directories deeper than '.$depth.' levels</span>';
                                        $lines[]='Files: '.$info[1];
-                                       $lines[]='Matching files:<br><nobr><span class="typo3-red">'.implode("<br>",$matching_files).'</span></nobr>';
+                                       $lines[]='Matching files:<br><nobr><span class="typo3-red">'.implode('<br>',$matching_files).'</span></nobr>';
                                } else {
-                                       $lines[]=$GLOBALS["TBE_TEMPLATE"]->dfw('<hr><b>'.$value.'/</b> not checked.');
+                                       $lines[]=$GLOBALS['TBE_TEMPLATE']->dfw('<hr><b>'.$value.'/</b> not checked.');
                                }
                        }
 
-                       $this->content.=$this->doc->section('Searching for filenames:',implode("<BR>",$lines),0,1);
+                       $this->content.=$this->doc->section('Searching for filenames:',implode('<br>',$lines),0,1);
                }
        }
 
@@ -555,7 +554,7 @@ class SC_mod_tools_dbint_index {
                $dirs_error=0;
 
                        // Traverse files:
-               $files = t3lib_div::getFilesInDir($basedir,"",1);
+               $files = t3lib_div::getFilesInDir($basedir,'',1);
                if (is_array($files))   {
                        $files_searched+=count($files);
                        foreach ($files as $value) {
@@ -571,7 +570,7 @@ class SC_mod_tools_dbint_index {
                                $dirs_searched+=count($dirs);
 
                                foreach ($dirs as $value) {
-                                       $inf= $this->findFile($basedir.$value."/",$pattern,$matching_files,$depth-1);
+                                       $inf= $this->findFile($basedir.$value.'/',$pattern,$matching_files,$depth-1);
                                        $dirs_searched+=$inf[0];
                                        $files_searched+=$inf[1];
                                        $dirs_error=$inf[2];
@@ -595,21 +594,21 @@ class SC_mod_tools_dbint_index {
        function func_default() {
                global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
 
-               $this->content.=$this->doc->header($LANG->getLL("title"));
+               $this->content.=$this->doc->header($LANG->getLL('title'));
                $this->content.=$this->doc->spacer(5);
                $this->content.=$this->doc->section('',$this->menu);
-               $this->content.=$this->doc->section('<A HREF="index.php?SET[function]=records">'.$LANG->getLL("records").'</a>',$LANG->getLL("records_description"),1,1,0,1);
-               $this->content.=$this->doc->section('<A HREF="index.php?SET[function]=tree">'.$LANG->getLL("tree").'</a>',$LANG->getLL("tree_description"),1,1,0,1);
-               $this->content.=$this->doc->section('<A HREF="index.php?SET[function]=relations">'.$LANG->getLL("relations").'</a>',$LANG->getLL("relations_description"),1,1,0,1);
-               $this->content.=$this->doc->section('<A HREF="index.php?SET[function]=search">'.$LANG->getLL("search").'</a>',$LANG->getLL("search_description"),1,1,0,1);
-               $this->content.=$this->doc->section('<A HREF="index.php?SET[function]=filesearch">'.$LANG->getLL("filesearch").'</a>',$LANG->getLL("filesearch_description"),1,1,0,1);
+               $this->content.=$this->doc->section('<a href="index.php?SET[function]=records">'.$LANG->getLL('records').'</a>',$LANG->getLL('records_description'),1,1,0,1);
+               $this->content.=$this->doc->section('<a href="index.php?SET[function]=tree">'.$LANG->getLL('tree').'</a>',$LANG->getLL('tree_description'),1,1,0,1);
+               $this->content.=$this->doc->section('<a href="index.php?SET[function]=relations">'.$LANG->getLL('relations').'</a>',$LANG->getLL('relations_description'),1,1,0,1);
+               $this->content.=$this->doc->section('<a href="index.php?SET[function]=search">'.$LANG->getLL('search').'</a>',$LANG->getLL('search_description'),1,1,0,1);
+               $this->content.=$this->doc->section('<a href="index.php?SET[function]=filesearch">'.$LANG->getLL('filesearch').'</a>',$LANG->getLL('filesearch_description'),1,1,0,1);
                $this->content.=$this->doc->spacer(50);
        }
 }
 
 // Include extension?
-if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/dbint/index.php"])   {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/dbint/index.php"]);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/dbint/index.php'])   {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/dbint/index.php']);
 }
 
 
@@ -621,7 +620,7 @@ if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowleve
 
 
 // Make instance:
-$SOBE = t3lib_div::makeInstance("SC_mod_tools_dbint_index");
+$SOBE = t3lib_div::makeInstance('SC_mod_tools_dbint_index');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();