Results 1 to 5 of 5

Thread: on_submit_callback for tl_files module

  1. #1
    User
    Join Date
    01-26-10.
    Posts
    37

    Default 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

  2. #2
    User
    Join Date
    07-26-09.
    Posts
    175

    Default 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]

  3. #3
    User
    Join Date
    01-26-10.
    Posts
    37

    Default Re: on_submit_callback for tl_files module

    Thank you but it still doesn't work...

  4. #4
    User
    Join Date
    01-26-10.
    Posts
    37

    Default 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

  5. #5
    User
    Join Date
    01-26-10.
    Posts
    37

    Default 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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •