Index: class.tslib_content.php =================================================================== RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/cms/tslib/class.tslib_content.php,v retrieving revision 1.96 diff -u -b -r1.96 class.tslib_content.php --- class.tslib_content.php 27 Dec 2005 20:26:14 -0000 1.96 +++ class.tslib_content.php 17 Jan 2006 09:28:20 -0000 @@ -6645,6 +6645,10 @@ $conf['allow']='new'; } + if ($conf['newRecordInPid']) $nPid = $conf['newRecordInPid']; + if ($conf['newRecordInPid.']) $nPid = $this->stdWrap($conf['newRecordInPid'],$conf['newRecordInPid.']); + if (!intval($nPid)) unset($nPid); + if (!$currentRecord) $currentRecord=$this->currentRecord; if (!count($dataArr)) $dataArr=$this->data; list($table,$uid) = explode(':',$currentRecord); @@ -6667,6 +6671,10 @@ $mayEdit = count($allow)&&($perms&16); if ($conf['newRecordFromTable']) { $newUid=$GLOBALS['TSFE']->id; + + if ($nPid) { + $newUid=$nPid; + } } else { $newUid = -1*$uid; } @@ -6751,9 +6759,9 @@ } if (isset($allow['new'])) { if ($table=='pages') { - $panel.=$this->editPanelLinkWrap('',$formName,'new',$currentRecord); + $panel.=$this->editPanelLinkWrap('',$formName,'new',$currentRecord,'',$nPid); } else { - $panel.=$this->editPanelLinkWrap('',$formName,'new',$currentRecord); + $panel.=$this->editPanelLinkWrap('',$formName,'new',$currentRecord,'',$nPid); } } if (isset($allow['delete'])) {$panel.=$this->editPanelLinkWrap('',$formName,'delete','',$BE_USER->extGetLL('p_deleteConfirm')); } @@ -6869,7 +6877,7 @@ * @access private * @see editPanel(), editIcons(), t3lib_tsfeBeUserAuth::extEditAction() */ - function editPanelLinkWrap($string,$formName,$cmd,$currentRecord='',$confirm='') { + function editPanelLinkWrap($string,$formName,$cmd,$currentRecord='',$confirm='',$nPid='') { $eFONPage = $GLOBALS['BE_USER']->uc['TSFE_adminConfig']['edit_editFormsOnPage']; $nV=t3lib_div::_GP('ADMCMD_view')?1:0; $adminURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL').TYPO3_mainDir; @@ -6882,7 +6890,9 @@ if ($rParts[0]=='pages') { $out=$this->editPanelLinkWrap_doWrap($string,$adminURL.'db_new.php?id='.$rParts[1].'&pagesOnly=1',$currentRecord); } else { + if (!intval($nPid)) { $nPid = t3lib_div::testInt($rParts[1]) ? -$rParts[1] : $GLOBALS['TSFE']->id; + } $out=$this->editPanelLinkWrap_doWrap($string,$adminURL.'alt_doc.php?edit['.$rParts[0].']['.$nPid.']=new&noView='.$nV,$currentRecord); } } else {