Added Feature #12138: Use flashmessages to display messages from tcemain
authorRupert Germann <rupi@gmx.li>
Mon, 19 Oct 2009 12:05:54 +0000 (12:05 +0000)
committerRupert Germann <rupi@gmx.li>
Mon, 19 Oct 2009 12:05:54 +0000 (12:05 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6168 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index fa68c50..4d8afd5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-10-19  Rupert Germann  <rupi@gmx.li>
 
+       * Added Feature #12138: Use flashmessages to display messages from tcemain
        * Fixed bug #12188: Double display of flashmessages
        * Fixed bug #11694: Table sys_refindex / KEY lookup_string not UTF-8 compatible  (thanks to Morton Jonuschat)
        * Fixed bug #11853: PHP warning in file module when uploading files with the flashuploader (thanks to Georg Ringer)
index 7a56f5b..9fd11d3 100644 (file)
@@ -7390,49 +7390,19 @@ State was change by %s (username: %s)
                                        'sys_log',
                                        'type=1 AND userid='.intval($this->BE_USER->user['uid']).' AND tstamp='.intval($GLOBALS['EXEC_TIME']).' AND error!=0'
                                );
-               $errorJS = array();
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_log)) {
                        $log_data = unserialize($row['log_data']);
-                       $errorJS[] = $row['error'].': '.sprintf($row['details'], $log_data[0],$log_data[1],$log_data[2],$log_data[3],$log_data[4]);
+                       $msg = $row['error'] . ': ' . sprintf($row['details'], $log_data[0], $log_data[1], $log_data[2], $log_data[3], $log_data[4]);
+                       $flashMessage = t3lib_div::makeInstance(
+                                               't3lib_FlashMessage',
+                                               $msg,
+                                               '',
+                                               t3lib_FlashMessage::ERROR,
+                                               TRUE
+                               );
+                       t3lib_FlashMessageQueue::addMessage($flashMessage);
                }
                $GLOBALS['TYPO3_DB']->sql_free_result($res_log);
-
-               if (count($errorJS))    {
-                       $error_doc = t3lib_div::makeInstance('template');
-                       $error_doc->backPath = $GLOBALS['BACK_PATH'];
-
-                       $content.= $error_doc->startPage('tce_db.php Error output');
-
-                       $lines[] = '
-                                       <tr class="bgColor5">
-                                               <td colspan="2" align="center"><strong>Errors:</strong></td>
-                                       </tr>';
-
-                       foreach($errorJS as $line)      {
-                               $lines[] = '
-                                       <tr class="bgColor4">
-                                               <td valign="top"><img'.t3lib_iconWorks::skinImg($error_doc->backPath,'gfx/icon_fatalerror.gif','width="18" height="16"').' alt="" /></td>
-                                               <td>'.htmlspecialchars($line).'</td>
-                                       </tr>';
-                       }
-
-                       $lines[] = '
-                                       <tr>
-                                               <td colspan="2" align="center"><br />'.
-                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('window.location.href=\''.$redirect.'\';return false;').'"></form>'.
-                                               '</td>
-                                       </tr>';
-
-                       $content.= '
-                               <br/><br/>
-                               <table border="0" cellpadding="1" cellspacing="1" width="300" align="center">
-                                       '.implode('',$lines).'
-                               </table>';
-
-                       $content.= $error_doc->endPage();
-                       echo $content;
-                       exit;
-               }
        }
 
        /*****************************