Example #1
0
 /**
  * Hooks in class t3lib/class.t3lib_tceforms.php
  *
  * @param string $table
  * @param array $row
  * @return void
  */
 public function getMainFields_postProcess($table, $row)
 {
     if (!self::$executed) {
         self::$executed = TRUE;
         $config = Tx_Dynaflex_Utility_TcaUtility::loadDynaFlexConfig($table, $row['pid'], $row);
         if ($config !== FALSE) {
             $dataStructArray = NULL;
             $this->callDynaFlex($table, $config['DCA'], $dataStructArray, $config['cleanUpField']);
         }
     }
 }
Example #2
0
 /**
  * After database dynaflex handling
  *
  * @param string $table Table
  * @param int $id Id
  *
  * @return void
  */
 protected function afterDatabaseHandleDynaflex($table, $id)
 {
     $backendUser = $this->getBackendUser();
     $record = BackendUtility::getRecord($table, $id);
     $backendUser->uc['txcommerce_afterDatabaseOperations'] = 1;
     $backendUser->writeUC();
     $dynaFlexConf = Tx_Dynaflex_Utility_TcaUtility::loadDynaFlexConfig($table, $record['pid'], $record);
     $dynaFlexConf = $dynaFlexConf['DCA'];
     $backendUser->uc['txcommerce_afterDatabaseOperations'] = 0;
     $backendUser->writeUC();
     if (!is_array($dynaFlexConf) || !count($dynaFlexConf)) {
         return;
     }
     // txcommerce_copyProcess: this is so that dynaflex is not called when we copy
     // an article - otherwise we would get an error
     if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dynaflex') && (!isset($backendUser->uc['txcommerce_copyProcess']) || $backendUser->uc['txcommerce_copyProcess'])) {
         $dynaFlexConf[0]['uid'] = $id;
         $dynaFlexConf[1]['uid'] = $id;
         /**
          * Dynaflex
          *
          * @var Tx_Dynaflex_Utility_TcaUtility $dynaflex
          */
         $dynaflex = GeneralUtility::makeInstance('Tx_Dynaflex_Utility_TcaUtility', $GLOBALS['TCA'], $dynaFlexConf);
         $GLOBALS['TCA'] = $dynaflex->getDynamicTCA();
     }
 }