[TYPO3-irre] hiding delete button

Stephan Petzl spetzl at gmx.at
Mon Jul 6 14:53:00 CEST 2009


Stephan Petzl schrieb:
> is it possible to hide delete buttons of the IRRE records?
> 
after some debugging i found out that this can be set in tca.php:

'image_records' => Array (
	'config' => Array (
		'type' => "inline",
		'appearance' => array(
			'enabledControls' => array(
				'new' => 0,
				'delete' => 0,
			),
			'levelLinksPosition' => 'none',
...


CAUTION: the enabledControls section is not supported by TYPO3 < 4.3, 
you have to use a hook instead.
register the hook in your ext_localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms_inline.php']['tceformsInlineHook'][] 
= 
"EXT:".$_EXTKEY."/hooks/class.tx_yourextension_tceformsInlineHook.php:&tx_yourextension_tceformsInlineHook";

and then create the hook:

<?php

require_once($GLOBALS['_SERVER']['DOCUMENT_ROOT'].'/t3lib/interfaces/interface.t3lib_tceformsinlinehook.php');

class tx_gorillary_tceformsInlineHook implements t3lib_tceformsInlineHook{
	
	public function init(&$parentObject){
	}
	

					
	public function renderForeignRecordHeaderControl_preProcess($parentUid, 
$foreign_table, array $rec, array $config, $isVirtual, array 
&$enabledControls){
		$enabledControls['new'] = 0;
		$enabledControls['delete'] = 0;
	}
	
	public function 
renderForeignRecordHeaderControl_postProcess($parentUid, $foreignTable, 
array $childRecord, array $childConfig, $isVirtual, array &$controlItems){
	}
}
?>

-- 
Best Regards
Stephan Petzl
http://netrabbit.at


More information about the TYPO3-project-irre mailing list