[TYPO3-dev] Dynamic path in $TCA
Vivian Pennel
vpennel at iocean.fr
Fri Mar 27 14:07:20 CET 2009
Hello Benjamin,
Thanks for your answer.
Based on this, i've tried to do this (i would like to avoid to modifiy
typo3 core if i can) in extTables.php :
$page_array = t3lib_div::_GP(['edit']['pages']);
if(!empty($page_array) && is_array($page_array) {
foreach($page_array as $uid=>$cmd){
$pid[] = $uid;
}
}
$GLOBALS['TCA']['pages']['columns']['media']['config']['uploadfolder']
= 'fileadmin/user_upload/stif/'.$pid[0];
It seems to work nicely but maybe i've miss something. The only problem
is that typo3 does not auto create destination directory.
But i can do a test on PATH and use t3lib_div::mkdir() to solve this
problem i think.
Benjamin Mack a écrit :
> Hey Vivian,
>
> sounds like a nice idea, however this is currently not possible that
> way, but it'd be great if you'd create a feature request in the BT or
> even code it yourself and send the feature to the core list so we can
> get it in the next version.
>
> For now, I could imagine to have a very hacky way to get it done right
> now, would be to modify the TCA in the extTables.php based on PHP
> conditions, I had this in one installation to modify the output of the
> TCEforms:
>
> =========
> if ($_REQUEST['id'] == 115 || strpos($_REQUEST['returnUrl'], 'id=115')) {
> $GLOBALS['TCA']['tx_cal_event']['ctrl']['title'] = 'Publikationen';
> $GLOBALS['TCA']['tx_cal_category']['ctrl']['title'] = 'Kategorien';
> }
> ==========
>
> I hope you can get the trick and start off, if you need it "quick and
> dirty", however I'd recommend looking into the t3lib class where the
> uploadfolder variable is used and change it accordingly to that.
>
> All the best,
> Benni.
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
More information about the TYPO3-dev
mailing list