Fixed bug #12188: Double display of flashmessages
authorRupert Germann <rupi@gmx.li>
Mon, 19 Oct 2009 11:59:31 +0000 (11:59 +0000)
committerRupert Germann <rupi@gmx.li>
Mon, 19 Oct 2009 11:59:31 +0000 (11:59 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6167 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/alt_db_navframe.php
typo3/alt_file_navframe.php
typo3/template.php

index 26b6d74..fa68c50 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-10-19  Rupert Germann  <rupi@gmx.li>
 
+       * 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 358f9c1..1edf306 100644 (file)
@@ -150,6 +150,7 @@ class SC_alt_db_navframe {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
                $this->doc->setModuleTemplate('templates/alt_db_navframe.html');
+               $this->doc->showFlashMessages = FALSE;
 
                        // get HTML-Template
 
index 1d621e2..6a42563 100644 (file)
@@ -124,6 +124,7 @@ class SC_alt_file_navframe {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $BACK_PATH;
                $this->doc->setModuleTemplate('templates/alt_file_navframe.html');
+               $this->doc->showFlashMessages = FALSE;
 
                        // Adding javascript code for AJAX (prototype), drag&drop and the filetree as well as the click menu code
                $this->doc->getDragDropCode('folders');
index 7b4643d..06b2605 100644 (file)
@@ -215,6 +215,12 @@ class template {
        protected $pageRenderer;
        protected $pageHeaderFooterTemplateFile = '';   // alternative template file
 
+       /**
+        * Whether flashmessages should be rendered or not
+        *
+        * @var $showFlashMessages
+        */
+       public $showFlashMessages = TRUE;
 
        /**
         * Constructor
@@ -1895,26 +1901,28 @@ $str.=$this->docBodyTagBegin().
                        $moduleBody = t3lib_parsehtml::substituteSubpart($moduleBody, $marker, $content);
                }
 
-                       // adding flash messages
-               $flashMessages = t3lib_FlashMessageQueue::renderFlashMessages();
-               if (!empty($flashMessages)) {
-                       $flashMessages = '<div id="typo3-messages">' . $flashMessages . '</div>';
-               }
+               if ($this->showFlashMessages) {
+                               // adding flash messages
+                       $flashMessages = t3lib_FlashMessageQueue::renderFlashMessages();
+                       if (!empty($flashMessages)) {
+                               $flashMessages = '<div id="typo3-messages">' . $flashMessages . '</div>';
+                       }
 
-               if (strstr($moduleBody, '###FLASHMESSAGES###')) {
-                               // either replace a dedicated marker for the messages if present
-                       $moduleBody = str_replace(
-                               '###FLASHMESSAGES###',
-                               $flashMessages,
-                               $moduleBody
-                       );
-               } else {
-                               // or force them to appear before the content
-                       $moduleBody = str_replace(
-                               '###CONTENT###',
-                               $flashMessages . '###CONTENT###',
-                               $moduleBody
-                       );
+                       if (strstr($moduleBody, '###FLASHMESSAGES###')) {
+                                       // either replace a dedicated marker for the messages if present
+                               $moduleBody = str_replace(
+                                       '###FLASHMESSAGES###',
+                                       $flashMessages,
+                                       $moduleBody
+                               );
+                       } else {
+                                       // or force them to appear before the content
+                               $moduleBody = str_replace(
+                                       '###CONTENT###',
+                                       $flashMessages . '###CONTENT###',
+                                       $moduleBody
+                               );
+                       }
                }
 
                        // replacing all markers with the finished markers and return the HTML content