From: Oliver Hader Date: Wed, 26 Dec 2007 16:15:27 +0000 (+0000) Subject: Fixed bug #6651: IRRE - Button for creating new records disappeared on nested child... X-Git-Tag: TYPO3_4-2-0alpha3~52 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/53c825815c279d7582fe28a3ef6eeff5d1cd436d Fixed bug #6651: IRRE - Button for creating new records disappeared on nested child records if a parent record reached the maxitems value git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2858 709f56b5-9817-0410-a4d7-c38de5d9e867 --- diff --git a/ChangeLog b/ChangeLog index d85c790a3114..cc81005c5734 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-12-26 Oliver Hader + + * (minor) Fixed bug #6651: IRRE - Button for creating new records disappeared on nested child records if a parent record reached the maxitems value + 2007-12-21 Oliver Hader * (minor) Fixed bug #6007: IRRE - Child records with image fields are not shown in m:n disposal diff --git a/t3lib/class.t3lib_tceforms_inline.php b/t3lib/class.t3lib_tceforms_inline.php index bf869f548278..932b44934ea3 100755 --- a/t3lib/class.t3lib_tceforms_inline.php +++ b/t3lib/class.t3lib_tceforms_inline.php @@ -190,7 +190,10 @@ class t3lib_TCEforms_inline { // Tell the browser what we have (using JSON later): $top = $this->getStructureLevel(0); - $this->inlineData['config'][$nameObject] = array('table' => $foreign_table); + $this->inlineData['config'][$nameObject] = array( + 'table' => $foreign_table, + 'md5' => md5($nameObject), + ); $this->inlineData['config'][$nameObject.'['.$foreign_table.']'] = array( 'min' => $minitems, 'max' => $maxitems, @@ -492,7 +495,8 @@ class t3lib_TCEforms_inline { $isOnSymmetricSide = t3lib_loadDBGroup::isOnSymmetricSide($parentUid, $config, $rec); $enableManualSorting = $tcaTableCtrl['sortby'] || $config['MM'] || (!$isOnSymmetricSide && $config['foreign_sortby']) || ($isOnSymmetricSide && $config['symmetric_sortby']) ? true : false; - $nameObjectFt = $this->inlineNames['object'].'['.$foreign_table.']'; + $nameObject = $this->inlineNames['object']; + $nameObjectFt = $nameObject.'['.$foreign_table.']'; $nameObjectFtId = $nameObjectFt.'['.$rec['uid'].']'; $calcPerms = $GLOBALS['BE_USER']->calcPerms( @@ -523,10 +527,11 @@ class t3lib_TCEforms_inline { ($isPagesTable && ($calcPerms&8)) // For pages, must have permission to create new pages here. ) { $onClick = "return inline.createNewRecord('".$nameObjectFt."','".$rec['uid']."')"; + $class = ' class="inlineNewButton '.$this->inlineData['config'][$nameObject]['md5'].'"'; if ($config['inline']['inlineNewButtonStyle']) { $style = ' style="'.$config['inline']['inlineNewButtonStyle'].'"'; } - $cells[]=''. + $cells[]=''. 'backPath,'gfx/new_'.($isPagesTable?'page':'el').'.gif','width="'.($isPagesTable?13:11).'" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:new'.($isPagesTable?'Page':'Record'),1).'" alt="" />'. ''; } @@ -778,17 +783,23 @@ class t3lib_TCEforms_inline { * @return string The HTML code for the new record link */ function getNewRecordLink($objectPrefix, $conf = array()) { - if ($conf['inline']['inlineNewButtonStyle']) $style = ' style="'.$conf['inline']['inlineNewButtonStyle'].'"'; + $nameObject = $this->inlineNames['object']; + $class = ' class="inlineNewButton '.$this->inlineData['config'][$nameObject]['md5'].'"'; + + if ($conf['inline']['inlineNewButtonStyle']) { + $style = ' style="'.$conf['inline']['inlineNewButtonStyle'].'"'; + } $onClick = "return inline.createNewRecord('$objectPrefix')"; $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.createnew',1); - if ($conf['appearance']['newRecordLinkAddTitle']) + if ($conf['appearance']['newRecordLinkAddTitle']) { $tableTitle .= ' '.$GLOBALS['LANG']->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'],1); + } $out = '