Added two post-processing hooks into t3lib_tcemain->moveRecord. They are required...
authorRobert Lemke <robert.lemke@typo3.org>
Thu, 17 Nov 2005 09:13:15 +0000 (09:13 +0000)
committerRobert Lemke <robert.lemke@typo3.org>
Thu, 17 Nov 2005 09:13:15 +0000 (09:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@866 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index 2e91cd6..cbf8c0d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-11-17     Robert Lemke    <robert@typo3.org>
+       * Added two post-processing hooks into t3lib_tcemain->moveRecord. They are required by TemplaVoila 1.0
+
 2006-11-15  Sebastian Kurfuerst  <sebastian@garbage-group.de>
 
        * Fixed bug #569: The "Access Key" combination now added to the "title" attribute of images
index adf831f..3607722 100755 (executable)
@@ -2677,10 +2677,18 @@ class t3lib_TCEmain     {
         * @return      void
         */
        function moveRecord($table,$uid,$destPid)       {
-               global $TCA;
+               global $TCA, $TYPO3_CONF_VARS;
 
                if ($TCA[$table])       {
 
+                               // Prepare user defined objects (if any) for hooks which extend this function:
+                       $hookObjectsArr = array();
+                       if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'])) {
+                               foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'] as $classRef) {
+                                       $hookObjectsArr[] = &t3lib_div::getUserObj($classRef);
+                               }
+                       }
+
                                // In case the record to be moved turns out to be an offline version, we have to find the live version and work on that one (this case happens for pages with "branch" versioning type)
                        if ($lookForLiveVersion = t3lib_BEfunc::getLiveVersionOfRecord($table,$uid,'uid'))      {
                                $uid = $lookForLiveVersion['uid'];
@@ -2761,6 +2769,13 @@ class t3lib_TCEmain      {
                                                                        // Create query for update:
                                                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($uid), $updateFields);
 
+                                                                       // Call post processing hooks:
+                                                               foreach($hookObjectsArr as $hookObj) {
+                                                                       if (method_exists($hookObj, 'moveRecord_firstElementPostProcess')) {
+                                                                               $hookObj->moveRecord_firstElementPostProcess($table, $uid, $destPid, $moveRec, $updateFields, $this);
+                                                                       }
+                                                               }
+
                                                                        // Logging...
                                                                $newPropArr = $this->getRecordProperties($table,$uid);
                                                                $oldpagePropArr = $this->getRecordProperties('pages',$propArr['pid']);
@@ -2795,6 +2810,13 @@ class t3lib_TCEmain      {
                                                                                $updateFields[$sortRow] = $sortInfo['sortNumber'];
                                                                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($uid), $updateFields);
 
+                                                                                       // Call post processing hooks:
+                                                                               foreach($hookObjectsArr as $hookObj) {
+                                                                                       if (method_exists($hookObj, 'moveRecord_afterAnotherElementPostProcess')) {
+                                                                                               $hookObj->moveRecord_afterAnotherElementPostProcess($table, $uid, $destPid, $origDestPid, $moveRec, $updateFields, $this);
+                                                                                       }
+                                                                               }
+
                                                                                        // Logging...
                                                                                $newPropArr = $this->getRecordProperties($table,$uid);
                                                                                $oldpagePropArr = $this->getRecordProperties('pages',$propArr['pid']);