on_submit_callback for tl_files module
Hi
I would like to implement a solution to save the file names of folder names created in the filemanager backend module before they are "romanized" by Contao. My idea is to call an on_submit_callback where I would get the POST data and save them somewhere.
I added this line to system/config/dcaconfig.php :
$GLOBALS['TL_DCA']['tl_files']['config']['onsubmit_callback'] = array('myUpload','saveRealName');
and I created a file named myUpload.php which defines the myUpload class and the function saveRealName.
Of course it doesn't work (not called) but I don't know why: where should I put this class ? (Now it is in the system/modules/backend folder)
Thank you for your help
Aïda
Re: on_submit_callback for tl_files module
I guess it should be:
[code=php:2q1ly124]<span class="syntaxdefault">
$GLOBALS</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'TL_DCA'</span><span class="syntaxkeyword">][</span><span class="syntaxstring">'tl_files'</span><span class="syntaxkeyword">][</span><span class="syntaxstring">'config'</span><span class="syntaxkeyword">][</span><span class="syntaxstring">'onsubmit_callback'</span><span class="syntaxkeyword">][]*=*array(</span><span class="syntaxstring">'myUpload'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'saveRealName'</span><span class="syntaxkeyword">);
*</span><span class="syntaxdefault"></span>[/code:2q1ly124]
Re: on_submit_callback for tl_files module
Thank you but it still doesn't work...
Re: on_submit_callback for tl_files module
I didn't find how to call my onsubmit_callback. Is there a way to give the path to the file which contains the callback ? I don't want to put the function in tl_files.php
And secondly, how to give parameters to the callback ?
Please help...
Thanks
Re: on_submit_callback for tl_files module
Is is possible to close this topic since I'm going to open a new one in the developers corner ?
Thanks