Results 1 to 4 of 4

Thread: toggle visibility for member activation: callback or hook?

  1. #1
    User
    Join Date
    11-24-13.
    Posts
    44

    Default toggle visibility for member activation: callback or hook?

    Hi and first of all happy Christmas for everyone!!!

    I need to do something when a member is activated (or deactivated) in the backend through the toggle visibility green eye icon. I tried the activateAccount hook, but it seems to be fired only when is clicked the activation link sent in email..

    Any idea?

    Thank you!

    Davide

  2. #2
    User
    Join Date
    11-24-13.
    Posts
    44

    Default

    I've found a way that consists of using the save_callback. I've added in my extension/dca/tl_member.php the following line:

    PHP Code:
    $GLOBALS['TL_DCA']['tl_member']['fields']['disable']['save_callback'][] = array('MyClass''mySaveCallback'); 
    The problem is that in mySaveCallback i receive as argument only the value of the visibility status, but I have not any information about the member!
    How can I get the member info?
    Last edited by DavideR; 12/26/2015 at 21:04.

  3. #3
    User
    Join Date
    11-24-13.
    Posts
    44

    Default

    Searching in Contao sourcecode I've found that there is a second argument that can be passed to my mySaveCallback(), that contains a DC_Table object,
    but I can't find any information in it about my member..

  4. #4
    User
    Join Date
    11-24-13.
    Posts
    44

    Default

    Ok, I found some documentation about DC_Table: https://contao.org/en/news/accessing...n-the-dca.html

    The problem now is that $dc->id is not valorized...

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
  •