Added feature #15907: file_edit: add hooks to mutate the output
authorSteffen Kamper <info@sk-typo3.de>
Mon, 11 Oct 2010 22:16:35 +0000 (22:16 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 11 Oct 2010 22:16:35 +0000 (22:16 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9040 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/file_edit.php

index 5158b06..aa3248e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-10-11  Steffen Kamper  <steffen@typo3.org>
 
+       * Added feature #15907: file_edit: add hooks to mutate the output
        * Added feature #15900: [Feature] Add SVG support for all browsers
        * Fixed bug #12376: typo3temp got filled with thousands of javascript_* files (Thanks to Georg Ringer)
 
index 1df649f..d83b5e1 100644 (file)
@@ -155,6 +155,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 +206,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'],