Added argument to debugRows() so it can return HTML instead of echo'ing
authorKasper Skårhøj <kasper@typo3.org>
Mon, 25 Jun 2007 10:03:59 +0000 (10:03 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Mon, 25 Jun 2007 10:03:59 +0000 (10:03 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2366 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_div.php

index 0f4255e..bfa3888 100755 (executable)
@@ -2903,9 +2903,10 @@ class t3lib_div {
         *
         * @param       array           Array of arrays with similar keys
         * @param       string          Table header
+        * @param       boolean         If TRUE, will return content instead of echo'ing out.
         * @return      void            Outputs to browser.
         */
-       function debugRows($rows,$header='')    {
+       function debugRows($rows,$header='',$returnHTML=FALSE)  {
                if (is_array($rows))    {
                        reset($rows);
                        $firstEl = current($rows);
@@ -2929,7 +2930,7 @@ class t3lib_div {
                                        $tCells = array();
                                        foreach($headerColumns as $key) {
                                                $tCells[] = '
-                                                       <td><font face="Verdana,Arial" size="1">'.htmlspecialchars($singleRow[$key]).'</font></td>';
+                                                       <td><font face="Verdana,Arial" size="1">'.(is_array($singleRow[$key]) ? t3lib_div::debugRows($singleRow[$key],'',TRUE) : htmlspecialchars($singleRow[$key])).'</font></td>';
                                        }
                                        $tRows[] = '
                                                <tr>'.implode('',$tCells).'
@@ -2939,7 +2940,7 @@ class t3lib_div {
                                $table = '
                                        <table border="1" cellpadding="1" cellspacing="0" bgcolor="white">'.implode('',$tRows).'
                                        </table>';
-                               echo $table;
+                               if ($returnHTML)        return $table; else echo $table;
                        } else debug('Empty array of rows',$header);
                } else debug('No array of rows',$header);
        }