Fixed bug #8491: Template Analyzer Module inconsistencies (thanks to Steffen Kamper).
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_timetrack.php
index af35c9b..9789f52 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -217,15 +217,19 @@ class t3lib_timeTrack {
        /**
         * Set TSselectQuery - for messages in TypoScript debugger.
         *
-        * @param       string          Query string
+        * @param       array           Query array
         * @param       string          Message/Label to attach
         * @return      void
         */
-       function setTSselectQuery($query,$msg)  {
+       function setTSselectQuery(array $data,$msg='')  {
                end($this->currentHashPointer);
                $k = current($this->currentHashPointer);
 
-               $this->tsStackLog[$k]['selectQuery'][] = array('query'=>$query,'msg'=>$msg);
+               if (strlen($msg)) {
+                       $data['msg'] = $msg;
+               }
+
+               $this->tsStackLog[$k]['selectQuery'][] = $data;
        }
 
        /**
@@ -417,17 +421,7 @@ class t3lib_timeTrack {
                                }
                        }
                        if ($flag_queries && is_array($data['selectQuery'])) {
-                               reset($data['selectQuery']);
-                               while(list(,$v)=each($data['selectQuery'])) {
-                                       $res = $GLOBALS['TYPO3_DB']->sql_query('EXPLAIN '.$v['query']);
-                                       $v['mysql_error'] = $GLOBALS['TYPO3_DB']->sql_error();
-                                       if (!$GLOBALS['TYPO3_DB']->sql_error()) {
-                                               while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                                                       $v['explain'][]=$row;
-                                               }
-                                       }
-                                       $msgArr[] = t3lib_div::view_array($v);
-                               }
+                               $msgArr[] = t3lib_div::view_array($data['selectQuery']);
                        }
                        if ($flag_content && strcmp($data['content'],'')) {
                                $maxlen = 120;
@@ -541,7 +535,7 @@ class t3lib_timeTrack {
         * @return      string
         */
        function fw($str) {
-               return '<span style="font-family:Verdana,Arial,Helvetica,sans-serif; font-size:0.6em; color:black; vertical-align:top;">'.$str.'&nbsp;</span>';
+               return '<span style="font-family:Verdana,Arial,Helvetica,sans-serif; font-size:10px; color:black; vertical-align:top;">'.$str.'&nbsp;</span>';
        }
 
        /**