[TYPO3-team-templavoila] RFC: #13001: Bugfix: new page wizard should respect TCEFORM.pages.* settings

Steffen Kamper info at sk-typo3.de
Fri Dec 18 10:26:05 CET 2009


Hi Tolleiv,

+1 by reading and testing.
I only found getAllowedTSconfigItemsByFieldName too complicate, see my 
suggest:


function getAllowedTSconfigItemsByFieldName($parentPageId, $fieldName) {

		// Get PageTSconfig for reduce the output of selectded template structs
	$disallowPageTemplateStruct = 
t3lib_BEfunc::getModTSconfig(abs($parentPageId), 'TCEFORM.pages.' . 
$fieldName);
	
	if ( isset($disallowPageTemplateStruct['properties']['removeItems']) ) {
		$disallowedPageTemplateList = 
$disallowPageTemplateStruct['properties']['removeItems'];
	}
	
	$tmp_disallowedPageTemplateItems = 
array_unique(t3lib_div::intExplode(',', 
t3lib_div::expandList($disallowedPageTemplateList), TRUE));
	return ( count($tmp_disallowedPageTemplateItems) ) ? implode(',', 
$tmp_disallowedPageTemplateItems) : '0';
}

Also the name of the function is wrong as it returns the disallowed 
items, so should read "getDisallowedTSconfigItemsByFieldName", also the 
phpdoc must be changed to reflect that.

vg Steffen


More information about the TYPO3-team-templavoila mailing list