* Created new hook in class.t3lib_tcemain.php in process_datamap. Search for $TYPO3_C...
authorRobert Lemke <robert.lemke@typo3.org>
Fri, 11 Jun 2004 15:21:18 +0000 (15:21 +0000)
committerRobert Lemke <robert.lemke@typo3.org>
Fri, 11 Jun 2004 15:21:18 +0000 (15:21 +0000)
(other hooks in that class will follow by Ren�, as I know from a trusted source ... ;-)

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@370 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index 908a88d..4e89aa9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-11  Robert Lemke  <rl@robertlemke.de>
+
+       * Created new hook in class.t3lib_tcemain.php in process_datamap. Search for $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
+       (other hooks in that class will follow by René, as I know from a trusted source ... ;-)
+
 2004-06-09  Robert Lemke  <rl@robertlemke.de>
 
        * Fixed bug #0000123:
index 33a98c5..f7b7197 100755 (executable)
@@ -420,7 +420,7 @@ class t3lib_TCEmain {
         * @return      [type]          ...
         */
        function process_datamap() {
-               global $TCA;
+               global $TCA, $TYPO3_CONF_VARS;
                reset ($this->datamap);
 
                        // Organize tables so that the pages-table are always processed first. This is required if you want to make sure that content pointing to a new page will be created.
@@ -553,12 +553,22 @@ class t3lib_TCEmain       {
                                                                $fieldArray[$TCA[$table]['ctrl']['tstamp']]=time();
                                                        }
 
-                                                               // Performing insert/update
-                                                       if ($status=='new')     {
-//                                                             if ($pid_value<0)       {$fieldArray = $this->fixCopyAfterDuplFields($table,$id,abs($pid_value),0,$fieldArray);}        // Out-commented 02-05-02: I couldn't understand WHY this is needed for NEW records. Obviously to proces records being copied? Problem is that the fields are not set anyways and the copying function should basically take care of this!
-                                                               $this->insertDB($table,$id,$fieldArray);
-                                                       } else {
-                                                               $this->updateDB($table,$id,$fieldArray);
+                                                               // Hook: processDatamapClass
+                                                       if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'])) {
+                                                               foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'] as $_classRef) {
+                                                                       $_procObj = &t3lib_div::getUserObj ($_classRef);
+                                                                       $_procObj->processDatamap_preProcessFieldArray ($status, $table, $id, &$fieldArray, &$this);
+                                                               }
+                                                       }
+
+                                                               // Performing insert/update. If fieldArray has been unset by some userfunction (see hook above), don't do anything
+                                                       if (is_array ($fieldArray)) {
+                                                               if ($status=='new')     {
+       //                                                              if ($pid_value<0)       {$fieldArray = $this->fixCopyAfterDuplFields($table,$id,abs($pid_value),0,$fieldArray);}        // Out-commented 02-05-02: I couldn't understand WHY this is needed for NEW records. Obviously to proces records being copied? Problem is that the fields are not set anyways and the copying function should basically take care of this!
+                                                                       $this->insertDB($table,$id,$fieldArray);
+                                                               } else {
+                                                                       $this->updateDB($table,$id,$fieldArray);
+                                                               }
                                                        }
                                                }       // if ($recordAccess)   {
                                        }       // if (is_array($incomingFieldArray))   {