[TYPO3-dev] Filebrowser in BE module

Steffen Kamper steffen at dislabs.de
Tue Oct 17 01:22:14 CEST 2006


"Markus Lange" <markus.lange at bgm-gmbh.de> schrieb im Newsbeitrag 
news:mailman.21020.1160994105.20124.typo3-dev at lists.netfielders.de...
> Hi,
>
> Steffen Kamper wrote:
>> This is an interesting question for me too. In the TCE-Forms there are
>> these browselinks with the different types, but i couldn't found the
>> creation in code (using class SC_Browser). Is there an official
>> functioncall for these ones ?
> i dont know
>
> you have to examine the class t3lib_TCEforms
> here is an example you have to adjust:
>
> .......
> $config['itemFormElName'] = 'data[' . $cfg['uid'] . '][values][' .
> $languid . '][0]';
> $config['fieldConf']['config']['internal_type'] = 'file';
> $config['fieldConf']['config']['allowed'] = $cfg['allowed'];
> $config['fieldConf']['config']['disallowed'] = $cfg['disallowed'];
> $config['fieldConf']['config']['size'] = $cfg['files'];
> $config['fieldConf']['config']['show_thumbs'] = 0;
> $config['fieldConf']['config']['uploadfolder'] = 'uploads/prodb/' .
> $cfg['uploadpath'];
> $config['itemFormElValue'] = $data[0] ? $data[0] : ' ';
>
> $form = t3lib_div::makeInstance('t3lib_TCEforms');
> $form->initDefaultBEMode();
>
>
> $form = $form->getSingleField_typeGroup( 'tx_bgmprodb_record', 'upload',
> array(), $config );
>
> $out =  $form->JStop();
> $out .= $form;
> $out .= $form->JSbottom();
> ........
>
>
>
> NOTICE:
> itemFormElName -> this is the name of the formfield
> itemFormElValue -> this is the data
> the method getSingelField_xx just returns a input field set
> by config.
> for needed js for filling and deleting items you have to call
> jstop/bottom
>
> you probably have to store the values for yourself
> the config array can be loaded by loadTCA() also !!!!!!!
>
>
> The best way is to debug the config in the method getSingleField_typeXXXX
> in class t3lib_TCEforms to see a proper defined config array
>
> Happy digging!!
> hth
>
>
> -- 
> Markus Lange
>
>

ok, now i'm one step further:

$form = t3lib_div::makeInstance('t3lib_TCEforms');
$form->initDefaultBEMode();
$form->backPath='../../../../typo3/';

$elements = $form->getSingleField_typeGroup( 'tx_skdev', 'upload',array(), 
$config );
$out.= 
$form->printNeededJSFunctions_top().$elements.$form->printNeededJSFunctions();

I had to change the JS-Output like done in alt_doc.
First  i got some problems with the path.and had to add one mor ../ to 
$BACK_PATH

Now I see my Browserwindow right and I can configure the $config  right.way.

Many Thanx agaib for showing the way ;-)

vg  Steffen






More information about the TYPO3-dev mailing list