Results 1 to 3 of 3

Thread: onsubmit_callback, save_callback not triggered

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

    Default onsubmit_callback, save_callback not triggered

    Hi

    I have made a module (fexplorer) which is a copy of the file manager backend module. My purpose is to make a little change that enables me to get the name of the submitted files before they are romanized. I can't find a way to do that. I've tried to call an onsubmit_callback (save_callback as well)) but it is not triggered I don't know why. This is what I've done in the dca :
    Code:
    $GLOBALS['TL_DCA']['tl_fexplorer'] = array
    (
    
    	// Config
    	'config' => array
    	(
    		'dataContainer'               => 'Folder',
    		'uploadScript'                => 'fancyUpload',
    		'onload_callback' => array
    		(
    			array('Fexplorer', 'checkPermission'),
    			array('Fexplorer', 'addBreadcrumb')
    		),
    		'onsubmit_callback' => array('Fexplorer','saveRealName')
    	),
    The hook "postUpload" is not useful since it is called at the end of the upload process when the file names are already romanized.

    Please, can someone tell me how to access the posted data before they are processed by Contao ?

    Thank you

  2. #2
    User Toflar's Avatar
    Join Date
    06-19-09.
    Location
    Lyss, Switzerland
    Posts
    170

    Default Re: onsubmit_callback, save_callback not triggered

    Compare the onload_callback and the onsubmit_callback in your code

    You can see straight away that there's an array missing
    You don't want to take other developers the possibility to add more onsubmit_callbacks, do you?
    Regards

    Yanick - Contao core developer @terminal42 gmbh

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

    Default Re: onsubmit_callback, save_callback not triggered

    [code=php:1rug06gx]<span class="syntaxdefault">
    $GLOBALS</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'TL_DCA'</span><span class="syntaxkeyword">][</span><span class="syntaxstring">'tl_fexplorer'</span><span class="syntaxkeyword">]*=*array
    (

    ***</span><span class="syntaxcomment">//*Config
    ***</span><span class="syntaxstring">'config'*</span><span class="syntaxkeyword">=>*array
    ***(
    ******</span><span class="syntaxstring">'dataContainer'******* ********</span><span class="syntaxkeyword">=>*</span><span class="syntaxstring">'Folder'</span><span class="syntaxkeyword">,
    ******</span><span class="syntaxstring">'uploadScript'*******Â  ********</span><span class="syntaxkeyword">=>*</span><span class="syntaxstring">'fancyUpload'</span><span class="syntaxkeyword">,
    ******</span><span class="syntaxstring">'onload_callback'*</span><span class="syntaxkeyword">=>*array
    ******(
    *********array(</span><span class="syntaxstring">'Fexplorer'</span><span class="syntaxkeyword">,*</span><span class="syntaxstring">'checkPermission'</span><span class="syntaxkeyword">),
    *********array(</span><span class="syntaxstring">'Fexplorer'</span><span class="syntaxkeyword">,*</span><span class="syntaxstring">'addBreadcrumb'</span><span class="syntaxkeyword">)
    ******),
    ******</span><span class="syntaxstring">'onsubmit_callback'*</span><span class="syntaxkeyword">=>*array
    ******(
    *********array(</span><span class="syntaxstring">'Fexplorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'saveRealName'</span><span class="syntaxkeyword">)
    ******)
    ***),
    *</span><span class="syntaxdefault"></span>[/code:1rug06gx]

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
  •