/** * Returns the non-editable form of preset values * * @param array preset record data * @param array fields which are preset as fixed fields * @return string */ function showPresetData($rec, $fixedFields) { global $LANG, $BACK_PATH, $TCA, $TYPO3_CONF_VARS; $content = ''; if (!is_array($rec)) { $rec = array(); } require_once PATH_txdam . 'lib/class.tx_dam_simpleforms.php'; $form = t3lib_div::makeInstance('tx_dam_simpleForms'); $form->initDefaultBEmode(); $form->setVirtualTable('tx_dam_simpleforms', 'tx_dam'); $form->prependFormFieldNames = 'ignore'; $form->removeRequired($TCA['tx_dam_simpleforms']); $form->removeMM($TCA['tx_dam_simpleforms']); $form->setNonEditable($TCA['tx_dam_simpleforms']); $form->tx_dam_fixedFields = $fixedFields; $rec['uid'] = 1; $rec['pid'] = 0; $rec['media_type'] = TXDAM_mtype_undefined; $rec = tx_dam_db::evalData('tx_dam', $rec); // workaround for the dumb formatValue function in tceforms which do not handle empty strings $rec['date_cr'] = intval($rec['date_cr']); $rec['date_mod'] = intval($rec['date_mod']); $columnsOnly = $TCA['tx_dam']['txdamInterface']['index_fieldList']; if ($columnsOnly) { $content .= $form->getListedFields('tx_dam_simpleforms', $rec, $columnsOnly); } else { $content .= $form->getMainFields('tx_dam_simpleforms', $rec); } $content = $form->wrapTotal($content, $rec, 'tx_dam_simpleforms'); $form->removeVirtualTable('tx_dam_simpleforms'); return $content; }