Fixed bug #16049: Loading mask doesn't disappear on hitting Esc/cancel loading
[Packages/TYPO3.CMS.git] / typo3 / file_edit.php
index 1df649f..5eace83 100644 (file)
@@ -110,9 +110,10 @@ class SC_file_edit {
                        $this->target='';
                }
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
-               if (!$this->target || !$key)    {
-                       t3lib_BEfunc::typo3PrintError($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
-                       exit;
+               if (!$this->target || !$key) {
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
+                       throw new RuntimeException($title . ': ' . $message);
                }
                        // Finding the icon
                switch($GLOBALS['FILEMOUNTS'][$key]['type'])    {
@@ -155,6 +156,20 @@ class SC_file_edit {
 
                $this->content = $this->doc->startPage($LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
 
+                       // hook before compiling the output
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
+                       $preOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'];
+                       if (is_array($preOutputProcessingHook)) {
+                               $hookParameters = array(
+                                       'content' => &$this->content,
+                                       'target' => &$this->target,
+                               );
+                               foreach ($preOutputProcessingHook as $hookFunction)     {
+                                       t3lib_div::callUserFunction($hookFunction, $hookParameters, $this);
+                               }
+                       }
+               }
+
                $pageContent = $this->doc->header($LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
                $pageContent .= $this->doc->spacer(2);
 
@@ -192,6 +207,20 @@ class SC_file_edit {
                $pageContent.= $this->doc->sectionEnd();
                $pageContent.=$code;
 
+                               // hook after compiling the output
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'])) {
+                       $postOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'];
+                       if (is_array($postOutputProcessingHook)) {
+                               $hookParameters = array(
+                                       'pageContent' => &$pageContent,
+                                       'target' => &$this->target,
+                               );
+                               foreach ($postOutputProcessingHook as $hookFunction)    {
+                                       t3lib_div::callUserFunction($hookFunction, $hookParameters, $this);
+                               }
+                       }
+               }
+
                        // Add the HTML as a section:
                $markerArray = array(
                        'CSH' => $docHeaderButtons['csh'],